Bugfix: -o m4a would fail [Fixes #720]

In FFmpeg, a given encoding may not always point to the same format
string.
This commit is contained in:
Ritiek Malhotra
2020-05-18 14:01:01 +05:30
parent 675d1805ed
commit cd5f224e37
5 changed files with 31 additions and 5 deletions

View File

@@ -138,6 +138,7 @@ class YouTubeStreams(StreamsBase):
self.all = []
for stream in audiostreams:
encoding = "m4a" if "mp4a" in stream.audio_codec else stream.audio_codec
standard_stream = {
# Store only the integer part for bitrate. For example
# the given bitrate would be "192kbps", we store only
@@ -145,7 +146,7 @@ class YouTubeStreams(StreamsBase):
"bitrate": int(stream.abr[:-4]),
"connection": None,
"download_url": stream.url,
"encoding": stream.audio_codec,
"encoding": encoding,
"filesize": None,
}
establish_connection = threading.Thread(