-
Notifications
You must be signed in to change notification settings - Fork 10k
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
[GlobalPlayer,Whyp,DLF, Clipchamp] Add new extractors back-ported from yt-dlp #32138
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dirkf
changed the title
Df extractor miscbp 202305
[GlobalPlayer,Whyp,DLF] Add new extractors back-ported from yt-dlp
May 3, 2023
pukkandan
reviewed
May 3, 2023
dirkf
changed the title
[GlobalPlayer,Whyp,DLF] Add new extractors back-ported from yt-dlp
[GlobalPlayer,Whyp,DLF, Clipchamp] Add new extractors back-ported from yt-dlp
May 3, 2023
This comment was marked as resolved.
This comment was marked as resolved.
21 tasks
dirkf
commented
Jul 18, 2023
dirkf
commented
Jul 18, 2023
dirkf
commented
Jul 18, 2023
dirkf
commented
Jul 18, 2023
Thanks Grub4k for these: * traverse `Iterable`s, from yt-dlp/yt-dlp#6902, etc * traverse `set` key for transformations/filters, `re.Match` group names, from yt-dlp/yt-dlp@776995b, etc * traverse `re.Match`es, from yt-dlp/yt-dlp#5174 * always return list when branching, from yt-dlp/yt-dlp#5170
* support variable substitution, from https://github.com/yt-dlp/yt-dlp/pull/#521 etc, thanks ChillingPepper, Grub4k, pukkandan * improve escape handling, from https://github.com/yt-dlp/yt-dlp/pull/#521 thanks Grub4k * support template strings from yt-dlp/yt-dlp#6623 thanks Grub4k * add limited `!` evaluation (eg, !!0 -> false, see tests)
dirkf
force-pushed
the
df-extractor-miscbp-202305
branch
4 times, most recently
from
July 19, 2023 17:25
e3635f1
to
c08f740
Compare
A couple of mods to ease yt-dlp back-ports: * add kwargs to merge_dicts: `unblank=True` (disallow empty string), `rev=False` (reverse the merge list) * add `T(x)` shortcut for `{x}`, unsupported in Py2.6
* from yt-dlp/yt-dlp#6903, thanks garret1317
* from yt-dlp/yt-dlp#6803, thanks CoryTibbettsDev
* from yt-dlp/yt-dlp#6697, thanks nick-cd
* add _search_nextjs_data(), from yt-dlp/yt-dlp#1386 thanks selfisekai * add _search_nuxt_data(), from yt-dlp/yt-dlp#1921, thanks Lesmiscore, pukkandan * add tests for the above * also fix HTML5 type recognition and tests, from yt-dlp/yt-dlp@222a230, thanks Lesmiscore * update extractors in PR using above, fix tests.
* inspect.getargspec is missing despite doc claiming backward compat * replace with emulation of `Signature.bind()`
* API compatible with yt-dlp * also support Sequence of patterns in _VALID_URL * one place to compile _VALID_URL * TODO: remove existing extractor shims
dirkf
force-pushed
the
df-extractor-miscbp-202305
branch
from
July 19, 2023 17:42
c08f740
to
4dae5c2
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Boilerplate: yt-dlp code, new extractor+improvement
## Please follow the guide belowx
into all the boxes [ ] relevant to your pull request (like that [x])Before submitting a pull request make sure you have:
In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:
What is the purpose of your pull request?
Description of your pull request and other information
This PR adds four new extractors back-ported from yt-dlp, together with some core improvements to support them.
Supporting improvements:
traverse_obj()
to support traversal ofIterable
s,set
s andre.Match
es (akacompat_re_Match
): thanks @Grub4K; add convenience functionT()
as a (slight) abbreviation ofset((x,))
since literal set{x}
isn't in Py2.6js_to_json()
: thanks @ChillingPepper, @Grub4K, @pukkandan; add limited support for!
evaluation (eg,!!0
->false
)group
argument of InfoExtractor._search_regex()`, etcmerge_dicts()
:unblank=True
to disallow empty string,rev=False
to reverse the order ofmerge_dict
'sargs
list;rev=True
matches{**dict1, **dict2, ...}
(not in Py 2)InfoExtractor
with tests_search_nextjs_data()
, from haruhi-dl backporting, batch 1 yt-dlp/yt-dlp#1386thanks @selfisekai
_search_nuxt_data()
, from [extractor/common] introduce_search_nuxt_data
yt-dlp/yt-dlp#1921,thanks @Lesmiscore, @pukkandan
_match_valid_url()
class method toInfoExtractor
and refactorAn immediate compat fix to
traverse_obj()
is also included: fixes #32456.