diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-05-16 19:36:36 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-05-17 00:07:43 +0530 |
commit | 241464919271278831f23b3a086dcf57aeb80d3b (patch) | |
tree | 8e1e0e2c2b4d632fa48d30aa84148185aa66224e /devscripts | |
parent | 5d5c0f7e99d121aa0db476b1166828af552aeb14 (diff) | |
download | hypervideo-pre-241464919271278831f23b3a086dcf57aeb80d3b.tar.lz hypervideo-pre-241464919271278831f23b3a086dcf57aeb80d3b.tar.xz hypervideo-pre-241464919271278831f23b3a086dcf57aeb80d3b.zip |
[cleanup] Misc cleanup
Diffstat (limited to 'devscripts')
-rw-r--r-- | devscripts/lazy_load_template.py | 11 | ||||
-rw-r--r-- | devscripts/make_lazy_extractors.py | 4 |
2 files changed, 10 insertions, 5 deletions
diff --git a/devscripts/lazy_load_template.py b/devscripts/lazy_load_template.py index 6d9b27742..cdafaf1ef 100644 --- a/devscripts/lazy_load_template.py +++ b/devscripts/lazy_load_template.py @@ -2,13 +2,18 @@ import importlib import random import re -from ..utils import bug_reports_message, classproperty, write_string +from ..utils import ( + age_restricted, + bug_reports_message, + classproperty, + write_string, +) class LazyLoadMetaClass(type): def __getattr__(cls, name): - # "is_suitable" requires "_TESTS". However, they bloat the lazy_extractors - if '_real_class' not in cls.__dict__ and name not in ('is_suitable', 'get_testcases'): + # "_TESTS" bloat the lazy_extractors + if '_real_class' not in cls.__dict__ and name != 'get_testcases': write_string( 'WARNING: Falling back to normal extractor since lazy extractor ' f'{cls.__name__} does not have attribute {name}{bug_reports_message()}\n') diff --git a/devscripts/make_lazy_extractors.py b/devscripts/make_lazy_extractors.py index 8ddc54b9b..8c481bc2d 100644 --- a/devscripts/make_lazy_extractors.py +++ b/devscripts/make_lazy_extractors.py @@ -8,9 +8,9 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) NO_ATTR = object() -STATIC_CLASS_PROPERTIES = ['IE_NAME', 'IE_DESC', 'SEARCH_KEY', '_WORKING', '_NETRC_MACHINE'] +STATIC_CLASS_PROPERTIES = ['IE_NAME', 'IE_DESC', 'SEARCH_KEY', '_WORKING', '_NETRC_MACHINE', 'age_limit'] CLASS_METHODS = [ - 'ie_key', 'working', 'description', 'suitable', '_match_valid_url', '_match_id', 'get_temp_id', + 'ie_key', 'working', 'description', 'suitable', '_match_valid_url', '_match_id', 'get_temp_id', 'is_suitable' ] IE_TEMPLATE = ''' class {name}({bases}): |