Master You-Get: Download Videos, Audio, and More with Python
This article introduces You-Get, a Python‑based command‑line tool for downloading videos, audio, images and subtitles from many sites, explains how to install it, shows its key options, demonstrates format‑specific downloads, playlist handling, proxy usage, and cookie‑based authentication.
Introduction
You-Get is a powerful command‑line tool and Python library for downloading videos from many websites, including YouTube, Bilibili, Facebook, and more.
Installation
Install via pip: pip install you-get Check the installed version:
Basic Usage
1. Basic commands
Common options include:
-V, --version Print version and exit
-h, --help Print help and exit
-i, --info Show extracted information
-u, --url Show extracted URL
--json Output information in JSON format
-n, --no-merge Do not merge video parts
--no-caption Do not download subtitles
-f, --force Overwrite existing files
--skip-existing-file-size-check Skip size check for existing files
-F STREAM_ID, --format STREAM_ID Set video format
-O FILE, --output-filename FILE Set output filename
-o DIR, --output-dir DIR Set output directory
-p PLAYER, --player PLAYER Play video with specified player
-c COOKIES_FILE, --cookies COOKIES_FILE Load cookies
-t SECONDS, --timeout SECONDS Set socket timeout
-d, --debug Show debug information
-I FILE, --input-file FILE Download only the URLs listed in FILE
-P PASSWORD, --password PASSWORD Set video password
-l, --playlist Download entire playlist
-a, --auto-rename Auto‑rename duplicate files
-k, --insecure Ignore SSL errors
-x HOST:PORT, --http-proxy HOST:PORT Use HTTP proxy
-y HOST:PORT, --extractor-proxy HOST:PORT Use proxy for extractor only
--no-proxy Never use a proxy
-s HOST:PORT, --socks-proxy HOST:PORT Use SOCKS proxy2. View video information
Example with a Bilibili video shows title, format, size, resolution, and direct URLs. JSON output can be obtained with you-get --json URL.
3. Download specific format
Download a 720p MP4 video:
you-get -f dash-flv720 https://www.bilibili.com/video/...4. Specify output directory and filename
Use -o DIR and -O FILE to control where the file is saved and its name.
5. Play video directly
Run you-get -p vlc URL to stream the video with a local player.
6. Download VIP videos
VIP videos can be downloaded by providing the URL together with the appropriate cookies.
7. Download subtitles (danmaku)
Subtitles are saved as an XML file alongside the video and can be played with compatible players such as BililLocal.
8. Download images and audio
You‑Get also supports downloading images and audio files by providing their URLs.
9. Batch download playlists
Use --playlist to download all videos in a playlist at once.
10. Proxy download
When IP blocking occurs, use proxy options such as -x host:port or --http-proxy.
You-Get -x host:port URL11. Use cookies for authenticated videos
Save cookies to a text file and pass it to You‑Get:
You-Get cookie.txt URLConclusion
You‑Get is a versatile tool that simplifies downloading videos, audio, images, and subtitles from a wide range of websites.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Python Crawling & Data Mining
Life's short, I code in Python. This channel shares Python web crawling, data mining, analysis, processing, visualization, automated testing, DevOps, big data, AI, cloud computing, machine learning tools, resources, news, technical articles, tutorial videos and learning materials. Join us!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
