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.
Can't figure out how to fix this error I keep getting. #5645
Comments
|
here's the entire log of what I did in IDLE and the stuff it spit out: http://pastebin.com/VLrjJhMN I understand that my initial comment didn't have sufficient information, so here's some more information: The program is actually producing files on my computer, they're just not in mp3 format like I want them to be. This is what they look like in the folder: http://i.imgur.com/MzHDFII.png when I try to get info about them they don't appear to have any type of file extension. The error message produced by the program every time I run it says installing ffmpeg or avconv would fix this "automatically." But installing them clearly hasn't. I don't really understand how to use ffmpeg. So I just copied and pasted commands for it into Terminal (mac equivalent of command prompt) hoping it would fix this issue somehow. For reasons I'm unable to reproduce the commands I typed in. My question is this: to get these files to my desired format (mp3) do I need to change the code or do I need to use Terminal to change their format? If I do indeed need to use ffmpeg in Terminal, could you please tell me what command(s) I need to use to fix this? |
|
full output with the
I guess you are setting the output template ( |
|
before I messed around with -v I took the advice of your 'guess' and changed the output template to %(id)s.%(ext)s so that the code looks like this: http://pastebin.com/wBV6DsYd When I run the code it produced these types of files: http://i.imgur.com/xCfqwiR.png but the issue is that the code get's stuck, and never progresses past a certain percent. I had a hard time copying the stuff in the IDLE because it kept spitting out the same message, so I took a screen grab: http://i.imgur.com/7BTXgnC.png I can't parse exactly what you mean by -v. I don't know how to "add" youtube-dl --verbose OTHER_OPTIONS URL as an option when I run the program in IDLE. I'm an idiot, I don't understand - I'm not very good at using IDLE. If you could be a bit more precise about exactly how to go about doing -v that would be great. Thanks for helping me btw. EDIT: I don't think the program is getting stuck because internet lag btw. My internet seems to work fine while the program was running. |
|
Figured out how to use -v. I didn't realize I had to put it into Terminal. it spit out this: http://pastebin.com/P0WUnJrT |
|
Try with this code and post the output: import youtube_dl
options = {
'verbose': True,
'format': 'bestaudio/best',
'outtmpl': '%(id)s.%(ext)s',
'noplaylist' : True,
'postprocessors': [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
}],
}
URL = 'test:youtube' #input('video url: ')
with youtube_dl.YoutubeDL(options) as ydl:
ydl.download([URL])( |
|
I ran the code you posted, it produced this: http://pastebin.com/3nA2W36w |
|
I just noticed the code you gave me produces working audio files. Since my issue is basically resolved, I'm gonna close this thread |
I'm trying to make a program that downloads the audio from youtube videos and converts them to mp3 files. According to this site: http://willdrevo.com/downloading-youtube-and-soundcloud-audio-with-python-and-pandas/ I can do this with youtube-dl. I have this code (taken from the site previously mentioned): http://pastebin.com/6s5agE9f the problem I'm having is every time I run the program I get this error,"�[0;33mWARNING:�[0m LyhU7qwGuFA: writing DASH m4a. Only some players support this container. Install ffmpeg or avconv to fix this automatically." I attempted to resolve this by installing both ffmpeg and avconv. I tried using some commands I found that I thought might work to convert the videos to the proper format. But nothing has worked so far. I tried updating youtube-dl, but it didn't work either (same error when the code is run).
Anyone have ideas for why this isn't working? I'm on OS X (macbook pro). And the version of python I'm using is 3.4.2.