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

Resolve audio/x-wav to "wav" extension, rather than "x-wav" (which ffmpeg does not recognize) #26463

Closed
wants to merge 1 commit into from

Conversation

tfvlrue
Copy link
Contributor

@tfvlrue tfvlrue commented Aug 28, 2020

#25938 Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])
  • Use Preview tab to see how your pull request will actually look like

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

Description of your pull request and other information

This fixes ffmpeg errors when trying to downloading certain audio files from Soundcloud with the --add-metadata option set. I believe these files were uploaded without an extension, and are being identified as audio/x-wav. However, youtube-dl was downloading them with a "x-wav" extension, which ffmpeg fails to recognize as a valid output format. This change forces the extension to be "wav" which resolves the issue.

An example to reproduce the problem:

youtube-dl -o "%(title)s.%(ext)s" --add-metadata https://soundcloud.com/mediasanctuary/1033-jesse-marshall-9-12-2019

Before this change:

[soundcloud] mediasanctuary/1033-jesse-marshall-9-12-2019: Downloading info JSON
[soundcloud] 680239748: Downloading JSON metadata
[soundcloud] 680239748: Downloading webpage
[soundcloud] 680239748: Downloading JSON metadata
[soundcloud] 680239748: Downloading JSON metadata
[soundcloud] 680239748: Downloading JSON metadata
[download] Destination: 10'33' Jesse Marshall 9 - 12 - 2019.x-wav
[download] 100% of 53.24MiB in 00:03
[ffmpeg] Adding metadata to '10'33' Jesse Marshall 9 - 12 - 2019.x-wav'
ERROR: file:10'33' Jesse Marshall 9 - 12 - 2019.temp.x-wav: Invalid argument

After this change:

[soundcloud] mediasanctuary/1033-jesse-marshall-9-12-2019: Downloading info JSON
[soundcloud] 680239748: Downloading JSON metadata
[soundcloud] 680239748: Downloading webpage
[soundcloud] 680239748: Downloading JSON metadata
[soundcloud] 680239748: Downloading JSON metadata
[soundcloud] 680239748: Downloading JSON metadata
[download] Destination: 10'33' Jesse Marshall 9 - 12 - 2019.wav
[download] 100% of 53.24MiB in 00:03
[ffmpeg] Adding metadata to '10'33' Jesse Marshall 9 - 12 - 2019.wav'

…mpeg does not recognize)

This was causing ffmpeg errors when trying to downloading certain audio files from Soundcloud with the --add-metadata option set.
@dstftw dstftw closed this in 1d9bf65 Sep 6, 2020
@ytdl-org ytdl-org deleted a comment from blackjack4494 Sep 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant