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.
Download and extract to temporary directory, then move final output file #23206
Comments
|
Checklist
Description
My understanding is that youtube-dl will create temporary files (.part files), and video files (e.g. .webm files), in the current working directory - before concluding audio extraction and deleting those files.
Some music applications (e.g. RhythmBox) will listen for new media files in their music directory. This means it will pick up on a .webm file, then immediately report it missing. RhythmBox in particular then does not pick up on the .mp3, I'd guess because of it not being created atomically somehow - I have to restart, and it will then pick it up in a scan.
I suggest a new parameter that specifies that all files should be created in the system temporary directory, and then any files left over at the very end get moved into the current working directory.
This ensures no temporary files will be picked up, and that everything is atomic from the point of view of the final file path.