windows使用you-get下载笔记!

python第三方库you-get命令行下载工具,可下载图片音视频等。
前提安装python环境和pip3
学习更多请访问:You-Get官网GitHub项目

pip3 install you-get #安装
pip3 install --upgrade you-get #升级

you-get报错,不是内部或外部命令,也不是可运行的程序。无法使用you-get,可能是版本过于老旧

D:\Program\Coding\Python\Scripts>you-get
'you-get' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

pip3 install --upgrade you-get更新后再次执行you-get没问题。

D:\Program\Coding\Python\Scripts>pip3 install --upgrade you-get
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/you-get/
Collecting you-get
  Downloading you_get-0.4.1545-py3-none-any.whl (228 kB)
     |████████████████████████████████| 228 kB 285 kB/s
Installing collected packages: you-get
Successfully installed you-get-0.4.1545
WARNING: You are using pip version 20.2.3; however, version 21.2.4 is available.
You should consider upgrading via the 'd:\program\coding\python\python.exe -m pip install --upgrade pip' command.

看更新提示:d:\program\coding\python\python.exe -m pip install --upgrade pip 又再次执行更新!

G:\>d:\program\coding\python\python.exe -m pip install --upgrade pip
Collecting pip
  Downloading pip-21.2.4-py3-none-any.whl (1.6 MB)
     |████████████████████████████████| 1.6 MB 25 kB/s
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.2.3
    Uninstalling pip-20.2.3:
      Successfully uninstalled pip-20.2.3
  WARNING: The scripts pip.exe, pip3.9.exe and pip3.exe are installed in 'd:\program\coding\python\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-21.2.4

执行下载命令:you-get URL完毕后,目录下:
每天一遍,遁入空门.flv 视频文件
每天一遍,遁入空门.cmt.xml 字幕/弹幕文件

G:\>you-get https://www.bilibili.com/video/BV1pe411W7eY/?spm_id_from=autoNext
site:                Bilibili
title:               每天一遍,遁入空门
stream:
    - format:        flv
      container:     flv
      quality:       高清 1080P
      size:          22.6 MiB (23674289 bytes)
    # download-with: you-get --format=flv [URL]

Downloading 每天一遍,遁入空门.flv ...
 100% ( 22.6/ 22.6MB) ├████████████████████████████████████████┤[1/1]  549 kB/s

Downloading 每天一遍,遁入空门.cmt.xml ...

you-get -i URLyou-get --info URL查看要下载的视频各种清晰度,默认值等。
you-get --format=flv360 URL 选择指定清晰度

G:\>you-get -i https://www.bilibili.com/video/BV12C4y1H7i3/?spm_id_from=333.788.recommend_more_video.8
site:                Bilibili
title:               希 望 家 人 没 事 儿
streams:             # Available quality and codecs
    [ DASH ] ____________________________________
    - format:        dash-flv
      container:     mp4
      quality:       高清 1080P
      size:          24.7 MiB (25879051 bytes)
    # download-with: you-get --format=dash-flv [URL]

    - format:        dash-flv720
      container:     mp4
      quality:       高清 720P
      size:          17.2 MiB (18045279 bytes)
    # download-with: you-get --format=dash-flv720 [URL]

    - format:        dash-flv480
      container:     mp4
      quality:       清晰 480P
      size:          11.4 MiB (11946361 bytes)
    # download-with: you-get --format=dash-flv480 [URL]

    - format:        dash-flv360
      container:     mp4
      quality:       流畅 360P
      size:          10.6 MiB (11128105 bytes)
    # download-with: you-get --format=dash-flv360 [URL]

    [ DEFAULT ] _________________________________
    - format:        flv
      container:     flv
      quality:       高清 1080P
      size:          39.0 MiB (40944933 bytes)
    # download-with: you-get --format=flv [URL]

    - format:        flv720
      container:     flv
      quality:       高清 720P
      size:          26.6 MiB (27893668 bytes)
    # download-with: you-get --format=flv720 [URL]

    - format:        flv480
      container:     flv
      quality:       清晰 480P
      size:          16.9 MiB (17734507 bytes)
    # download-with: you-get --format=flv480 [URL]

    - format:        flv360
      container:     flv
      quality:       流畅 360P
      size:          10.7 MiB (11263136 bytes)
    # download-with: you-get --format=flv360 [URL]

定义下载路径you-get -o [new_path] [url]
windows下按ctl+C 暂停下载,生成.download文件。继续下载重新执行下载命令
强制重新下载you-get -f [url]进度条从0%开始

you-get -f --format=flv360 URL  #重新下载URL
you-get -o G:\linux --format=flv360 URL #下载URL到指定路径

you-get "NAME"根据名称google搜索

G:\>you-get "千千阙歌"
you-get: [error] oops, something went wrong.
you-get: don't panic, c'est la vie. please try the following steps:
you-get:   (1) Rule out any network problem.
you-get:   (2) Make sure you-get is up-to-date.
you-get:   (3) Check if the issue is already known, on
you-get:         https://github.com/soimort/you-get/wiki/Known-Bugs
you-get:         https://github.com/soimort/you-get/issues
you-get:   (4) Run the command with '--debug' option,
you-get:       and report this issue with the full output.

you-get "NAME" --debug打印每一步结果,方便排错。

G:\>you-get "千千阙歌" --debug
[DEBUG] get_content: https://www.google.com/search?tbm=vid&q=%E5%8D%83%E5%8D%83%E9%98%99%E6%AD%8C
...
urllib.error.URLError: <urlopen error [WinError 10060] 
由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。>
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 193,968评论 5 459
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 81,682评论 2 371
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 141,254评论 0 319
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 52,074评论 1 263
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 60,964评论 4 355
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 46,055评论 1 272
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 36,484评论 3 381
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 35,170评论 0 253
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 39,433评论 1 290
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 34,512评论 2 308
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 36,296评论 1 325
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 32,184评论 3 312
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 37,545评论 3 298
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 28,880评论 0 17
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 30,150评论 1 250
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 41,437评论 2 341
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 40,630评论 2 335

推荐阅读更多精彩内容