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

Extracting audio to files with different names #8493

Closed
civilwargeeky opened this issue Feb 10, 2016 · 2 comments
Closed

Extracting audio to files with different names #8493

civilwargeeky opened this issue Feb 10, 2016 · 2 comments

Comments

@civilwargeeky
Copy link

@civilwargeeky civilwargeeky commented Feb 10, 2016

Hello! So I am using youtube-dl in a larger application. This application keeps track of song names, and calls youtube-dl using subprocess.call likesubprocess.call("youtube-dl.exe "+options,shell=True) in a thread that I made. This works fine, the first time. If I change the file name of an output song, ffmpeg crashes and fails to process the song.

Here is my program output (run 1, file name: Testing1)

Q:\Coding\Projects\Python\MusicDownloader>python MusicUpdater.py
What file to use for input? sampleinput.txt
youtube-dl is up-to-date (2016.02.09.1)
Command:  youtube-dl.exe -o "Output/Playlist Names/Testing1.%(ext)s" -v -x --aud
io-format mp3 --audio-quality 0 https://www.youtube.com/watch?v=yp3UeCguVVI
Time Elapsed: 0:00
Playlist Names:   0 /   1  0%
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-o', u'Output/Playlist Names/Testing1.%(ext)s', u'
-v', u'-x', u'--audio-format', u'mp3', u'--audio-quality', u'0', u'https://www.y
outube.com/watch?v=yp3UeCguVVI']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2016.02.09.1
[debug] Python version 2.7.10 - Windows-8-6.2.9200
[debug] exe versions: ffmpeg N-66116-g720c21d, ffprobe N-66116-g720c21d
[debug] Proxy map: {}
[youtube] yp3UeCguVVI: Downloading webpage
[youtube] yp3UeCguVVI: Downloading video info webpage
[youtube] yp3UeCguVVI: Extracting video information
[youtube] yp3UeCguVVI: Downloading MPD manifest
[youtube] yp3UeCguVVI: Downloading MPD manifest
[debug] Invoking downloader on u'https://r1---sn-hvgxoxu-jv0e.googlevideo.com/vi
deoplayback?id=ca9dd478282e5552&itag=141&source=youtube&requiressl=yes&pl=16&mv=
m&ms=au&mn=sn-hvgxoxu-jv0e&mm=31&pcm2cms=yes&ratebypass=yes&mime=audio/mp4&gir=y
es&clen=8148400&lmt=1429788581151194&dur=255.558&upn=02KmpljrS3w&sver=3&fexp=941
6126,9417058,9420452,9422436,9422596,9423661,9423662,9424767,9425352,9425416,942
7676&signature=195D37BD010173C6418034395B990F8210473B31.68DC36849D63804D27242430
652E7034ECE2A393&mt=1455087265&key=dg_yt0&ip=131.151.158.101&ipbits=0&expire=145
5108999&sparams=ip,ipbits,expire,id,itag,source,requiressl,pl,mv,ms,mn,mm,pcm2cm
s,ratebypass,mime,gir,clen,lmt,dur'
[download] Destination: Output\Playlist Names\Testing1.m4a
[download] 100% of 7.77MiB in 00:00
[ffmpeg] Correcting container in "Output\Playlist Names\Testing1.m4a"
[debug] ffmpeg command line: ffmpeg -y -i 'file:Output\Playlist Names\Testing1.m
4a' -c copy -f mp4 'file:Output\Playlist Names\Testing1.temp.m4a'
[debug] ffmpeg command line: ffprobe -show_streams 'file:Output\Playlist Names\T
esting1.m4a'
[ffmpeg] Destination: Output\Playlist Names\Testing1.mp3
[debug] ffmpeg command line: ffmpeg -y -i 'file:Output\Playlist Names\Testing1.m
4a' -vn -acodec libmp3lame -q:a 0 'file:Output\Playlist Names\Testing1.mp3'
Deleting original file Output\Playlist Names\Testing1.m4a (pass -k to keep)
Time Elapsed: 0:06
Playlist Names:   1 /   1 100%
Done!

Second run (file name: Testing2)

