No Examples Found
YouTube Downloader
This function downloads YouTube content at scale with support for video, audio, subtitles, and metadata extraction.
Key Features
- Multiple Content Types: Download videos, audio-only files, subtitles, or metadata.
- Resolution Options: Support for multiple resolutions from 144p to 1080p.
- Video Segments: Extract specific portions of videos using the
start_time
andend_time
parameters. - Format Flexibility:
- Video formats: MP4, WebM
- Audio formats: MP3, WAV, M4A
- Subtitle Support: Download subtitles in multiple languages using ISO-639-1 codes.
- Rich Metadata: Access video details including title, thumbnail, description, tags, and duration.
- Customizable Downloads: Mix and match features like combining video with metadata or subtitles.
Pricing
Download Type | Price |
---|---|
Video/Audio | $0.10 per GB |
Metadata | $0.001 per video |
Subtitles | $0.001 per language |
Example Cost Calculation
If you download a 1080p 30minutes video with metadata and subtitles in two languages:
- Video (1GB) = $0.10
- Metadata = $0.001
- Subtitles = $0.001 *2 = $0.002
- Total = $0.103
Notes
Response Format and Structure
Combined Output Order
When combining multiple output types (e.g., video with metadata and subtitles), the function yields results in the following sequence:
- Metadata dictionary (if requested)
- Media file (video or audio)
- Subtitles dictionary (if requested)
Video Downloads
- MP4: H.264 codec with audio (default)
- Resolution options: 144p to 1080p
- Returns:
sieve.File
with .mp4 extension
- WebM: VP9 codec with audio
- Resolution options: 144p to 1080p
- Returns:
sieve.File
with .webm extension
Audio Downloads
- MP3: Standard audio format (default)
- Returns:
sieve.File
with .mp3 extension
- Returns:
- WAV: Uncompressed audio format
- Returns:
sieve.File
with .wav extension
- Returns:
- M4A: AAC audio format
- Returns:
sieve.File
with .m4a extension
- Returns:
Metadata Downloads
- Returns: Dictionary with requested fields
{ "title": "Video Title", "description": "Video Description", "tags": ["tag1", "tag2", ...], "duration": "HH:MM:SS", "thumbnail": { "default": {"url": "...", "width": 120, "height": 90}, "medium": {"url": "...", "width": 320, "height": 180}, "high": {"url": "...", "width": 480, "height": 360} } }
Subtitle Downloads
- Format: WebVTT (.vtt)
- Returns: Dictionary of
sieve.File
objects{ "en": sieve.File("path/to/subtitles.en.vtt"), "es": sieve.File("path/to/subtitles.es.vtt") }
Combined Downloads: Video, Subtitles, and Metadata
To download a video along with its subtitles and metadata in a single request:
- Set
download_type
to "video" - Enable additional content by setting:
include_subtitles
: Trueinclude_metadata
: True
- Customize your request with:
subtitle_languages
: List of language codes (e.g., ["en", "es"])metadata_fields
: List of desired metadata fields (e.g., ["title", "description"])
The function will return all requested components in a single response.
Supported Metadata Fields
The following metadata fields are supported:
title
: The title of the videodescription
: The full description of the videotags
: List of tags associated with the videoduration
: Video duration in HH:MM:SS formatthumbnail
: Dictionary containing thumbnail URLs and dimensions at different resolutions
Extracting Video Clips
You can extract specific segments from a video or audio by using the time parameters:
start_time
: Beginning of the clip (in seconds)end_time
: End of the clip (in seconds)
This will return a clip from the original video or audio file containing only the content between the specified timestamps.