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

Can't figure out how to fix this error I keep getting. #5645

Closed
spudzee opened this issue May 7, 2015 · 8 comments
Closed

Can't figure out how to fix this error I keep getting. #5645

spudzee opened this issue May 7, 2015 · 8 comments

Comments

@spudzee
Copy link

@spudzee spudzee commented May 7, 2015

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.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented May 7, 2015

@spudzee
Copy link
Author

@spudzee spudzee commented May 7, 2015

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?

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented May 7, 2015

full output with the --verbose options means you have to either add this option when you call youtube-dl from the IDLE and capture both stdout and stderr, or run youtube-dl --verbose OTHER_OPTIONS URL, you should see something like this:

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [<options>]
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.05.04
[debug] Git HEAD: 5268a05
[debug] Python version 3.4.3 - Darwin-13.4.0-x86_64-i386-64bit
[debug] exe versions: avconv 11.3, avprobe 11.3, ffmpeg 2.6.2, ffprobe 2.6.2, rtmpdump 2.4
[debug] Proxy map: {}

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

I guess you are setting the output template (-o option) to something like %(id)s, you have to use %(id)s.%(ext)s.

@spudzee
Copy link
Author

@spudzee spudzee commented May 7, 2015

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.

@spudzee
Copy link
Author

@spudzee spudzee commented May 7, 2015

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

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented May 7, 2015

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])

( extractaudio and audioformat are not valid options, see https://github.com/rg3/youtube-dl/blob/master/youtube_dl/YoutubeDL.py for all the parameters)

@spudzee
Copy link
Author

@spudzee spudzee commented May 7, 2015

I ran the code you posted, it produced this: http://pastebin.com/3nA2W36w

@spudzee
Copy link
Author

@spudzee spudzee commented May 8, 2015

I just noticed the code you gave me produces working audio files. Since my issue is basically resolved, I'm gonna close this thread

@spudzee spudzee closed this May 8, 2015
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.