Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[XHamster] Overhaul existing extractors and add playlist extractors #32579

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
6 changes: 5 additions & 1 deletion test/test_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
ExtractorError,
error_to_compat_str,
format_bytes,
traverse_obj,
UnavailableVideoError,
)
from youtube_dl.extractor import get_info_extractor
Expand Down Expand Up @@ -122,7 +123,10 @@ def print_skipping(reason):
params['outtmpl'] = tname + '_' + params['outtmpl']
if is_playlist and 'playlist' not in test_case:
params.setdefault('extract_flat', 'in_playlist')
params.setdefault('playlistend', test_case.get('playlist_mincount'))
# only process enough items for specified tests
pl_counts = traverse_obj(test_case, (None, ('playlist_count', 'playlist_mincount', 'playlist_maxcount')))
if pl_counts:
params.setdefault('playlistend', max(pl_counts) + 1)
params.setdefault('skip_download', True)

ydl = YoutubeDL(params, auto_init=False)
Expand Down
5 changes: 5 additions & 0 deletions youtube_dl/extractor/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1602,6 +1602,11 @@
from .xhamster import (
XHamsterIE,
XHamsterEmbedIE,
XHamsterCategoryIE,
XHamsterChannelIE,
XHamsterCreatorIE,
XHamsterSearchIE,
XHamsterSearchKeyIE,
XHamsterUserIE,
)
from .xiami import (
Expand Down
Loading