Open lin-calvin opened 2 years ago
There are 26 open issues for Bilibili. Even if a few are junk or incorrect matches, the extractor should be unified with the yt-dlp version with the aim of clearing up these issues.
There are 26 open issues for Bilibili. Even if a few are junk or incorrect matches, the extractor should be unified with the yt-dlp version with the aim of clearing up these issues.
Hi, I'm trying to fix bilibili in yt-dlp, https://github.com/lockmatrix/yt-dlp/commits/fix_bilibili2022
maybe it can help you.
but I'm not familiar with the framework, for example: I dont know how to download a mulit-part video and merge them in yt-dlp.
related yt-dlp issues: https://github.com/yt-dlp/yt-dlp/issues/1878 https://github.com/yt-dlp/yt-dlp/issues/3659
add this code snippet to bilibli.py after line 140
# fixed multi-part video
if '?p=' in url:
cid = self._search_regex(
r'https.*(\d{9,}).*m4s', webpage, 'cid',
default=None)
Please show how that affects extraction, eg with -v -F test_url
before and after.
Are both the .
meant to be wildcard matches, or is the 2nd meant to match just .
(ie should be \.
)?
add this code snippet to bilibli.py after line 140
# fixed multi-part video if '?p=' in url: cid = self._search_regex( r'https.*(\d{9,}).*m4s', webpage, 'cid', default=None)
Thanks.That works fine.
To use multi-page info in output template. I added following code in line139(based on 17d295a1ec6d04362740dd8a0c583690f5ba082a)
if '?p=' in url:
cid = self._search_regex(
r'https.*(\d{9,}).*m4s', webpage, 'cid',
default=None)
sub_title = self._search_regex(
r'"cid":1{0,1}%s.*?"part":"(.*?[^\\])"' % cid, webpage, 'sub_title',
default=None)
sub_index = self._search_regex(
r'"cid":1{0,1}%s.*?"page":(\d+)' % cid, webpage, 'sub_index',
default=None)
and add following in line 129
sub_title=None
sub_index=None
and add following in line 224
'sub_title': sub_title,
'sub_index': sub_index,
WIP yt-dl extractor:
$ python -m youtube_dl -vF 'https://www.bilibili.com/video/BV1Jh411d7kd?p=2&vd_source=98f63ab9b6403852e34607326fdf6819'
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-vF', u'https://www.bilibili.com/video/BV1Jh411d7kd?p=2&vd_source=98f63ab9b6403852e34607326fdf6819']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Git HEAD: 4416f82c8
[debug] Python 2.7.15 (CPython i686 32bit) - Linux-6.1.0-18-686-pae-i686-with-debian-12.5 - OpenSSL 1.1.1a 20 Nov 2018 - glibc 2.1.3
[debug] exe versions: ffmpeg 5.1.4-0, ffprobe 5.1.4-0
[debug] Proxy map: {}
[BiliBili] 1Jh411d7kd: Downloading webpage
[BiliBili] BV1Jh411d7kd: Extracting videos in anthology
[BiliBili] 201680039: Extracting chapters
[BiliBili] Format(s) 1080P 高清, 720P 高清 are missing: you have to login or become premium member to download them. Use --cookies to authenticate.
[info] Available formats for BV1Jh411d7kd_p2:
format code extension resolution note
30216 m4a audio only 67k , mp4a.40.2
30232 m4a audio only 129k , mp4a.40.2
30280 m4a audio only 129k , mp4a.40.2
100022 mp4 640x360 76k , av01.0.01m.08.0.110.01.01.01.0, 30.019fps, video only
30011 mp4 640x360 92k , hev1.1.6.l120.90, 30.303fps, video only
30016 mp4 640x360 157k , avc1.64001e, 29.412fps, video only
100023 mp4 852x480 89k , av01.0.04m.08.0.110.01.01.01.0, 30.019fps, video only
30033 mp4 852x480 126k , hev1.1.6.l120.90, 30.303fps, video only
30032 mp4 852x480 157k , avc1.64001f, 29.412fps, video only (best)
Checklist
Verbose log
Description
I want to download a mulit-part video at bilibili but is can only download the frist video