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

--extract-audio and skipping video file download #333

Open
orschiro opened this issue Apr 14, 2012 · 4 comments
Open

--extract-audio and skipping video file download #333

orschiro opened this issue Apr 14, 2012 · 4 comments
Labels

Comments

@orschiro
Copy link

@orschiro orschiro commented Apr 14, 2012

Hello,

By default --extract-audio erases the video file. That is, the next time using youtube-dl with --extract-audio again grabs the video file to convert it although it already exists as audio file.

Can you think of a way to implement a check procedure that skips to download the video file if the corresponding audio file already exists without actually keeping the corresponding video file?

Regards

Robert

@cryzed
Copy link
Contributor

@cryzed cryzed commented Apr 15, 2012

This is entirely untested, but you could try changing the lines starting from line 4220 (a0432a1e80 revision) to

new_path = prefix + sep + extension
if os.path.exists(new_path):
    return None

For it to be implemented as an actual feature a decision would need to be made if the default behavior for youtube-dl should be to overwrite existing files or rather skip them and how to optionally tell it to do one thing or the other.

@orschiro
Copy link
Author

@orschiro orschiro commented Apr 16, 2012

Thanks for your suggestion. I changed the code but it still downloads the video.

Steps to reproduce.

.\youtube-dl-extract-audio.py -cit --extract-audio http://www.youtube.com/watch?v=oRhedPZrRqc

First time it downloads the video and uses ffmpeg to create the file A_very_short_video_about_farting-oRhedPZrRqc.aac such as expected.

Again I run .\youtube-dl-extract-audio.py -cit --extract-audio http://www.youtube.com/watch?v=oRhedPZrRqc

which gives me [download] Destination: A_very_short_video_about_farting-oRhedPZrRqc.flv.

@orschiro
Copy link
Author

@orschiro orschiro commented Jun 27, 2012

Any new comments on this?

@maestrojosiah
Copy link

@maestrojosiah maestrojosiah commented Mar 30, 2015

rename the downloaded and converted files to have .m4a extension and youtube-dl will skip them.

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
3 participants
You can’t perform that action at this time.