2016-07-27 133 views
0

------------------------------ Format Numbers Numbers ------ -------------------------------------------------- --------------youtube-dl用formatid下載視頻

  • 249 WEBM只有音頻的音頻DASH 52K,OPUS @ 50K,629.08KiB
  • 250 WEBM只有音頻的音頻DASH 69K,OPUS @ 70K,811.98 KIB
  • 171 WEBM只有音頻的音頻DASH 110K,Vorbis格式@ 128K,1.27MiB
  • 140 M4A只有音頻的音頻DASH 128K,m4a_dash容器,[email protected],1。 56MiB
  • 251 WEBM只有音頻的音頻DASH 138K,OPUS @ 160K,1.53MiB
  • 278 WEBM 254x144 144P 82K,WEBM容器,VP9,13fps,僅視頻,772.69KiB
  • 242 WEBM 400x226 240P 101K,VP9, 25fps的,僅視頻,884.56KiB
  • 160 MP4 254x144 144P 112K,avc1.4d400c,13fps,僅視頻,1.31MiB
  • 133 MP4 400x226 240P 265K,avc1.4d400d,25fps的,僅視頻,2.92MiB
  • 17 3gp 176x144 small,mp4v.20.3,mp4a.40.2 @ 24k
  • 36 3GP看見320×180小,mp4v.20.3,mp4a.40.2
  • 18 MP4 400x226介質,avc1.42001E,mp4a.40.2 @ 96K
  • 43 WEBM爲640x360介質,vp8.0,Vorbis格式@ 128K(最好)

我想在程序中使用的數字格式這樣

import youtube_dl 

url = "https://www.youtube.com/watch?v=BaW_jenozKc" 
ydl_opts = { 
    'verbose': True, 
    'format': 'bestaudio/best', #maybe like this 'formatid'= 22 
    'outtmpl': '%(title)s-%(id)s.%(ext)s', 
    'noplaylist': True, 
} 
with youtube_dl.YoutubeDL(ydl_opts) as ydl: 
    ydl.download([url]) 

我怎麼能做到這一點

回答

1

如果你真的想格式化22,那麼確實,PA ss format密鑰22。如果22不可用,您可以使用/best回退到最佳視頻格式:

ydl_opts = { 
    'format': '22/best', 
    ... 
+0

lol其如此簡單:D謝謝 – stackrangerflow