Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downloading feature for Bilibili is not working properly in terms of sequential videos #9660

Closed
starkshaw opened this issue Jun 1, 2016 · 6 comments

Comments

@starkshaw
Copy link

@starkshaw starkshaw commented Jun 1, 2016

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

  • I've verified and I assure that I'm running youtube-dl 2016.06.02

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to 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 -v flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

$ youtube-dl -v http://www.bilibili.com/video/av4808130/
[debug] System config: []
[debug] User config: [u'-f', u'bestvideo+bestaudio/best']
[debug] Command-line args: [u'-v', u'http://www.bilibili.com/video/av4808130/']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.06.02
[debug] Python version 2.7.10 - Darwin-15.5.0-x86_64-i386-64bit
[debug] exe versions: avconv 11.4, avprobe 11.4, ffmpeg 3.0.2, ffprobe 3.0.2
[debug] Proxy map: {}
[BiliBili] 4808130: Downloading webpage
[BiliBili] 7802182: Downloading video info page
[download] Downloading playlist: 【长篇】哆啦A梦443【钉铛】
[BiliBili] playlist 【长篇】哆啦A梦443【钉铛】: Collected 4 video ids (downloading 4 of them)
[download] Downloading video 1 of 4
[debug] Invoking downloader on u'http://ws.acgvideo.com/b/35/7802182-1.flv?wsTime=1464819935&wsSecret2=46d27ce17d9c45ed34c501f1f9bd20e3&oi=1445658136&appkey=86385cdc024c0f6c&or=1167325994'
[download] Destination: 【长篇】哆啦A梦443【钉铛】-7802182.flv
[download] 100% of 46.71MiB in 00:37
[download] Downloading video 2 of 4
[debug] Invoking downloader on u'http://ws.acgvideo.com/b/35/7802182-2.flv?wsTime=1464819935&wsSecret2=a5caf416c7f8c9267f7e5a94068afdfe&oi=1445658136&appkey=86385cdc024c0f6c&or=1167325994'
[download] 【长篇】哆啦A梦443【钉铛】-7802182.flv has already been downloaded
[download] 100% of 46.71MiB
[download] Downloading video 3 of 4
[debug] Invoking downloader on u'http://ws.acgvideo.com/b/35/7802182-3.flv?wsTime=1464819935&wsSecret2=6adbdee4f951614edc56800a8ca1566e&oi=1445658136&appkey=86385cdc024c0f6c&or=1167325994'
[download] 【长篇】哆啦A梦443【钉铛】-7802182.flv has already been downloaded
[download] 100% of 46.71MiB
[download] Downloading video 4 of 4
[debug] Invoking downloader on u'http://ws.acgvideo.com/b/35/7802182-4.flv?wsTime=1464819935&wsSecret2=f1ea44300218d2ae35bc0bbe2ff6e4ae&oi=1445658136&appkey=86385cdc024c0f6c&or=1167325994'
[download] 【长篇】哆啦A梦443【钉铛】-7802182.flv has already been downloaded
[download] 100% of 46.71MiB
[download] Finished downloading playlist: 【长篇】哆啦A梦443【钉铛】
<end of log>

Description of your issue, suggested solution and other information

The URL of that video has multiple pieces, which is common in Bilibili, the early versions of youtube-dl downloaded these pieces and merge automatically, while the recent versions download these pieces without merge, but after the fix on last version, the file names are not carrying part_x suffix thus after first piece been successfully downloaded, the following ones cannot be downloaded since this naming issue.
Suggest that add the part_x back or even better, add auto merge back since I need to write a bash to use ffmpeg anyway.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jun 2, 2016

AFAIK auto merging in youtube-dl is never implemented. Which version are you using and how did you enable it?

@yan12125 yan12125 closed this in ad73083 Jun 2, 2016
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jun 2, 2016

_partX suffixes will be added back in the next version. Sorry for my previous mistake.

@starkshaw
Copy link
Author

@starkshaw starkshaw commented Jun 2, 2016

@yan12125 I don't know the auto merging you've mentioned. But Bilibili download feature did merge all clips together. Probably version in last year, and I reported this when I found out:
#8314

Like if I download best quality for YouTube it'll merge audio and video into a single mkv file rather than audio track and video track alone. For Bilibili it also should merge clips into a single file.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jun 2, 2016

From the description at #8314, I guess in BiliBili, videos were originally served as single files, and some day they decided to convert them to multi-part files. Handling multi-part videos correctly is much harder than merging video- and audio-only files, like the case in YouTube. There are lots of pull requests aim to implement it (#2844, #2723, #995, etc.), but none of them is good enough to get merged.

@starkshaw
Copy link
Author

@starkshaw starkshaw commented Jun 2, 2016

@yan12125 Hi, actually it was split into several files as well, if my memory is correct, it downloaded several files and merge at the end.
Since the old version has _partX suffixes, I have a bash for that, and if you can implement it into your code make it auto-merge, that'll be some great contribution to me and probably someone else. 😄

Here's what I have before:

printf "ffconcat version 1.0\n" > videolist.txt
for i in {1..4}
do
    printf "file '%s'\n" "【长篇】哆啦A梦442【梦蓝】-7668669_part$i.flv" >> videolist.txt
done
ffmpeg -f concat -safe 0 -i videolist.txt -c copy "【长篇】哆啦A梦442【梦蓝】-7668669.flv"
rm videolist.txt

Using ffmpeg concat feature.
So far, I used it for Bilibili, and for this gist https://gist.github.com/starkshaw/ec3cba780100bbb4050d 😏 before. But the code above is for newer ffmpeg version.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jun 2, 2016

Dunno. Maybe you were using a fork but not rg3's version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.