Muzo API
A Dart package for extracting audio and video streams from YouTube videos. This package acts as a logical wrapper (similar to InnerTube implementations) to fetch streaming data, parse adaptive formats, and handle multiple audio languages.
Features
- Extract Video Streams: Get video streams with resolution, bitrate, and codecs.
- Extract Audio Streams: Get audio streams with bitrate, sample rate, and channels.
- Multi-Language Support: Detect and list available audio tracks for multi-language videos (dubbed content).
- Easy to Use: Simple API to fetch data by Video ID.
Getting Started
Add this to your package's pubspec.yaml file:
dependencies:
muzoapi: ^0.0.1
Usage
import 'package:muzoapi/youtube_stream_provider.dart';
void main() async {
// Initialize the InnerTube instance
final yt = InnerTube();
try {
// Fetch stream info for a video
final videoId = 'YOUR_VIDEO_ID';
final streamInfo = await yt.player(videoId);
print('Video Title: ${streamInfo.title}');
// Check for multiple languages
if (streamInfo.hasMultipleLanguages) {
print('Available Languages: ${streamInfo.availableLanguages}');
}
// List Audio Streams
print('\n--- Audio Streams ---');
for (var audio in streamInfo.audioStreams) {
print('Language: ${audio.languageDisplayName ?? "Default"} | Bitrate: ${audio.bitrate}');
}
// List Video Streams
print('\n--- Video Streams ---');
for (var video in streamInfo.videoStreams) {
print('Resolution: ${video.width}x${video.height} | Quality: ${video.qualityLabel}');
}
} catch (e) {
print('Error fetching video info: $e');
}
}
Additional Information
This package is a "dark" package, meaning it relies on reverse-engineered internal APIs of the target service. It may break if the internal API changes. Use responsibly.
License
MIT