Commit Graph

36 Commits (master)

Author SHA1 Message Date
Matthew 8e40b9d1ec
Improve plugin architecture (#5553)
to make plugins easier to develop and use:
* Plugins are now loaded as namespace packages.
* Plugins can be loaded in any distribution of yt-dlp (binary, pip, source, etc.).
* Plugin packages can be installed and managed via pip, or dropped into any of the documented locations.
* Users do not need to edit any code files to install plugins.
* Backwards-compatible with previous plugin architecture.

As a side-effect, yt-dlp will now search in a few more locations for config files.

Closes https://github.com/yt-dlp/yt-dlp/issues/1389

Authored by: flashdagger, coletdjnz, pukkandan, Grub4K
Co-authored-by: Marcel <flashdagger@googlemail.com>
Co-authored-by: pukkandan <pukkandan.ytdlp@gmail.com>
Co-authored-by: Simon Sawicki <accounts@grub4k.xyz>
1 year ago
pukkandan 6368e2e639
[cleanup] Misc
Closes #5541
1 year ago
pukkandan 2fa669f759
[docs] Misc improvements
Closes #4987, Closes #4906, Closes #4919, Closes #4977, Closes #4979
2 years ago
josanabr 46d72cd2c7
[devscripts] make_lazy_extractors: Fix for Docker (#4958)
Authored by: josanabr
2 years ago
pukkandan e5458d1d88
Fix lazy extractor bug in fe7866d0ed
and add test

Fixes https://github.com/yt-dlp/yt-dlp/pull/3234#issuecomment-1225347071
2 years ago
pukkandan 115add4387
[devscripts] Create `utils` and refactor 2 years ago
pukkandan 8f97a15d1c [extractor] Framework for embed detection (#4307) 2 years ago
Chris Lamb 5b836d4739
[build] Consistent order for lazy extractors (#4220)
Authored by: lamby
2 years ago
pukkandan 54007a45f1
[cleanup] Consistent style for file heads 2 years ago
pukkandan 560738f34d
[extractor] Import `_ALL_CLASSES` lazily
This significantly speeds up `import yt_dlp` in the absence of `lazy_extractors`
2 years ago
pukkandan 21633673c3
[cleanup] Minor fixes 2 years ago
pukkandan 2414649192
[cleanup] Misc cleanup 2 years ago
pukkandan 82d020804d
[extractor] Use classmethod/property where possible
and refactor lazy extractors accordingly.

This reduces the need to create extractor instances
2 years ago
pukkandan c171445431
[cleanup,build] Cleanup some build-related code
Fixes an issue in 7ab56be2c7
2 years ago
pukkandan e5a998f368
[cleanup] Misc cleanup (#2173)
Authored by: fstirlitz, pukkandan
2 years ago
pukkandan f82711587c
[cleanup] Sort imports
Using https://github.com/PyCQA/isort

    isort -m VERTICAL_HANGING_INDENT --py 36 -l 80 --rr -n --tc .
2 years ago
pukkandan 86e5f3ed2e
[cleanup] Upgrade syntax
Using https://github.com/asottile/pyupgrade

1. `__future__` imports and `coding: utf-8` were removed
2. Files were rewritten with `pyupgrade --py36-plus --keep-percent-format`
3. f-strings were cherry-picked from `pyupgrade --py36-plus`

Extractors are left untouched (except removing header) to avoid unnecessary merge conflicts
2 years ago
pukkandan 2c4aaaddc9
[lazy_extractors] Fix for search IEs
Closes #1851
2 years ago
pukkandan 49a57e70a9
[cleanup] misc 3 years ago
pukkandan e6f21b3d92
[docs,cleanup] Some minor refactoring and improve docs 3 years ago
pukkandan 8b7491c8d1
Fix `add_info_extractor` when used via API
Bug from: 251ae04e6a
3 years ago
pukkandan 251ae04e6a
[lazy_extractor] Create instance only after pre-checking archive 3 years ago
pukkandan 3fb4e21b38
[lazy_extractors] Fix `suitable` and add flake8 test 3 years ago
pukkandan 5ad28e7ffd
[extractor] Common function `_match_valid_url` 3 years ago
Kid 5c333d7496
[lazy_extractor] Bugfix for when plugin directory doesn't exist (#691)
Bug introduced by: 0b2e9d2c30

Authored by: kidonng
3 years ago
felix cc52de4356
[cleanup] Point all shebang to `python3` (#372)
Authored by: fstirlitz
3 years ago
pukkandan 0b2e9d2c30
[lazy_extractor] Do not load plugins 3 years ago
Pccode66 7a5c1cfe93
Completely change project name to yt-dlp (#85)
* All modules and binary names are changed
* All documentation references changed
* yt-dlp no longer loads youtube-dlc config files
* All URLs changed to point to organization account

Co-authored-by: Pccode66
Co-authored-by: pukkandan
3 years ago
pukkandan 8bdd16b499 Merge 'ytdl-org/youtube-dl/master' release 2020.11.19
Old Extractors left behind:
	VLivePlaylistIE
	YoutubeSearchURLIE
	YoutubeShowIE
	YoutubeFavouritesIE

If removing old extractors, make corresponding changes in
	docs/supportedsites.md
	youtube_dlc/extractor/extractors.py

Not merged:
	.github/ISSUE_TEMPLATE/1_broken_site.md
	.github/ISSUE_TEMPLATE/2_site_support_request.md
	.github/ISSUE_TEMPLATE/3_site_feature_request.md
	.github/ISSUE_TEMPLATE/4_bug_report.md
	.github/ISSUE_TEMPLATE/5_feature_request.md
	test/test_all_urls.py
	youtube_dlc/version.py
	Changelog
4 years ago
Unknown cefecac12c [skip travis] renaming
to avoid using same folder when using pip install for example
4 years ago
Sergey M․ 19f3821821
[devscripts/make_lazy_extractors] Fix making lazy extractors on python 3 under Windows 7 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
8 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.
8 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)
8 years ago
Jaime Marquínez Ferrándiz c1ce6acdd7 lazy extractors: Fix building with python2.6 8 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.
8 years ago