[GoogleDrive] add support for shortcut urls: follow redirection

Example url: https://drive.google.com/file/d/17OrYKQBPRm4J_D1rsGbo4eOmm1_SfoIY/
Redirects to(real video):
https://drive.google.com/file/d/1Jp0I0tS-qMxtXNehGQW5_hWhwgC0FeeB/edit
This commit is contained in:
grqx_wsl 2024-07-28 03:36:55 +12:00
parent 017997068b
commit 99d9105f33

View file

@ -167,6 +167,10 @@ class GoogleDriveIE(InfoExtractor):
def _real_extract(self, url):
video_id = self._match_id(url)
_, webpage_urlh = self._download_webpage_handle(url, video_id)
if webpage_urlh.url != url:
return self.url_result(webpage_urlh.url)
video_info = urllib.parse.parse_qs(self._download_webpage(
'https://drive.google.com/get_video_info',
video_id, 'Downloading video webpage', query={'docid': video_id}))