Repository: ytdl-org/youtube-dl

Issue:
Cannot convert audio to mp3 while embedding thumbnail
## Please follow the guide below

- You will be asked some questions and requested to provide some information, please read them **carefully** and answer honestly
- Put an `x` into all the boxes [ ] relevant to your *issue* (like that [x])
- Use *Preview* tab to see how your issue will actually look like

---

### Make sure you are using the *latest* version: run `youtube-dl --version` and ensure your version is *2017.01.18*. If it's not read [this FAQ entry](https://github.com/rg3/youtube-dl/blob/master/README.md#how-do-i-update-youtube-dl) and update. Issues with outdated version will be rejected.
- [x] I've **verified** and **I assure** that I'm running youtube-dl **2017.01.18**

### Before submitting an *issue* make sure you have:
- [x] At least skimmed through [README](https://github.com/rg3/youtube-dl/blob/master/README.md) and **most notably** [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections
- [x] [Searched](https://github.com/rg3/youtube-dl/search?type=Issues) the bugtracker for similar issues including closed ones

### What is the purpose of your *issue*?
- [x] Bug report (encountered problems with youtube-dl)
- [ ] Site support request (request for adding support for a new site)
- [ ] Feature request (request for a new functionality)
- [ ] Question
- [ ] Other

---

### The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your *issue*

---

### If the purpose of this *issue* is a *bug report*, *site support request* or you are not completely sure provide the full verbose output as follows:

Add `-v` flag to **your command line** you run youtube-dl with, copy the **whole** output and insert it here. It should look similar to one below (replace it with **your** log inserted between triple ```):
```
> youtube-dl --audio-format mp3 --embed-thumbnail -v https://soundcloud.com/nucrri-tika/vlad-dobrescu-noaptea-mintii-nctk-remix
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--audio-format', u'mp3', u'--embed-thumbnail', u'-v', u'https://soundcloud.com/nucrri-tika/vlad-dobrescu-noaptea-mintii-nctk-remix']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.01.18
[debug] Python version 2.7.13 - Darwin-16.3.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 3.2.2, ffprobe 3.2.2
[debug] Proxy map: {}
[soundcloud] nucrri-tika/vlad-dobrescu-noaptea-mintii-nctk-remix: Resolving id
[soundcloud] nucrri-tika/vlad-dobrescu-noaptea-mintii-nctk-remix: Downloading info JSON
[soundcloud] 187777451: Downloading track url
[soundcloud] 187777451: Checking download video format URL
[soundcloud] 187777451: Checking http_mp3_128_url video format URL
[soundcloud] 187777451: Downloading thumbnail ...
[soundcloud] 187777451: Writing thumbnail to: Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.jpg
[debug] Invoking downloader on u'https://api.soundcloud.com/tracks/187777451/download?client_id=fDoItMDbsbZz8dY16ZzARCZmzgHBPotA'
[download] Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.wav has already been downloaded
[download] 100% of 34.34MiB
ERROR: Only mp3 and m4a/mp4 are supported for thumbnail embedding for now.
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1837, in post_process
    files_to_delete, info = pp.run(info)
  File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/embedthumbnail.py", line 90, in run
    raise EmbedThumbnailPPError('Only mp3 and m4a/mp4 are supported for thumbnail embedding for now.')
EmbedThumbnailPPError
```

---

### Description of your *issue*, suggested solution and other information

Explanation of your *issue* in arbitrary form goes here. Please make sure the [description is worded well enough to be understood](https://github.com/rg3/youtube-dl#is-the-description-of-the-issue-itself-sufficient). Provide as much context and examples as possible.
If work on your *issue* requires account credentials please provide them or explain how one can obtain them.

Passing `--audio-format mp3` and `--embed-thumbnail`, I expected it to convert the audio file to `.mp3` and __then__ try to embed the thumbnail into it.



Discussion:
--audio-format has not effects without -x
```
$ youtube-dl -x --audio-format mp3 --embed-thumbnail -v https://soundcloud.com/nucrri-tika/vlad-dobrescu-noaptea-mintii-nctk-remix
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-x', '--audio-format', 'mp3', '--embed-thumbnail', '-v', 'https://soundcloud.com/nucrri-tika/vlad-dobrescu-noaptea-mintii-nctk-remix']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.01.18
[debug] Git HEAD: 1076858f7
[debug] Python version 3.6.0 - Linux-4.9.0-1-ARCH-x86_64-with-arch-Arch-Linux
[debug] exe versions: ffmpeg 3.2.2, ffprobe 3.2.2, rtmpdump 2.4
[debug] Proxy map: {}
[soundcloud] nucrri-tika/vlad-dobrescu-noaptea-mintii-nctk-remix: Resolving id
[soundcloud] nucrri-tika/vlad-dobrescu-noaptea-mintii-nctk-remix: Downloading info JSON
[soundcloud] 187777451: Downloading track url
[soundcloud] 187777451: Checking download video format URL
[soundcloud] 187777451: Checking http_mp3_128_url video format URL
[soundcloud] 187777451: Downloading thumbnail ...
[soundcloud] 187777451: Writing thumbnail to: Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.jpg
[debug] Invoking downloader on 'https://api.soundcloud.com/tracks/187777451/download?client_id=fDoItMDbsbZz8dY16ZzARCZmzgHBPotA'
[download] Destination: Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.wav
[download] 100% of 34.34MiB in 00:03
[debug] ffmpeg command line: ffprobe -show_streams 'file:Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.wav'
[ffmpeg] Destination: Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.mp3
[debug] ffmpeg command line: ffmpeg -y -i 'file:Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.wav' -vn -acodec libmp3lame -q:a 5 'file:Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.mp3'
Deleting original file Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.wav (pass -k to keep)
[ffmpeg] Adding thumbnail to "Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.mp3"
[debug] ffmpeg command line: ffmpeg -y -i 'file:Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.mp3' -i 'file:Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.jpg' -c copy -map 0 -map 1 -metadata:s:v 'title="Album cover"' -metadata:s:v 'comment="Cover (Front)"' 'file:Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.temp.mp3'
```

Resolving patch:
diff --git a/youtube_dl/options.py b/youtube_dl/options.py
--- a/youtube_dl/options.py
+++ b/youtube_dl/options.py
@@ -751,7 +751,7 @@ def _scrub_eq(o):
         help='Convert video files to audio-only files (requires ffmpeg or avconv and ffprobe or avprobe)')
     postproc.add_option(
         '--audio-format', metavar='FORMAT', dest='audioformat', default='best',
-        help='Specify audio format: "best", "aac", "vorbis", "mp3", "m4a", "opus", or "wav"; "%default" by default')
+        help='Specify audio format: "best", "aac", "vorbis", "mp3", "m4a", "opus", or "wav"; "%default" by default; No effect without -x')
     postproc.add_option(
         '--audio-quality', metavar='QUALITY',
         dest='audioquality', default='5',


Test patch: