ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.73k stars 9.97k forks source link

[bilibili] bangumi links have changed. #22012

Open thanksshu opened 5 years ago

thanksshu commented 5 years ago

Checklist

Verbose log

 .\youtube-dl.exe -v https://www.bilibili.com/bangumi/play/ss5802#100643
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.bilibili.com/bangumi/play/ss5802#100643']
[debug] Encodings: locale cp936, fs mbcs, out cp936, pref cp936
[debug] youtube-dl version 2019.08.02
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.18362
[debug] exe versions: none
[debug] Proxy map: {}
[generic] ss5802#100643: Requesting header
WARNING: Falling back on generic information extractor.
[generic] ss5802#100643: Downloading webpage
[generic] ss5802#100643: Extracting information
ERROR: Unsupported URL: https://www.bilibili.com/bangumi/play/ss5802#100643
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpjwvl_v2x\build\youtube_dl\YoutubeDL.py", line 796, in extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpjwvl_v2x\build\youtube_dl\extractor\common.py", line 530, in extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpjwvl_v2x\build\youtube_dl\extractor\generic.py", line 3333, in _real_extract
youtube_dl.utils.UnsupportedError: Unsupported URL: https://www.bilibili.com/bangumi/play/ss5802#100643

Description

Now BiliBili redirects the link http://bangumi.bilibili.com/anime/1869/play#40062 (which is a test in the bilibili extractor) to https://www.bilibili.com/bangumi/play/ss1869#40062. A new solution is needed ?

1349422030 commented 4 years ago

there month passed...

Atlasoin commented 4 years ago

Any updates?

ywwzwb commented 4 years ago

I make a pr #25308 now add support for url like https://www.bilibili.com/bangumi/media/md3814 and https://www.bilibili.com/bangumi/play/ep86635

tinytangent commented 4 years ago

https://www.bilibili.com/bangumi/play/ep and https://www.bilibili.com/bangumi/play/ss are different kinds of address, and new anime seems to have all migrated to https://www.bilibili.com/bangumi/play/ss.

Not really familiar with reverse engineering those web video protocols but seems https://www.bilibili.com/bangumi/play/ss use a different protocol from https://www.bilibili.com/bangumi/play/ep. Because after reading the code of #25308 I noticed that it uses https://api.bilibili.com/pgc/view/web/season?ep_id= to extract video info, but the ep_id is not the number after ss for addresses starting with https://www.bilibili.com/bangumi/play/ss.

Any ideas? @ywwzwb @AtlasChuen @thanksshu

I also wonder why #25308 is still not merged...neither does #24322

tinytangent commented 4 years ago

No...seems the protocol is not different, just the URL...After reading the API result I noticed something interesting. ss addresses might have a corresponsding ep address, for example: https://www.bilibili.com/bangumi/play/ss3814 https://www.bilibili.com/bangumi/play/ep86635

It might be just the different API interface.

https://api.bilibili.com/pgc/view/web/season?season_id=3814 https://api.bilibili.com/pgc/view/web/season?ep_id=86635

aboutqx commented 4 years ago

Could anyone merge some of these PRs?