[extractor] Use classmethod/property where possible
and refactor lazy extractors accordingly. This reduces the need to create extractor instances
This commit is contained in:
parent
7ddbf09c25
commit
82d020804d
11 changed files with 194 additions and 173 deletions
|
|
@ -31,6 +31,7 @@ from ..utils import (
|
|||
NO_DEFAULT,
|
||||
ExtractorError,
|
||||
bug_reports_message,
|
||||
classproperty,
|
||||
clean_html,
|
||||
datetime_from_str,
|
||||
dict_get,
|
||||
|
|
@ -5781,16 +5782,17 @@ class YoutubeMusicSearchURLIE(YoutubeTabBaseInfoExtractor):
|
|||
class YoutubeFeedsInfoExtractor(InfoExtractor):
|
||||
"""
|
||||
Base class for feed extractors
|
||||
Subclasses must define the _FEED_NAME property.
|
||||
Subclasses must re-define the _FEED_NAME property.
|
||||
"""
|
||||
_LOGIN_REQUIRED = True
|
||||
_FEED_NAME = 'feeds'
|
||||
|
||||
def _real_initialize(self):
|
||||
YoutubeBaseInfoExtractor._check_login_required(self)
|
||||
|
||||
@property
|
||||
@classproperty
|
||||
def IE_NAME(self):
|
||||
return 'youtube:%s' % self._FEED_NAME
|
||||
return f'youtube:{self._FEED_NAME}'
|
||||
|
||||
def _real_extract(self, url):
|
||||
return self.url_result(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue