diff options
author | dirkf <fieldhouse@gmx.net> | 2023-02-06 16:19:21 +0000 |
---|---|---|
committer | dirkf <fieldhouse@gmx.net> | 2023-02-13 03:54:51 +0000 |
commit | bafb6dec72865cc494feb35ecc94481c30a81069 (patch) | |
tree | 5f59d38e48f139b50f2003162c19af68f68019e3 /devscripts | |
parent | 4e04f104994c5dac2cb74b64ba7725716ce939d7 (diff) |
[YouTube] Refresh compat/utils usage
* import parse_qs()
* import parse_qs in lazy_extractors (clears old TODO)
* clean up old compiled lazy_extractors for Py2
* use update_url()
Diffstat (limited to 'devscripts')
-rw-r--r-- | devscripts/make_lazy_extractors.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/devscripts/make_lazy_extractors.py b/devscripts/make_lazy_extractors.py index 878ae72b1..edc19183d 100644 --- a/devscripts/make_lazy_extractors.py +++ b/devscripts/make_lazy_extractors.py @@ -13,6 +13,11 @@ sys.path.insert(0, dirn(dirn((os.path.abspath(__file__))))) lazy_extractors_filename = sys.argv[1] if os.path.exists(lazy_extractors_filename): os.remove(lazy_extractors_filename) +# Py2: may be confused by leftover lazy_extractors.pyc +try: + os.remove(lazy_extractors_filename + 'c') +except OSError: + pass from youtube_dl.extractor import _ALL_CLASSES from youtube_dl.extractor.common import InfoExtractor, SearchInfoExtractor @@ -22,7 +27,10 @@ with open('devscripts/lazy_load_template.py', 'rt') as f: module_contents = [ module_template + '\n' + getsource(InfoExtractor.suitable) + '\n', - 'class LazyLoadSearchExtractor(LazyLoadExtractor):\n pass\n'] + 'class LazyLoadSearchExtractor(LazyLoadExtractor):\n pass\n', + # needed for suitable() methods of Youtube extractor (see #28780) + 'from youtube_dl.utils import parse_qs\n', +] ie_template = ''' class {name}({bases}): |