Q:\Coding\Projects\Python\MusicDownloader>python MusicUpdater.py
What file to use for input? sampleinput.txt
youtube-dl is up-to-date (2016.02.09.1)
Command:  youtube-dl.exe -o "Output/Playlist Names/Testing2.%(ext)s" -v -x --aud
io-format mp3 --audio-quality 0 https://www.youtube.com/watch?v=yp3UeCguVVI
Time Elapsed: 0:00
Playlist Names:   0 /   1  0%
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-o', u'Output/Playlist Names/Testing2.%(ext)s', u'
-v', u'-x', u'--audio-format', u'mp3', u'--audio-quality', u'0', u'https://www.y
outube.com/watch?v=yp3UeCguVVI']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2016.02.09.1
[debug] Python version 2.7.10 - Windows-8-6.2.9200
[debug] exe versions: ffmpeg N-66116-g720c21d, ffprobe N-66116-g720c21d
[debug] Proxy map: {}
[youtube] yp3UeCguVVI: Downloading webpage
[youtube] yp3UeCguVVI: Downloading video info webpage
[youtube] yp3UeCguVVI: Extracting video information
[youtube] yp3UeCguVVI: Downloading MPD manifest
[youtube] yp3UeCguVVI: Downloading MPD manifest
[debug] Invoking downloader on u'https://r1---sn-hvgxoxu-jv0e.googlevideo.com/vi
deoplayback?id=ca9dd478282e5552&itag=141&source=youtube&requiressl=yes&pcm2cms=y
es&mm=31&mn=sn-hvgxoxu-jv0e&ms=au&mv=m&pl=16&ratebypass=yes&mime=audio/mp4&gir=y
es&clen=8148400&lmt=1429788581151194&dur=255.558&mt=1455087265&signature=549A67E
EE804930AE7C447529C8CBB0E66E3F03B.93A7329DE3DC9DDC6BDBC07AC9A3924C473B8570&sver=
3&upn=4v7k-REwCXo&fexp=9406993,9408206,9416126,9417058,9420452,9422596,9423661,9
423662,9425120,9425731,9426948,9427413,9427534,9428708,9428732&key=dg_yt0&ip=131
.151.158.101&ipbits=0&expire=1455109013&sparams=ip,ipbits,expire,id,itag,source,
requiressl,pcm2cms,mm,mn,ms,mv,pl,ratebypass,mime,gir,clen,lmt,dur'
[download] Destination: Output\Playlist Names\Testing2.m4a
[download] 100% of 7.77MiB in 00:00
[ffmpeg] Correcting container in "Output\Playlist Names\Testing2.m4a"
[debug] ffmpeg command line: ffmpeg -y -i 'file:Output\Playlist Names\Testing2.m
4a' -c copy -f mp4 'file:Output\Playlist Names\Testing2.temp.m4a'
Traceback (most recent call last):
  File "__main__.py", line 19, in <module>
  File "youtube_dl\__init__.pyo", line 411, in main
  File "youtube_dl\__init__.pyo", line 401, in _real_main
  File "youtube_dl\YoutubeDL.pyo", line 1690, in download
  File "youtube_dl\YoutubeDL.pyo", line 677, in extract_info
  File "youtube_dl\YoutubeDL.pyo", line 722, in process_ie_result
  File "youtube_dl\YoutubeDL.pyo", line 1360, in process_video_result
  File "youtube_dl\YoutubeDL.pyo", line 1672, in process_info
  File "youtube_dl\YoutubeDL.pyo", line 1736, in post_process
  File "youtube_dl\postprocessor\ffmpeg.pyo", line 465, in run
WindowsError: [Error 183] Cannot create a file when that file already exists
Time Elapsed: 0:03
Playlist Names:   1 /   1 100%
Done!
@civilwargeeky
Copy link
Author

@civilwargeeky civilwargeeky commented Feb 10, 2016

Hmm... Upon further investigation it seems only to happen with files that I had previously deleted in testing. For example naming the file "Testing6" resulted in no error, though it seems to be somewhat random. It may be some error with ffmpeg and not youtube-dl

@civilwargeeky
Copy link
Author

@civilwargeeky civilwargeeky commented Feb 10, 2016

After thinking about it today, I realized this bug is probably due to my testing in a coding environment hardlinked to be synced by Dropbox, and the files weren't being "fully" deleted as far as the operating system was concerned for a while after deletion.
I tested this by moving the program to another directory, and confirmed.
Sorry for wasting any time. My sleep-deprived self of course thought it was the utility I was using :P

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.