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.28k stars 9.94k forks source link

Multi-part videos from Bilibili? #20420

Open ahoko opened 5 years ago

ahoko commented 5 years ago

Please follow the guide below


Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2019.03.18. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

Before submitting an issue make sure you have:

What is the purpose of your issue?



If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add the -v flag to your command line you run youtube-dl with (youtube-dl -v <your command line>), copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.bilibili.com/video/av40918356/?p=2']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2019.03.18
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.17134
[debug] exe versions: ffmpeg 3.2, ffprobe 3.2
[debug] Proxy map: {}
[BiliBili] 40918356: Downloading webpage
[BiliBili] 40918356: Downloading video info page
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'http://upos-hz-mirrorwcsu.acgvideo.com/upgcxcode/35/23/71872335/71872335-1-80.flv?e=ig8euxZM2rNcNbRVhWNBhwdlhWd1hbUVhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEVEuxTEto8i8o859r1qXg8xNEVE5XREto8GuFGv2U7SuxI72X6fTr859r1qXg8gNEVE5XREto8z5JZC2X2gkX5L5F1eTX1jkXlsTXHeux_f2o859IB_&deadline=1553058111&gen=playurl&nbs=1&oi=2928336272&os=wcsu&platform=pc&trid=f450572bc0ff4ebdb89ed2116cea33ff&uipk=5&upsig=0265ee3c249101c78d0f479e52302230'
[download] 【Live】B-Project Summer live2018  Eternal Pacific-40918356.flv has already been downloaded
[download] 100% of 1.42GiB


Description of your issue, suggested solution and other information

I am wondering if it is possible to have support for videos from Bilibili that are in multiple parts. One example is this: https://www.bilibili.com/video/av40918356/?p=2 When I enter this into youtube-dl, it only downloads the first part of the video, ignoring the /?p=2 on the end (part 1 has /?p=1 and part 3 has /?p=3 etc.). I've seen some people talk about potential solutions around this website (like here: #12654), however I have no idea how to implement them myself. Thanks so much if anyone can help explain this to me, I'm still a novice with things like this.

rivke41levp656 commented 5 years ago

There are multiple partial solutions for this, none of which have been merged with the main branch. I currently use #18827 with 2 lines changed (appkey broke about 1 month ago, my bilibili.py is here: https://pastebin.com/6AQ6BV4s). It downloads paged videos, but not as one would hope. It does not treat it as a playlist, so you must create a list of URLs. This is not such a big deal, if it weren't for the fact that it sometimes ignores the page title ("part2" in your example), making filename not unique resulting in attempts to download same file repeatedly. In these cases it requires babysitting, moving the files elsewhere or renaming before beginning another URL. I can't see under what conditions it will use the page title as part of the filename.

Anyway, you need to modify bilibili.py, as the main branch's has no logic for paged videos. So you can just replace your bilibili.py with one of the ones found on pull request (this one has just been posted a few days ago: #20393 , maybe it is better than what I use). Once you've done that just rebuild youtube-dl, or just build fresh from the commit which contains the desired bilibili.py.

someziggyman commented 4 years ago

Maybe, this solution can be implemented in Bilibili.py https://github.com/iawia002/annie#download-playlist seems to be working just fine.

20NE commented 4 years ago

same issue

ghost commented 4 years ago

Exactly the same issue