Skip to content

Commit

Permalink
[extractor/GoogleDrive] Add more supported types
Browse files Browse the repository at this point in the history
We import those from the Youtube extractor, and also add:

    '50':'mp3',

for mp3 files scrapping.

Fix: #8281
  • Loading branch information
WyohKnott committed May 11, 2024
1 parent 4cc99d7 commit e206766
Showing 1 changed file with 107 additions and 16 deletions.
123 changes: 107 additions & 16 deletions yt_dlp/extractor/googledrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,113 @@ class GoogleDriveIE(InfoExtractor):
'only_matching': True,
}]
_FORMATS_EXT = {
'5': 'flv',
'6': 'flv',
'13': '3gp',
'17': '3gp',
'18': 'mp4',
'22': 'mp4',
'34': 'flv',
'35': 'flv',
'36': '3gp',
'37': 'mp4',
'38': 'mp4',
'43': 'webm',
'44': 'webm',
'45': 'webm',
'46': 'webm',
'59': 'mp4',
'5':'flv',
'6':'flv',
'13':'3gp',
'17':'3gp',
'18':'mp4',
'22':'mp4',
'34':'flv',
'35':'flv',
# itag 36 videos are either 320x180 (BaW_jenozKc) or 320x240 (__2ABJjxzNo), abr varies as well
'36':'3gp',
'37':'mp4',
'38':'mp4',
'43':'webm',
'44':'webm',
'45':'webm',
'46':'webm',
'50':'mp3',
'59':'mp4',
'78':'mp4',

# 3D videos
'82':'mp4',
'83':'mp4',
'84':'mp4',
'85':'mp4',
'100':'webm',
'101':'webm',
'102':'webm',

# Apple HTTP Live Streaming
'91':'mp4',
'92':'mp4',
'93':'mp4',
'94':'mp4',
'95':'mp4',
'96':'mp4',
'132':'mp4',
'151':'mp4',

# DASH mp4 video
'133':'mp4',
'134':'mp4',
'135':'mp4',
'136':'mp4',
'137':'mp4',
'138':'mp4',
'160':'mp4',
'212':'mp4',
'264':'mp4',
'298':'mp4',
'299':'mp4',
'266':'mp4',

# Dash mp4 audio
'139':'m4a',
'140':'m4a',
'141':'m4a',
'256':'m4a',
'258':'m4a',
'325':'m4a',
'328':'m4a',

# Dash webm
'167':'webm',
'168':'webm',
'169':'webm',
'170':'webm',
'218':'webm',
'219':'webm',
'278':'webm',
'242':'webm',
'243':'webm',
'244':'webm',
'245':'webm',
'246':'webm',
'247':'webm',
'248':'webm',
'271':'webm',
# itag 272 videos are either 3840x2160 (e.g. RtoitU2A-3E) or 7680x4320 (sLprVF6d7Ug)
'272':'webm',
'302':'webm',
'303':'webm',
'308':'webm',
'313':'webm',
'315':'webm',

# Dash webm audio
'171':'webm',
'172':'webm',

# Dash webm audio with opus inside
'249':'webm',
'250':'webm',
'251':'webm',

# RTMP (unnamed)
'_rtmp': {'protocol': 'rtmp'},

# av01 video only formats sometimes served with "unknown" codecs
'394':'mp4',
'395':'mp4',
'396':'mp4',
'397':'mp4',
'398':'mp4',
'399':'mp4',
'400':'mp4',
'401':'mp4',
}
_BASE_URL_CAPTIONS = 'https://drive.google.com/timedtext'
_CAPTIONS_ENTRY_TAG = {
Expand Down

0 comments on commit e206766

Please sign in to comment.