[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
pull/10501/head
grqx_wsl 1 year ago
parent 017997068b
commit 99d9105f33

@ -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}))

Loading…
Cancel
Save