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 specify output filename with -x #1969

Closed
jocelynke opened this issue Dec 14, 2013 · 5 comments
Closed

Can't specify output filename with -x #1969

jocelynke opened this issue Dec 14, 2013 · 5 comments

Comments

@jocelynke
Copy link

@jocelynke jocelynke commented Dec 14, 2013

Hi,

I can't specify a static filename when I'm extracting the audio of a video :
./youtube_dl -xcik -f 139 --restrict-filenames --audio-format mp3 -o "download" http://www.youtube.com/XXXXXX

Or maybe I'm missing an option. The error reported is
youtube_dl: error: Cannot download a video and extract audio into the same file! Use "%(ext)s" instead of u'download'

@EveryDirection
Copy link

@EveryDirection EveryDirection commented Dec 15, 2013

It looks like you're trying to download both a video and an audio stream, and they are both attempting to download to the file "download", so there's a conflict. Try replacing

-o "download"

in your command with

-o "download.%(ext)s"

so that the streams get downloaded to files with different extensions.

jaimeMF added a commit that referenced this issue Dec 15, 2013
…rove the error message (#1969)

Using 'foo.mp4' shouldn't raise an error.
If 'foo' is given suggest using 'foo.%(ext)s' for the template
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Dec 15, 2013

@EveryDirection is right, you have to specify the extension, using download.%(ext)s or download.mp4 if that's the video's format, but the first one is safer. I have improved the error message, it will now say Use "download.%(ext)s" instead of "download" as the output template.

@jaimeMF jaimeMF closed this Dec 15, 2013
@jocelynke
Copy link
Author

@jocelynke jocelynke commented Dec 15, 2013

Thanks guys !

But just to make it clear, with my command, I thought it would download the video with format 139, and then extract the audio as an mp3 file, @EveryDirection said it was going to download video AND audio, could you give me some explanation please ?

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Dec 15, 2013

You're right, I think that @EveryDirection meant that you were trying to write the extracted audio and the original video to the same file, that's why you saw the error message, because it's not possible.

@jocelynke
Copy link
Author

@jocelynke jocelynke commented Dec 15, 2013

Ok I understand better now. Thank you very much

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.