分類 FAQ 下的文章

此为顽疾。

Download https://www.youtube.com/watch?v=62vXXl6o5_Q fail, info: Unable to download webpage: HTTP Error 429: Too Many Requests (caused by HTTPError())
截图如下:

429.png

这个问题,甚为烦扰。
这是油管网的反扒机制。
too-many.png

翻遍youtube-dl论坛,此问题多而无解。
而此情况下,用浏览器访问油管,大抵会有如下结果:
about.png

通常,等待几个小时再试,可暂时解除此错误。这个时间,几小时不等。
若用SSR,可尝试切换节点,一般可行。

一种说法,来自于youtube-dl主创:
2019-10-22_171213.png

但总感觉,束手无策的感觉。
攻防自古对立。这么多人努力,希望能有比较好的方法,绕过此问题。

B站真是个资源宝库,诸类视频,五花八门,浩如烟海。
有些海外视频,没有普通话音频,听不懂。好在有字幕可用,倒也无碍。在线看罢了,下载,没有字幕,仍然听不懂。
而youtube-dl本身并不支持B站字幕下载。
有用户需要,就研究其实现方法,终于可以下载其字幕。
功能尽在youtube-dl_cr.exe中……
其版本为2019.10.12版。
youtube-dl_cr.png

这里所说的字幕是外挂字幕,即在播放器下端,有CC这个标记。
CC.png

比如这条视频:https://www.bilibili.com/video/av35755631
bilibili.png
一黑人女解说跳绳历史。英文,我是听不太懂。
它有多种字幕:
b_subtitle.png
那么可以根据需要,择而下载。

在[参数设置]之字幕设置中,您可以输入字幕语言。
注意,这里是可以输入的,甚至可以输入多种语言,比如en,fr等,中间以英文逗号,分隔。
option_subtitle.png
设置之后,下载视频,字幕即可被下载,界面上以[CC]做标记:
cc_download.png
QQ图片20191012124743.png

但有时候,不知道字幕语言是哪种,怎么办?
比如:https://www.bilibili.com/video/av50099265
它只有一个字幕:
one-subtitle.png
这时候,参数设置中,可置为Default,下载默认的。但若选择zh-Hans,它不会被下载,因为它的语言是zh-CN。
坑吧!

如何看字幕语言?看网页源代码。其它种类字幕语言,亦用此法。
subtitle-code.png
那么,参数设置之字幕设置中,输入zh-CN,即可下载它。又因为只一个字幕,选择Default亦可下载。
OK,就是这样的

有用户表示:能否不绘制视频缩略图?大抵有些图片,过于辣眼睛。
此需求,很久前做AllMyTube时候用过,那是屏蔽成人网站之缩略图片。
OK,实现它!

改配置文件。
在%appdata%\CRTubeGet\CRTubeGet.ini中,[Download]节点下,加入DrawThumbnail=False配置即可

[Download]
DrawThumbnail=False

之后保存。那么下载任务及已完成任务,不再绘制视频缩略图,而以默认视频图标代之:
downloading.png
complete.png
对,就是这样!

有用户建议自定义输入视频名字,比如给YouTube下载的视频文件名加入上传日期字串,以便于排序。
此需求于2019.09.04实现,有需要请于官网下载v0.9.2.1版本。
因思之过于小众,单独反馈于其,昨见又有用户有问,因此以文章录之。为参数设置界面不至密集,故不置选项与界面。

改配置文件。
在%appdata%\CRTubeGet\CRTubeGet.ini中,[Download]节点下,加入:

[Download]
OutputTemplate=%(upload_date)s-%(title)s-%(id)s

如此,所下载的视频,即以上传日期做为前缀,以视频id为后,格式如下:
output-template.png
需要注意的是,这里视频名字输出模板,不需要设置扩展名。



注,youtube-dl支持的模板格式:
OUTPUT TEMPLATE

The -o option allows users to indicate a template for the output file names.

tl;dr: navigate me to examples.

The basic usage is not to set any template arguments when downloading a single file, like in youtube-dl -o funny_video.flv "https://some/video". However, it may contain special sequences that will be replaced when downloading each video. The special sequences may be formatted according to python string formatting operations. For example, %(NAME)s or %(NAME)05d. To clarify, that is a percent symbol followed by a name in parentheses, followed by formatting operations. Allowed names along with sequence type are:

