使用you-get命令下载视频/音频/图像

发布于:2025-07-12 ⋅ 阅读:(16) ⋅ 点赞:(0)

1、安装Python

官网:https://www.python.org/
下载地址:https://www.python.org/downloads/
当前版本:Python 3.13.5

2、使用pip安装you-get

pip install you-get

# pip install --upgrade you-get

3、查看用法

~ # you-get 
usage: you-get [OPTION]... URL...

A tiny downloader that scrapes the web

options:
  -V, --version         Print version and exit
  -h, --help            Print this help message and exit

Dry-run options:
  (no actual downloading)

  -i, --info            Print extracted information
  -u, --url             Print extracted information with URLs
  --json                Print extracted URLs in JSON format

Download options:
  -n, --no-merge        Do not merge video parts
  --no-caption          Do not download captions (subtitles, lyrics, danmaku, ...)
  --post, --postfix     Postfix downloaded files with unique identifiers
  --pre, --prefix PREFIX
                        Prefix downloaded files with string
  -f, --force           Force overwriting existing files
  --skip-existing-file-size-check
                        Skip existing file without checking file size
  -F, --format STREAM_ID
                        Set video format to STREAM_ID
  -O, --output-filename FILE
                        Set output filename
  -o, --output-dir DIR  Set output directory
  -p, --player PLAYER   Stream extracted URL to a PLAYER
  -c, --cookies COOKIES_FILE
                        Load cookies.txt or cookies.sqlite
  -t, --timeout SECONDS
                        Set socket timeout
  -d, --debug           Show traceback and other debug info
  -I, --input-file FILE
                        Read non-playlist URLs from FILE
  -P, --password PASSWORD
                        Set video visit password to PASSWORD
  -l, --playlist        Prefer to download a playlist
  -a, --auto-rename     Auto rename same name different files
  -k, --insecure        ignore ssl errors
  -m, --m3u8            download video using an m3u8 url

Playlist optional options:
  --first FIRST         the first number
  --last LAST           the last number
  --size, --page-size PAGE_SIZE
                        the page size number

Proxy options:
  -x, --http-proxy HOST:PORT
                        Use an HTTP proxy for downloading
  -y, --extractor-proxy HOST:PORT
                        Use an HTTP proxy for extracting only
  --no-proxy            Never use a proxy
  -s, --socks-proxy HOST:PORT or USERNAME:PASSWORD@HOST:PORT
                        Use an SOCKS5 proxy for downloading

4、使用

4.1、查看信息

you-get -i 链接

4.2、下载

# 下载
you-get 链接

# 下载:指定输出文件名
you-get -O 输出文件名 链接

# 下载:指定输出目录
you-get -o 输出目录 链接

4.3、使用代理

# 使用代理下载(假设代理地址为127.0.0.1:8087)
you-get -x 127.0.0.1:8087 链接

5、支持下载的网站

详见:https://github.com/soimort/you-get#supported-sites

6、详见

https://you-get.org/
https://github.com/soimort/you-get
https://pypi.org/project/you-get/
https://mp.weixin.qq.com/s/t_0dT3-nsh0lSzv5jozyeQ

网站公告

今日签到

点亮在社区的每一天
去签到