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

--get-filename broken for webm videos with extracting audio option #7137

Open
Clevero opened this issue Oct 11, 2015 · 9 comments
Open

--get-filename broken for webm videos with extracting audio option #7137

Clevero opened this issue Oct 11, 2015 · 9 comments

Comments

@Clevero
Copy link

@Clevero Clevero commented Oct 11, 2015

I think it's a bug, so i write this issue. I also did not find any issues related to this.

Getting the filename of the file seems to be broken when your video is in webm format and you want just the audio.

Example with "youtube-dl $URL -x --get-filename":
(url -> proposed filename -> saved file)

//got the right extension
https://www.youtube.com/watch?v=YSAqTdc-Y2g -> *.m4a -> *.m4a

//.opus file was written to disk instead of .webm file
https://www.youtube.com/watch?v=2TCDiK7GpNM -> *.webm -> *.opus

I found this bug (?) in a script written by me. It downloads the audio with "-x" but if the written filename is different as the proposed filename with "-x --get-filename" the script cannot copy the file to an another destination, cause it doesn't exists.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Oct 12, 2015

The --get-filename just prints the file where the audio is downloaded, before any conversion.

@Clevero
Copy link
Author

@Clevero Clevero commented Oct 14, 2015

so, the first video is downloaded in two slices, one just audio and one just video and then they are converted together?

and at .webm the whole video ist downloaded?

okay, mhm. and how can I get the file after the conversion?

Tried to look up the best audio format with "-F" it shows me .webm (audio only is the best audio only format) but .opus is at the end saved to disk.

should I replace the given extension here from .webm to .opus, cause at any time at any video, webm (audio only) is converted to .opus?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Oct 15, 2015

how can I get the file after the conversion

Currently there's no generic approach.

should I replace the given extension here from .webm to .opus, cause at any time at any video, webm (audio only) is converted to .opus?

Just to remind: WebM may contain Vorbis audio, too.

@ghost
Copy link

@ghost ghost commented Apr 22, 2016

I've found a side effect to this which looks like an actual bug: resuming a playlist download with -x will skip existing .m4a files correctly, but always redownloads the Opus-format .webm files even if they're already on disk.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Mar 3, 2017

After thinking again I believe it's impossible to get reliable filename without actual downloading. FFmpegExtractAudioPP uses ffprobe to determine the output file extension. This semantic needs real files.

If anyone else have a good idea, feel free to post it.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Nov 28, 2017

Let's continue the discussion in #5710.

@yan12125 yan12125 closed this Nov 28, 2017
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Nov 28, 2017

Sorry, they are not the same bug.

@dcht00
Copy link

@dcht00 dcht00 commented Jul 14, 2018

This is still a common problem.

For a yt download that turns out to be a .webm,

--get-filename incorectly gives:

XYZ.mp4

However when loading:

[youtube] Downloading webpage
[youtube] Downloading video info webpage
[...]
[download] Destination: XYZ.webm <--------- CORRECT
[download] Download completed

@alxnull alxnull mentioned this issue Oct 19, 2019
5 of 9 tasks complete
@byteshiva
Copy link

@byteshiva byteshiva commented Jan 2, 2020

The below command would give the filename after download.

youtube-dl -x --quiet https://www.youtube.com/watch?v=VGYLCXJhJnI -f bestaudio --exec 'echo {}'
gnawhleinad added a commit to gnawhleinad/youtube that referenced this issue Apr 5, 2020
--extract-audio is postprocess and requires a download
--get-filename doesn't download...

ytdl-org/youtube-dl#7137

fixes #3
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
5 participants
You can’t perform that action at this time.