Commit Graph

13 Commits (a25e9f3c84a34d43f78a4e5a6f6c2e98e2a0ade3)

Author SHA1 Message Date
dirkf aac33155e4 [build] Add and use `devscripts/utils` 2 years ago
dirkf 7bce2ad441 [build] Fix various Jython CI and test issues 2 years ago
dirkf b2ba24bb02 [InfoExtractor] Add `_match_valid_url()` class method and refactor
* API compatible with yt-dlp
* also support Sequence of patterns in _VALID_URL
* one place to compile _VALID_URL
* TODO: remove existing extractor shims
2 years ago
dirkf b08a580906 [workflows/ci.yml] Fix test support for Py 2.6 2 years ago
dirkf 2500300c2a [workflows/ci.yml] Restore test support for Py 3.2 2 years ago
dirkf bafb6dec72 [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()
3 years ago
Edward Betts efc589b865
[devscripts/make_lazy_extractors] Correct a spelling mistake (#26991) 5 years ago
Sergey M․ 19f3821821
[devscripts/make_lazy_extractors] Fix making lazy extractors on python 3 under Windows 9 years ago
Yen Chi Hsuan 582be35847
Update coding style after pycodestyle 2.1.0
In pycodestyle 2.1.0, E305 was introduced, which requires two blank
lines after top level declarations, too.

See https://github.com/PyCQA/pycodestyle/issues/400

See also #10689; thanks @stepshal for first mentioning this issue and
initial patches
9 years ago
Jaime Marquínez Ferrándiz 169d836feb lazy-extractors: Fix after commit 6e6b9f600f
The problem was in the following code:

    class ArteTVPlus7IE(ArteTVBaseIE):

        ...

        @classmethod
        def suitable(cls, url):
            return False if ArteTVPlaylistIE.suitable(url) else super(ArteTVPlus7IE, cls).suitable(url)

And its sublcasses like ArteTVCinemaIE.

Since in the lazy_extractors.py file ArteTVCinemaIE was not a subclass of ArteTVPlus7IE, super(ArteTVPlus7IE, cls) failed.

To fix it we have to make it a subclass. Since the order of _ALL_CLASSES is arbitrary we must sort them so that the base classes are defined first. We also must add base classes like YoutubeBaseInfoExtractor.
10 years ago
Jaime Marquínez Ferrándiz 6b97ca96fc lazy extractors: Style fixes
* Sort extractors alphabetically
* Add newlines when needed (youtube_dl/extractors/lazy_extractors.py pass the flake8 test now)
10 years ago
Jaime Marquínez Ferrándiz c1ce6acdd7 lazy extractors: Fix building with python2.6 10 years ago
Jaime Marquínez Ferrándiz 779822d945 Add experimental support for lazy loading the info extractors
'make lazy-extractors' creates the youtube_dl/extractor/lazy_extractors.py (imported by youtube_dl/extractor/__init__.py), which contains simplified classes that only have the 'suitable' class method and that load the appropiate class with the '__new__' method when a instance is created.
10 years ago