【python】You-Get
文章目录
- 1、介绍
- 2、安装与使用文档
- 3、下载图片
- 4、下载视频
- 5、下载音乐
- 6、参考
1、介绍
You-Get is a tiny command-line utility to download media contents (videos, audios, images) from the Web, in case there is no other handy way to do it.
源码:https://github.com/soimort/you-get
用户庞大呀
2、安装与使用文档
pip 直接安装
pip install you-get
使用文档,可以 you-get -h
获取
you-get: version 0.4.1743, a tiny downloader that scrapes the web.
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
Prefix downloaded files with string
-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
-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
-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 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
支持的平台如下
3、下载图片
选择图片,复制图像链接
终端命令输入 you-get 图片链接
下载完成
4、下载视频
复制链接,you-get 视频链接
视频、声音、弹幕都下载了
可以通过 -i
查看可以下载素材的格式与分辨率
you-get -i https://www.bilibili.com/video/BV1GJ411M7TF/?spm_id_from=333.999.0.0
output
you-get: You will need login cookies for 720p formats or above. (use --cookies to load cookies.txt.)
site: Bilibili
title: 冯老板-KOD 10 裁判表演
streams: # Available quality and codecs
[ DASH ] ____________________________________
- format: dash-flv480-AVC
container: mp4
quality: 清晰 480P avc1.64001F
size: 9.5 MiB (9936285 bytes)
# download-with: you-get --format=dash-flv480-AVC [URL]
- format: dash-flv480-HEVC
container: mp4
quality: 清晰 480P hev1.1.6.L120.90
size: 7.0 MiB (7385543 bytes)
# download-with: you-get --format=dash-flv480-HEVC [URL]
- format: dash-flv360-AVC
container: mp4
quality: 流畅 360P avc1.64001E
size: 4.3 MiB (4525456 bytes)
# download-with: you-get --format=dash-flv360-AVC [URL]
- format: dash-flv360-HEVC
container: mp4
quality: 流畅 360P hev1.1.6.L120.90
size: 3.3 MiB (3411044 bytes)
# download-with: you-get --format=dash-flv360-HEVC [URL]
5、下载音乐
复制链接,you-get 链接
下载
有音乐和歌词
[00:00.00] 编曲 : 陈恒冠
[00:00.50] 制作人 : 陈恒冠/陈恒家
[00:01.01] 作词 : 陈恒冠
[00:01.52] 作曲 : 陈恒冠
[00:02.03]监制:1991与她
[00:03.25]直到今天我都不知道
[00:09.13]你究竟以什么谋生
[00:15.02]不过这也不是太重要
[00:20.21]从不关心阳光草也长得很好
[00:26.87]喝茶和赏雨已经不再让我安详
[00:32.35]偶然又一起跨上摩托冲到边境
[00:38.38]排气狂暴轰鸣中跨过半省
[00:44.32]大山湿雾弥漫里吐出烟气
[00:50.40]克林 上路是偶然
[00:56.09]如鲸向海 请取笑那些苦难吧
[01:02.32]克林 人生是偶然
[01:07.95]依旧浪漫 尽管你知道后来啊
[01:14.29]克林 上路是偶然
[01:20.01]离开那些 曾吞没你的欲望吧
[01:26.18]克林 人生是偶然
[01:31.81]在自己的路上 义无反顾的狂奔吧
[02:08.25]喝茶和赏雨已经不再让我安详
[02:14.08]偶然又一起跨上摩托冲到边境
[02:19.97]排气狂暴轰鸣中跨过半省
[02:25.91]大山湿雾弥漫里吐出烟气
[02:31.96]克林 上路是偶然
[02:37.55]如鲸向海 请取笑那些苦难吧
[02:43.92]克林 人生是偶然
[02:49.47]依旧浪漫 尽管你知道后来啊
[02:55.80]克林 上路是偶然
[03:02.28]离开那些 曾吞没你的欲望吧
[03:08.59]克林 人生是偶然
[03:14.02]在自己的路上 义无反顾的狂奔吧
[03:44.45]克林 上路是偶然
[03:50.01]如鲸向海 请取笑那些苦难吧
[03:56.34]克林 人生是偶然
[04:01.96]依旧浪漫 尽管你知道后来啊
[04:08.29]克林 上路是偶然
[04:13.93]离开那些 曾吞没你的欲望吧
[04:20.22]克林 人生是偶然
[04:25.79]在自己的路上 义无反顾的狂奔吧!
[04:39.91](克林)
[04:42.90](克林……慢点儿!)
[04:47.92]编曲:陈恒冠/陈恒家
[04:50.90]吉他:陈恒家/龚培超
[04:52.90]录音:陈恒家@1019Studio
[04:54.90]混音:陈恒家
[04:58.90]摩托:克林&(春风650MT)
6、参考
- 用Python实现视频\音乐\图片下载自由