用Python实现视频\音乐\图片下载自由
Python绿色通道
共 3302字,需浏览 7分钟
·
2022-01-21 02:25
↑ 关注 + 星标 ,每天学Python新技能
后台回复【大礼包】送你Python自学大礼包 大家好,我是龙哥!
分享一个Python工具you-get,号称可下载多个平台的视频、音乐、图片。
实战效果
下冰冰图片
you-get https://inews.gtimg.com/newsapp_bt/0/13122504219/1000
下霉霉短视频
you-get https://www.bilibili.com/video/BV1Et411D7LU\?from=search\&seid=14842777690307993679\&spm_id_from=333.337.0.0
下电视剧
you-get https://v.qq.com/x/cover/mzc0020020cyvqh.html
下音乐
you-get https://music.163.com/#/song\?id=1909932703
安装
pip3 install you-get
常用参数
小编感觉,下面添加中文注释的参数即可,
(base) 14:39:50 >you-get
usage: you-get [OPTION]... URL...
A tiny downloader that scrapes the web
optional arguments:
-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 #输出下载文件信息为json格式
Download options:
-n, --no-merge Do not merge video parts
--no-caption Do not download captions (subtitles, lyrics, danmaku, ...)
#不下载视频弹幕、音乐歌词等
-f, --force Force overwriting existing files
--skip-existing-file-size-check
Skip existing file without checking file size
-F STREAM_ID, --format STREAM_ID
Set video format to STREAM_ID #指定视频下载格式、清晰度等
-O FILE, --output-filename FILE
Set output filename #指定下载文件名称,默认原网站文件名称
-o DIR, --output-dir DIR
Set output directory #指定下载文件路径,默人you-get执行目录
-p PLAYER, --player PLAYER
Stream extracted URL to a PLAYER
-c COOKIES_FILE, --cookies COOKIES_FILE
Load cookies.txt or cookies.sqlite
-t SECONDS, --timeout SECONDS
Set socket timeout
-d, --debug Show traceback and other debug info
-I FILE, --input-file FILE
Read non-playlist URLs from FILE
-P PASSWORD, --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
Playlist optional options:
--first FIRST the first number
--last LAST the last number
--size PAGE_SIZE, --page-size PAGE_SIZE
the page size number
Proxy options:
-x HOST:PORT, --http-proxy HOST:PORT
Use an HTTP proxy for downloading
-y HOST:PORT, --extractor-proxy HOST:PORT
Use an HTTP proxy for extracting only
--no-proxy Never use a proxy
-s HOST:PORT or USERNAME:PASSWORD@HOST:PORT, --socks-proxy HOST:PORT or USERNAME:PASSWORD@HOST:PORT
Use an SOCKS5 proxy for downloading
以下载一个沙雕视频为例,
you-get --output-filename=沙雕 --output-dir=/Users/xx/Desktop --format=dash-flv720 --no-caption https://www.bilibili.com/video/BV1qL4y1B7ff/
#--output-filename=沙雕 ,将下载后的视频前缀重命名为沙雕
#--output-dir=/Users/xx/Desktop,将视频存储在/Users/xx/Desktop下
#--format=dash-flv720,下载清晰度为720的视频
#-no-caption,不下载弹幕
支持平台
ref:https://github.com/soimort/you-get
-END-
推荐阅读
评论