Skip to content

Commit

Permalink
[ie/GoogleDrive] Fix source file extraction (#8990)
Browse files Browse the repository at this point in the history
Closes #8976
Authored by: jazz1611
  • Loading branch information
jazz1611 committed Jan 18, 2024
1 parent 393b487 commit 5498729
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions yt_dlp/extractor/googledrive.py
Expand Up @@ -19,9 +19,9 @@ class GoogleDriveIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://
(?:
(?:docs|drive)\.google\.com/
(?:docs|drive|drive\.usercontent)\.google\.com/
(?:
(?:uc|open)\?.*?id=|
(?:uc|open|download)\?.*?id=|
file/d/
)|
video\.google\.com/get_player\?.*?docid=
Expand Down Expand Up @@ -53,6 +53,9 @@ class GoogleDriveIE(InfoExtractor):
}, {
'url': 'https://drive.google.com/uc?id=0B2fjwgkl1A_CX083Tkowdmt6d28',
'only_matching': True,
}, {
'url': 'https://drive.usercontent.google.com/download?id=0ByeS4oOUV-49Zzh4R1J6R09zazQ',
'only_matching': True,
}]
_FORMATS_EXT = {
'5': 'flv',
Expand Down Expand Up @@ -205,9 +208,10 @@ def get_value(key):
formats.append(f)

source_url = update_url_query(
'https://drive.google.com/uc', {
'https://drive.usercontent.google.com/download', {
'id': video_id,
'export': 'download',
'confirm': 't',
})

def request_source_file(source_url, kind, data=None):
Expand Down

0 comments on commit 5498729

Please sign in to comment.