aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-09-22 05:35:39 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-09-22 05:37:41 +0530
commit5e3f2f8fc4cdf600b5030c70478274bdb4dcf4c6 (patch)
tree27c6e54188ca1a443c9fc1297e530b317c028e49
parent1009f67c2a9a774bd4b3d7b09de4ad1268fa2f02 (diff)
downloadhypervideo-pre-5e3f2f8fc4cdf600b5030c70478274bdb4dcf4c6.tar.lz
hypervideo-pre-5e3f2f8fc4cdf600b5030c70478274bdb4dcf4c6.tar.xz
hypervideo-pre-5e3f2f8fc4cdf600b5030c70478274bdb4dcf4c6.zip
[youtube] Return full URL instead of just ID
-rw-r--r--yt_dlp/extractor/youtube.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py
index eb69b88a3..7f65e2b7d 100644
--- a/yt_dlp/extractor/youtube.py
+++ b/yt_dlp/extractor/youtube.py
@@ -869,7 +869,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
'_type': 'url',
'ie_key': YoutubeIE.ie_key(),
'id': video_id,
- 'url': video_id,
+ 'url': f'https://www.youtube.com/watch?v={video_id}',
'title': title,
'description': description,
'duration': duration,
@@ -4284,7 +4284,7 @@ class YoutubeTabIE(YoutubeBaseInfoExtractor):
if video_id and playlist_id:
if self.get_param('noplaylist'):
self.to_screen('Downloading just video %s because of --no-playlist' % video_id)
- return self.url_result(video_id, ie=YoutubeIE.ie_key(), video_id=video_id)
+ return self.url_result(f'https://www.youtube.com/watch?v={video_id}', ie=YoutubeIE.ie_key(), video_id=video_id)
self.to_screen('Downloading playlist %s; add --no-playlist to just download video %s' % (playlist_id, video_id))
webpage, data = self._extract_webpage(url, item_id)
@@ -4337,7 +4337,7 @@ class YoutubeTabIE(YoutubeBaseInfoExtractor):
if video_id:
if mobj['tab'] != '/live': # live tab is expected to redirect to video
self.report_warning('Unable to recognize playlist. Downloading just video %s' % video_id)
- return self.url_result(video_id, ie=YoutubeIE.ie_key(), video_id=video_id)
+ return self.url_result(f'https://www.youtube.com/watch?v={video_id}', ie=YoutubeIE.ie_key(), video_id=video_id)
raise ExtractorError('Unable to recognize tab page')