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

Multiple youtube-dl instances downloading the same video causes malformed output #21449

Closed
sharinq opened this issue Jun 19, 2019 · 1 comment
Closed

Comments

@sharinq
Copy link

@sharinq sharinq commented Jun 19, 2019

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2019.06.08
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

Description

Note: I've only tested this with Windows and NHK Video on Demand videos.

When multiple instances of youtube-dl are downloading the same file at the same time, it can cause output files with repeated parts.

For example, this command downloads a 25,406 KB (26,014,882 bytes) video which is 3:00 long.

youtube-dl https://www3.nhk.or.jp/nhkworld/en/ondemand/video/6022045/

However, if I run it from two command line windows at the same time, it will lead to the error [WinError 32] The process cannot access the file because it is being used by another process, but if I continue resuming (and interrupting) the processes to give them more time to try to download the same video at the same time, the output videos are larger with short pieces of the video repeated. I believe I've experienced this in the past causing the entire video to be downloaded multiple times and joined together, but I haven't replicated it.

The reason for wanting to not have multiple instances of youtube-dl cause malformed output is that I'm using a script to collect video URLs to download and then giving them to youtube-dl, and this is scheduled to run using Windows Task Scheduler. If the last task is still running when it is time for the next task to be run, the script will be run again and youtube-dl might try to download the same video at the same time.

Is there any option that could help with this?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 19, 2019

This is expected behavior. You must not download to the same file simultaneously in the first place.

@dstftw dstftw closed this Jun 19, 2019
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.