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.72k stars 9.97k forks source link

[bilibili]Can't support a video containing many pages. #12654

Open cmershen1 opened 7 years ago

cmershen1 commented 7 years ago

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.04.03. 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?


The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


for example,the URL http://www.bilibili.com/video/av9291699 there are 4 videos in it.but if I use the command youtube-dl -F http://www.bilibili.com/video/av9595179

I can only see the information about the first video:

[BiliBili] 9595179: Downloading webpage
[BiliBili] 9595179: Downloading video info page
[info] Available formats for 9595179:
format code  extension  resolution note
0            mp4        unknown
1            mp4        unknown    369.28MiB (best)

Only if I execute youtube-dl -F http://www.bilibili.com/video/av9595179/index_1.html to youtube-dl -F http://www.bilibili.com/video/av9595179/index_4.html can I download all the 4 videos correctly.Can you fix it?or tell me the way to parse how many videoes in an ID.

cqnkxy commented 7 years ago

I think we may need a playlist extractor. If you're interested, the videos are listed inside the div with id=plist, even if the page only contains a single video. You can add this playlist extractor fairly easily by looking at some examples like the one in nba.py. But one problem like I said is that there is no way to differentiate a single video and a playlist then. I need to modify the _real_extract to add a recursion depth limit to avoid infinite recursion call. I don't know if this is desired. So the simple solution would still be to only download the video you're currently visiting.

cqnkxy commented 7 years ago

Here is my example change. I am not gonna make a pull request because I am not sure if this feature is desired. But if you are interested you can pull the code and have a try.

yan12125 commented 7 years ago

@cqnkxy That looks good, just with quite a few coding-style issues. Feel free to open an pull request if you want it supported in mainline youtube-dl.

cqnkxy commented 7 years ago

@yan12125 Thanks! Actually I've had a editor plugin checked the style already, but still... I'll open a pull request and look forward to your comments! Please tell me when it looks good enough and I'll rebase the previous commits into one. Thanks again!