
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
mebox-extractor
Advanced tools
🎬 A powerful and type-safe video metadata extractor for YouTube and Bilibili platforms with full TypeScript support
A powerful and type-safe video metadata extractor for YouTube and Bilibili platforms with full TypeScript support
| Platform | 4K | 1080p | 720p | 360p |
|---|---|---|---|---|
| YouTube | ✅ | ✅ | ✅ | ✅ |
| Bilibili | ⚠️ | ✅ | ✅ | ✅ |
npm install mebox-extractor
import { extract } from 'mebox-extractor'
// Extract YouTube video metadata
const metadata = await extract("https://www.youtube.com/watch?v=dQw4w9WgXcQ")
console.log(metadata.title) // Video title
console.log(metadata.duration) // Duration in seconds
console.log(metadata.thumbnail) // Thumbnail URL
console.log(metadata.downloadURL) // Download URL
import { extract } from 'mebox-extractor'
// Standard YouTube URL
const youtubeMetadata = await extract("https://www.youtube.com/watch?v=dQw4w9WgXcQ")
// YouTube Shorts
const shortsMetadata = await extract("https://youtu.be/dQw4w9WgXcQ")
// With custom options
const hdMetadata = await extract("https://www.youtube.com/watch?v=dQw4w9WgXcQ", {
resolution: '1080p',
cookies: {
'session': 'your-session-cookie'
}
})
import { extract } from 'mebox-extractor'
// Bilibili video
const bilibiliMetadata = await extract("https://www.bilibili.com/video/BV1GJ411x7h7")
// With authentication for higher quality
const hqMetadata = await extract("https://www.bilibili.com/video/BV1GJ411x7h7", {
resolution: '1080p',
cookies: {
'SESSDATA': 'your-sessdata-cookie'
}
})
import { extract } from 'mebox-extractor'
try {
const metadata = await extract("https://unsupported-site.com/video")
} catch (error) {
if (error.message.includes('not supported')) {
console.log('This platform is not supported')
} else if (error.message.includes('video id is not found')) {
console.log('Invalid video URL')
}
}
The extract function returns a VideoMetadataSchema object:
interface VideoMetadataSchema {
website: 'youtube' | 'bilibili'
videoId: string // Platform-specific video ID
url: string // Original video URL
downloadURL: string | [DownloadFormat, DownloadFormat]
previewURL: string // Preview/streaming URL
fps: number // Frames per second
title: string // Video title
description: string // Video description
thumbnail: string // Thumbnail image URL
duration: number // Duration in seconds
subtitles?: SubTitles // Subtitle data (if available)
}
For Bilibili videos, downloadURL is an array with separate video and audio streams:
interface DownloadFormat {
mimeType: string // e.g., 'video/mp4', 'audio/mp4'
url: string // Direct download URL
}
interface SubTitleItem {
start: number // Start time in seconds
end: number // End time in seconds
text: string // Subtitle text
}
type SubTitles = SubTitleItem[]
interface ExtractorOptions {
resolution?: '4k' | '1080p' | '720p' | '360p' // Preferred resolution
cookies?: Record<string, string> // Authentication cookies
}
Note: Higher resolutions may require authentication cookies.
For private or age-restricted videos, provide session cookies:
const metadata = await extract(youtubeUrl, {
cookies: {
'session_token': 'your-session-token'
}
})
For higher quality videos or member-only content:
const metadata = await extract(bilibiliUrl, {
cookies: {
'SESSDATA': 'your-sessdata-cookie',
'buvid3': 'your-buvid3-cookie'
}
})
import { extract } from 'mebox-extractor'
const { extract } = require('mebox-extractor')
import { extract, VideoMetadataSchema, ExtractorOptions } from 'mebox-extractor'
The package also exports utility functions for URL analysis:
import { convertURLToWebsiteKey, getVideoIdByURL } from 'mebox-extractor'
// Check if URL is supported
const website = convertURLToWebsiteKey('https://www.youtube.com/watch?v=dQw4w9WgXcQ')
console.log(website) // 'youtube'
// Extract video ID
const videoId = getVideoIdByURL('https://www.youtube.com/watch?v=dQw4w9WgXcQ')
console.log(videoId) // 'dQw4w9WgXcQ'
git clone https://github.com/one2x/mebox-extractor.git
cd mebox-extractor
npm install
npm run build # Build the project
npm run test # Run tests
npm run test:watch # Run tests in watch mode
npm run test:coverage# Run tests with coverage
npm run typecheck # Type checking
npm run dev # Development mode with watch
npm run clean # Clean build artifacts
The project includes comprehensive tests:
npm test # Run all tests
npm run test:coverage # Run with coverage report
Contributions are welcome! Please follow these steps:
git checkout -b feature/amazing-feature)npm test)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)any types allowedModule Import Errors
Error: Cannot use import statement outside a module
require) or ensure your project supports ES modulesNetwork Timeouts
Rate Limiting
MIT License - see the LICENSE file for details.
FAQs
🎬 A powerful and type-safe video metadata extractor for YouTube and Bilibili platforms with full TypeScript support
We found that mebox-extractor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.