id (string): Video identifier
title (string): Video title
url (string): Video URL
ext (string): Video filename extension
alt_title (string): A secondary title of the video
display_id (string): An alternative identifier for the video
uploader (string): Full name of the video uploader
license (string): License name the video is licensed under
creator (string): The creator of the video
release_date (string): The date (YYYYMMDD) when the video was released
timestamp (numeric): UNIX timestamp of the moment the video became available
upload_date (string): Video upload date (YYYYMMDD)
uploader_id (string): Nickname or id of the video uploader
channel (string): Full name of the channel the video is uploaded on
channel_id (string): Id of the channel
location (string): Physical location where the video was filmed
duration (numeric): Length of the video in seconds
view_count (numeric): How many users have watched the video on the platform
like_count (numeric): Number of positive ratings of the video
dislike_count (numeric): Number of negative ratings of the video
repost_count (numeric): Number of reposts of the video
average_rating (numeric): Average rating give by users, the scale used depends on the webpage
comment_count (numeric): Number of comments on the video
age_limit (numeric): Age restriction for the video (years)
is_live (boolean): Whether this video is a live stream or a fixed-length video
start_time (numeric): Time in seconds where the reproduction should start, as specified in the URL
end_time (numeric): Time in seconds where the reproduction should end, as specified in the URL
format (string): A human-readable description of the format
format_id (string): Format code specified by --format
format_note (string): Additional info about the format
width (numeric): Width of the video
height (numeric): Height of the video
resolution (string): Textual description of width and height
tbr (numeric): Average bitrate of audio and video in KBit/s
abr (numeric): Average audio bitrate in KBit/s
acodec (string): Name of the audio codec in use
asr (numeric): Audio sampling rate in Hertz
vbr (numeric): Average video bitrate in KBit/s
fps (numeric): Frame rate
vcodec (string): Name of the video codec in use
container (string): Name of the container format
filesize (numeric): The number of bytes, if known in advance
filesize_approx (numeric): An estimate for the number of bytes
protocol (string): The protocol that will be used for the actual download
extractor (string): Name of the extractor
extractor_key (string): Key name of the extractor
epoch (numeric): Unix epoch when creating the file
autonumber (numeric): Five-digit number that will be increased with each download, starting at zero
playlist (string): Name or id of the playlist that contains the video
playlist_index (numeric): Index of the video in the playlist padded with leading zeros according to the total length of the playlist
playlist_id (string): Playlist identifier
playlist_title (string): Playlist title
playlist_uploader (string): Full name of the playlist uploader
playlist_uploader_id (string): Nickname or id of the playlist uploader
Available for the video that belongs to some logical chapter or section:

chapter (string): Name or title of the chapter the video belongs to
chapter_number (numeric): Number of the chapter the video belongs to
chapter_id (string): Id of the chapter the video belongs to
Available for the video that is an episode of some series or programme:

series (string): Title of the series or programme the video episode belongs to
season (string): Title of the season the video episode belongs to
season_number (numeric): Number of the season the video episode belongs to
season_id (string): Id of the season the video episode belongs to
episode (string): Title of the video episode
episode_number (numeric): Number of the video episode within a season
episode_id (string): Id of the video episode
Available for the media that is a track or a part of a music album:

track (string): Title of the track
track_number (numeric): Number of the track within an album or a disc
track_id (string): Id of the track
artist (string): Artist(s) of the track
genre (string): Genre(s) of the track
album (string): Title of the album the track belongs to
album_type (string): Type of the album
album_artist (string): List of all artists appeared on the album
disc_number (numeric): Number of the disc or other physical medium the track belongs to
release_year (numeric): Year (YYYY) when the album was released
Each aforementioned sequence when referenced in an output template will be replaced by the actual value corresponding to the sequence name. Note that some of the sequences are not guaranteed to be present since they depend on the metadata obtained by a particular extractor. Such sequences will be replaced with NA.

For example for -o %(title)s-%(id)s.%(ext)s and an mp4 video with title youtube-dl test video and id BaW_jenozKcj, this will result in a youtube-dl test video-BaW_jenozKcj.mp4 file created in the current directory.

For numeric sequences you can use numeric related formatting, for example, %(view_count)05d will result in a string with view count padded with zeros up to 5 characters, like in 00042.

Output templates can also contain arbitrary hierarchical path, e.g. -o '%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' which will result in downloading each video in a directory corresponding to this path template. Any missing directory will be automatically created for you.

To use percent literals in an output template use %%. To output to stdout use -o -.

The current default template is %(title)s-%(id)s.%(ext)s.

为慢如水滴及下载界面全自绘效率计,CR TubeGet最大并行任务数限定为9个,如图示:
taskcount1.png

但总有些兄弟机子性能及带宽令我们羡慕不已。此情况下,最大任务数显得有些单薄。
如何突破?

界面基于上述原因考虑,不做修改。那么,改配置文件!
定位到%appdata%\CRTubeGet\CRTubeGet.ini文件,打开,在[Download]节点下,修改MaxTaskCount值。
v1.xx版,可以直接在帮助菜单中打开:
data_folder.png
config_file.png
修改最大并行任务数。比如,改为32:

[Download]
MaxTaskCount=32

之后重启程序,那么,最大并行任务数,即可为32个。
之前版本,修改之后打开参数设置,会出现越界错误。此问题在2019.08.24修正,请重获取版本。
参数设置最大任值界面会改变:
taskcount2.png
如此,可矣!

顺便修改:
今后,解析以8k做为默认值。此设置,针对YouTube视频有效