mirror of
https://github.com/yt-dlp/yt-dlp
synced 2025-06-30 11:02:54 -05:00
[lazy_extractors] Fix suitable
and add flake8 test
This commit is contained in:
@ -8,10 +8,6 @@ import re
|
||||
class LazyLoadExtractor(object):
|
||||
_module = None
|
||||
|
||||
@classmethod
|
||||
def ie_key(cls):
|
||||
return cls.__name__[:-2]
|
||||
|
||||
def __new__(cls, *args, **kwargs):
|
||||
mod = __import__(cls._module, fromlist=(cls.__name__,))
|
||||
real_cls = getattr(mod, cls.__name__)
|
||||
|
@ -32,6 +32,7 @@ with open('devscripts/lazy_load_template.py', 'rt') as f:
|
||||
|
||||
module_contents = [
|
||||
module_template,
|
||||
getsource(InfoExtractor.ie_key),
|
||||
getsource(InfoExtractor._match_valid_url),
|
||||
getsource(InfoExtractor.suitable),
|
||||
'\nclass LazyLoadSearchExtractor(LazyLoadExtractor):\n pass\n']
|
||||
@ -104,7 +105,7 @@ for ie in ordered_cls:
|
||||
names.append(name)
|
||||
|
||||
module_contents.append(
|
||||
'_ALL_CLASSES = [{0}]'.format(', '.join(names)))
|
||||
'\n_ALL_CLASSES = [{0}]'.format(', '.join(names)))
|
||||
|
||||
module_src = '\n'.join(module_contents) + '\n'
|
||||
|
||||
|
Reference in New Issue
Block a user