[youtube] Warn when trying to download clips

This commit is contained in:
pukkandan 2021-09-19 19:37:47 +05:30
parent 1b629e1b4c
commit 3cd786dbd7
No known key found for this signature in database
GPG Key ID: 0F00D95A001F4698
2 changed files with 12 additions and 1 deletions

View File

@ -1812,6 +1812,7 @@
from .yourupload import YourUploadIE from .yourupload import YourUploadIE
from .youtube import ( from .youtube import (
YoutubeIE, YoutubeIE,
YoutubeClipIE,
YoutubeFavouritesIE, YoutubeFavouritesIE,
YoutubeHistoryIE, YoutubeHistoryIE,
YoutubeTabIE, YoutubeTabIE,

View File

@ -246,7 +246,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
"""Provide base functions for Youtube extractors""" """Provide base functions for Youtube extractors"""
_RESERVED_NAMES = ( _RESERVED_NAMES = (
r'channel|c|user|playlist|watch|w|v|embed|e|watch_popup|' r'channel|c|user|playlist|watch|w|v|embed|e|watch_popup|clip|'
r'shorts|movies|results|shared|hashtag|trending|feed|feeds|' r'shorts|movies|results|shared|hashtag|trending|feed|feeds|'
r'browse|oembed|get_video_info|iframe_api|s/player|' r'browse|oembed|get_video_info|iframe_api|s/player|'
r'storefront|oops|index|account|reporthistory|t/terms|about|upload|signin|logout') r'storefront|oops|index|account|reporthistory|t/terms|about|upload|signin|logout')
@ -4727,6 +4727,16 @@ def _real_extract(self, url):
expected=True) expected=True)
class YoutubeClipIE(InfoExtractor):
IE_NAME = 'youtube:clip'
IE_DESC = False # Do not list
_VALID_URL = r'https?://(?:www\.)?youtube\.com/clip/'
def _real_extract(self, url):
self.report_warning('YouTube clips are not currently supported. The entire video will be downloaded instead')
return self.url_result(url, 'Generic')
class YoutubeTruncatedIDIE(InfoExtractor): class YoutubeTruncatedIDIE(InfoExtractor):
IE_NAME = 'youtube:truncated_id' IE_NAME = 'youtube:truncated_id'
IE_DESC = False # Do not list IE_DESC = False # Do not list