mirror of
https://github.com/yt-dlp/yt-dlp
synced 2025-01-01 06:21:09 +01:00
[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:
parent
017997068b
commit
99d9105f33
1 changed files with 4 additions and 0 deletions
|
@ -167,6 +167,10 @@ class GoogleDriveIE(InfoExtractor):
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(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(
|
video_info = urllib.parse.parse_qs(self._download_webpage(
|
||||||
'https://drive.google.com/get_video_info',
|
'https://drive.google.com/get_video_info',
|
||||||
video_id, 'Downloading video webpage', query={'docid': video_id}))
|
video_id, 'Downloading video webpage', query={'docid': video_id}))
|
||||||
|
|
Loading…
Reference in a new issue