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.
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?