2019 年 8 月

CR TubeGet对B站下载包括列表下载,已然支持,但有个问题始终困扰,终于解决。
这个问题就是分片视频的问题。实现版本:v0.9.2.0,2019.08.31版。

比如此视频:https://www.bilibili.com/video/av10523929
以youtube-dl下之,其显示如下:請輸入圖片描述
CR TubeGet版本,之前是改配置,在CRTubeGet.ini之[Download]节中,加入如下字段:

[Download]
ParseBiliBiliPlaylist=True

之后启动程序,它将以列表解析为:
請輸入圖片描述
而亦下载为列表:
請輸入圖片描述

虽如此,不仅繁琐,而且下载为多个文件片,且未能指定格式,蛋疼。
而在列表中有此分片视频,又束手无策,困扰于心久矣!终于思索,做视频分片下载、片段合并处理,完美解决此类问题。
注:所下视频最高分辨率,为未注册用户所能看的最高分辨率为准。



新版实现为下载所有片段,计算修正下载进度及显示时间,完成后以ffmpeg做批量合并。
仍以https://www.bilibili.com/video/av10523929为例下载
bilibili.png
进度显示为一个。实际上,它仍然是下载各个视频片段:
bilibili_part.png
在全部片段下载完成之后,CR TubeGet调用ffmpeg做合并工作:
merging.png
最后,得到一个完整文件:(参数设置中,格式已置为输出Mp4)
downloaded.png
media_info.png
至此时,分片视频完好下载。同理,亦支持可以合并的其它格式,比如mkv、avi、flv等。webm不行

在列表中的分片视频,也是这样处理。
比如这个URL,吉它教程:https://www.bilibili.com/video/av13576025/?p=5
它里面多个视频,都是分片视频。下载之后,合并为正常的单视频文件:
video_list.png
是不是您所需要的呢?
而且,程序中不需要再作特别设置了~



BUG在所不免。使用过程中任何问题,欢迎跟贴或反馈中做反馈。

有用户建议自定义输入视频名字,比如给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值。
比如:

[Download]
MaxTaskCount=32

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

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

其实,youtube-dl官方代码已有对mgtv的下载支持。
只是因为编译原因,或许是python版本不对,而导致其官方exe在下载芒果TV时,出现如下错误:

unsupported operand type(s) for %: 'bytes' and 'tuple'

获取代码,以python2重新编译,生成youtube-dl_cr.exe,可以正常下载。
所以,若需下载芒果TV,只需下载youtube-dl_cr.exe,丢入程序目录中即可。
注:CR TubeGet需要v0.9.1.9及以上版本支持。



以如下url为例,验证下载:
https://www.mgtv.com/b/330173/5830313.html
ycty.png

复制此url入CR TubeGet,得其下载为:
ycty_download.png
ycty_downloaded.png

youtube-dl对iqiyi本来是支持的,但其官方更新对中国网站之支持,相当滞后。
就像对bilibili列表支持一样,反馈也没有结果,不得已而修改之。
对iqiyi也是一样。参考you-get项目,本欲自写,发现改youtube-dl更省事一些,改!

骑士录第三季 在一万三千亩的草场上,骑士们驯野马,谁弱爆?为例:
youtube-dl官方版,下载爱奇艺,因取tvid、vid正则错误,而导致解析失败,表现为:

ERROR: Can't find any video;

如图示:
iqiyi_fail.png

实现上修改其正则匹配即可。并完善其缩略图、视频时长信息。
终于也等不及,自编译youtube-dl_cr.exe,同时修正bilibili引用,与其共用一个exe组件。
1、下载crtubeget.rar,解压
2、下载youtube-dl_cr.exe,丢入crtubeget目录中,即可实现iqiyi视频下载
它的文件描述是:YouTube video downloader for CR TubeGet
bilibili.png

v0.9.1.9修正:
iqiyi下载失败,提示下载youtube-dl_cr组件,组件下载完成,自动重试,省得手动下载:
iqiyi_fail.png
依提示操作,下载youtube-dl_cr组件,之后自动重试,视频则可成功下载。


之后再下载爱奇艺视频,即可正常下载:
iqiyi_download.png
最终下载为mp4:
iqiyi_complete.png



然而,有一些仍然搞不定,比如:

https://www.iqiyi.com/v_19rqsge0no.html

它返回状态错误,资源拿不到。
iqiyi_fail2.png
此问题,于v0.9.2.5版中,因支持annie而解决,请参阅:
http://www.cr-soft.net/archives/how-to-use-annie.html
erqs.png

还有一些vip资源,只能下载前6分钟,而目前,亦不支持其会员功能,vip视频不做处理。