projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
002c0fb
)
[YoutubeDL] Tweak select_format for video only media
author
Sergey M․
<dstftw@gmail.com>
Sat, 30 May 2015 22:05:09 +0000
(
04:05
+0600)
committer
Sergey M․
<dstftw@gmail.com>
Sat, 30 May 2015 22:05:09 +0000
(
04:05
+0600)
youtube_dl/YoutubeDL.py
patch
|
blob
|
history
diff --git
a/youtube_dl/YoutubeDL.py
b/youtube_dl/YoutubeDL.py
index 5fc8754c6300669e829105c54a25a8f1465ee967..aa6ec9d9a0721efbd5257750fda37b86fe024d8b 100755
(executable)
--- a/
youtube_dl/YoutubeDL.py
+++ b/
youtube_dl/YoutubeDL.py
@@
-924,8
+924,9
@@
class YoutubeDL(object):
if f.get('vcodec') != 'none' and f.get('acodec') != 'none']
if audiovideo_formats:
return audiovideo_formats[format_idx]
if f.get('vcodec') != 'none' and f.get('acodec') != 'none']
if audiovideo_formats:
return audiovideo_formats[format_idx]
- # for audio only urls, select the best/worst audio format
- elif all(f.get('acodec') != 'none' for f in available_formats):
+ # for audio only (soundcloud) or video only (imgur) urls, select the best/worst audio format
+ elif (all(f.get('acodec') != 'none' for f in available_formats) or
+ all(f.get('vcodec') != 'none' for f in available_formats)):
return available_formats[format_idx]
elif format_spec == 'bestaudio':
audio_formats = [
return available_formats[format_idx]
elif format_spec == 'bestaudio':
audio_formats = [