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

delete intermediate files, ok, but not pre-existing files from the directory #8706

Open
oluc opened this issue Mar 1, 2016 · 2 comments
Open

Comments

@oluc
Copy link

@oluc oluc commented Mar 1, 2016

When a file already exists on the destination directory, youtube-dl won't download it again, that's fine.
But, if that file is used as an intermediate file, youtube-dl will delete it, although the file existed before the command was launched. That's surprising. Is it how it is intended ?

$ youtube-dl  https://www.youtube.com/watch?v=foo
[download] Destination: foo.mp4

$ youtube-dl -f bestaudio --extract-audio https://www.youtube.com/watch?v=foo
[download] foo.mp4 has already been downloaded
[ffmpeg] Destination: foo.m4a
Deleting original file foo.mp4 (pass -k to keep)

It's clear that -k would have keep it, although we don't know in advance if youtube-dl will reuse an existing file from the directory, or download an intermediate one.

I tend to think that if it reuses a file from the disk, by default it should not delete it.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Mar 1, 2016

Post the full output of youtube-dl when run with -v, i.e. add -v flag to your command line, copy the whole output and post it in the issue body wrapped in ``` for better formatting. It should look similar to this:

$ youtube-dl -v <your command line>
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj']
[debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251
[debug] youtube-dl version 2015.12.06
[debug] Git HEAD: 135392e
[debug] Python version 2.6.6 - Windows-2003Server-5.2.3790-SP2
[debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4
[debug] Proxy map: {}
...

Do not post screenshots of verbose log only plain text is acceptable.

The output (including the first lines) contains important debugging information. Issues without the full output are often not reproducible and therefore do not get solved in short order, if ever.

@dstftw dstftw closed this Mar 1, 2016
@oluc
Copy link
Author

@oluc oluc commented Mar 2, 2016

do this for example:

$ youtube-dl -v http://www.youtube.com/watch?v=BaW_jenozKcj -f bestaudio   
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj', u'-f', u'bestaudio']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.02.22
[debug] Python version 2.7.10 - Linux-4.2.0-040200rc5-generic-i686-with-Ubuntu-15.10-wily
[debug] exe versions: avconv 2.7.6-0ubuntu0.15.10.1, avprobe 2.7.6-0ubuntu0.15.10.1, ffmpeg 2.7.6-0ubuntu0.15.10.1, ffprobe 2.7.6-0ubuntu0.15.10.1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] BaW_jenozKc: Downloading webpage
[youtube] BaW_jenozKc: Downloading video info webpage
[youtube] BaW_jenozKc: Extracting video information
[youtube] BaW_jenozKc: Downloading MPD manifest
[debug] Invoking downloader on u'https://r7---sn-n4g-cvqe.googlevideo.com/videoplayback?id=05a5bf8de9e8cca7&itag=141&source=youtube&requiressl=yes&ms=au&mv=m&pl=23&mn=sn-n4g-cvqe&mm=31&ratebypass=yes&mime=audio/mp4&gir=yes&clen=315992&lmt=1387961817988214&dur=9.891&mt=1456914016&key=dg_yt0&fexp=9416126,9420452,9422596,9423459,9423661,9423662&sver=3&signature=42A8A499335F729C2D313372C53E6ACBF9B0EC90.70493B7D3F35C2F3816963E3089D5EC078DD386C&upn=TyRSrHC1HDw&ip=93.23.75.57&ipbits=0&expire=1456935752&sparams=ip,ipbits,expire,id,itag,source,requiressl,ms,mv,pl,mn,mm,ratebypass,mime,gir,clen,lmt,dur'
[download] Destination: youtube-dl test video ''_ä↭𝕐-BaW_jenozKc.m4a
[download] 100% of 308.59KiB in 00:00
[ffmpeg] Correcting container in "youtube-dl test video ''_ä↭𝕐-BaW_jenozKc.m4a"
[debug] ffmpeg command line: avconv -y -i 'file:youtube-dl test video '"'"''"'"'_ä↭𝕐-BaW_jenozKc.m4a' -c copy -f mp4 'file:youtube-dl test video '"'"''"'"'_ä↭𝕐-BaW_jenozKc.temp.m4a'

$ ls
youtube-dl test video ''_ä↭𝕐-BaW_jenozKc.m4a


$ youtube-dl -v http://www.youtube.com/watch?v=BaW_jenozKcj -f bestaudio  --extract-audio --audio-format mp3 
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj', u'-f', u'bestaudio', u'--extract-audio', u'--audio-format', u'mp3']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.02.22
[debug] Python version 2.7.10 - Linux-4.2.0-040200rc5-generic-i686-with-Ubuntu-15.10-wily
[debug] exe versions: avconv 2.7.6-0ubuntu0.15.10.1, avprobe 2.7.6-0ubuntu0.15.10.1, ffmpeg 2.7.6-0ubuntu0.15.10.1, ffprobe 2.7.6-0ubuntu0.15.10.1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] BaW_jenozKc: Downloading webpage
[youtube] BaW_jenozKc: Downloading video info webpage
[youtube] BaW_jenozKc: Extracting video information
[youtube] BaW_jenozKc: Downloading MPD manifest
[debug] Invoking downloader on u'https://r7---sn-n4g-cvqe.googlevideo.com/videoplayback?id=05a5bf8de9e8cca7&itag=141&source=youtube&requiressl=yes&mn=sn-n4g-cvqe&mm=31&pl=23&mv=m&ms=au&ratebypass=yes&mime=audio/mp4&gir=yes&clen=315992&lmt=1387961817988214&dur=9.891&mt=1456914016&key=dg_yt0&signature=2A5F1920DA807258032C3754B182A7544D838DE6.382A02C5FA8DDA7DF003F629F71B24FEB606B509&sver=3&fexp=9406001,9406819,9413142,9414672,9416126,9417249,9418580,9420452,9422342,9422596,9423661,9423662,9423849,9426409,9426601,9427755,9428077,9428289,9428421,9429595,9430845&upn=nA3qNGmqbGg&ip=93.23.75.57&ipbits=0&expire=1456935766&sparams=ip,ipbits,expire,id,itag,source,requiressl,mn,mm,pl,mv,ms,ratebypass,mime,gir,clen,lmt,dur'
[download] youtube-dl test video ''_ä↭𝕐-BaW_jenozKc.m4a has already been downloaded
[download] 100% of 308.59KiB
[ffmpeg] Correcting container in "youtube-dl test video ''_ä↭𝕐-BaW_jenozKc.m4a"
[debug] ffmpeg command line: avconv -y -i 'file:youtube-dl test video '"'"''"'"'_ä↭𝕐-BaW_jenozKc.m4a' -c copy -f mp4 'file:youtube-dl test video '"'"''"'"'_ä↭𝕐-BaW_jenozKc.temp.m4a'
[debug] avconv command line: avprobe -show_streams 'file:youtube-dl test video '"'"''"'"'_ä↭𝕐-BaW_jenozKc.m4a'
[ffmpeg] Destination: youtube-dl test video ''_ä↭𝕐-BaW_jenozKc.mp3
[debug] ffmpeg command line: avconv -y -i 'file:youtube-dl test video '"'"''"'"'_ä↭𝕐-BaW_jenozKc.m4a' -vn -acodec libmp3lame -q:a 5 'file:youtube-dl test video '"'"''"'"'_ä↭𝕐-BaW_jenozKc.mp3'
Deleting original file youtube-dl test video ''_ä↭𝕐-BaW_jenozKc.m4a (pass -k to keep)


$ ls
youtube-dl test video ''_ä↭𝕐-BaW_jenozKc.mp3

Expected:

$ ls
youtube-dl test video ''_ä↭𝕐-BaW_jenozKc.m4a
youtube-dl test video ''_ä↭𝕐-BaW_jenozKc.mp3

That is:

  • the files existing before the command was launched, should not be deleted by the command.
  • only intermediate files downloaded by the command itself should be deleted (unless -k to keep)
@dstftw dstftw reopened this Mar 3, 2016
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.