Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Multiple youtube-dl instances downloading the same video causes malformed output #21449
Comments
|
This is expected behavior. You must not download to the same file simultaneously in the first place. |
Checklist
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.
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?