From 5498729c59b03a9511c64552da3ba2f802166f8d Mon Sep 17 00:00:00 2001 From: jazz1611 Date: Fri, 19 Jan 2024 06:24:34 +0700 Subject: [PATCH] [ie/GoogleDrive] Fix source file extraction (#8990) Closes #8976 Authored by: jazz1611 --- yt_dlp/extractor/googledrive.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/yt_dlp/extractor/googledrive.py b/yt_dlp/extractor/googledrive.py index 2fdec20f6..06658dd47 100644 --- a/yt_dlp/extractor/googledrive.py +++ b/yt_dlp/extractor/googledrive.py @@ -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= @@ -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', @@ -205,9 +208,10 @@ class GoogleDriveIE(InfoExtractor): 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):