用Python实现视频\音乐\图片下载自由
IT共享之家
共 3517字,需浏览 8分钟
·
2022-02-09 19:14
回复“资源”即可获赠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
小伙伴们,快快用实践一下吧!如果在学习过程中,有遇到任何问题,欢迎加我好友,我拉你进Python学习交流群共同探讨学习。
------------------- End -------------------
往期精彩文章推荐:
欢迎大家点赞,留言,转发,转载,感谢大家的相伴与支持
想加入Python学习群请在后台回复【入群】
万水千山总是情,点个【在看】行不行
评论