-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
[utils] Backport traverse_obj (etc) from yt-dlp #31156
Conversation
Please use my full port in PR #30713 as a basis. Feel free to define The The
As you've done, Finally, any Even more finally, should we ask @pukkandan to write tests for it? The code in PR #30713 was correct enough for that extractor, but as was commented extractors only use a subset of |
294c58a
to
ba7d540
Compare
@dirkf Thank you, done. I looked at your commit, ported some features which improve readability, like I would suggest to merge this PR as is, without extensive test coverage, as it will be useful to port Panopto sooner, and it does not break any existing code. Tests can be added later in a separate pull request. |
I honestly don't have too much incentive to write tests for it. Because of yt-dlp's extensive use of |
Complete rewrite and tests: yt-dlp/yt-dlp#5024 |
Good news: there are tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recast with yt-dlp's new traverse_obj() implementation and tests.
* https://github.com/ytdl-org/youtube-dl: [utils] Backport traverse_obj (etc) from yt-dlp (ytdl-org#31156)
* commit 'de39d1281cea499cb1adfce5ff7e0a56f1bad5fe': [extractor/ceskatelevize] Back-port extractor from yt-dlp, etc (ytdl-org#30713) [utils] Backport traverse_obj (etc) from yt-dlp (ytdl-org#31156) [compat] Work around in case folding for narrow Python build [compat] Add test for compat_casefold() [compat] Add test for compat_casefold() [compat] Reformat casefold.py for easier updating [compat] Unify unicode/str compat and move up [compat] Add compat_casefold and compat_re_Match, for traverse_obj() port [compat] Add Python 2 Unicode casefold using a trivial wrapper around icu/CaseFolding.txt [netease] Support urls shared from mobile app (ytdl-org#31304) [netease] Impove error handling (ytdl-org#31303) [Vimeo] Update variable name in hydration JSON pattern # Conflicts: # youtube_dl/extractor/ceskatelevize.py
* Backport traverse_obj and closely related function from yt-dlp (code by pukkandan) * Backport LazyList, variadic(), try_call (code by pukkandan) * Recast using yt-dlp's newer traverse_obj() implementation and tests (code by grub4k) * Add tests for Unicode case folding support matching Py3.5+ (requires f102e3d) * Improve/add tests for variadic, try_call, join_nonempty Co-authored-by: dirkf <fieldhouse@gmx.net>
Please follow the guide below
x
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
Backport
traverse_obj
from yt-dlp required for #31097.Thanks @pukkandan (orignal code), @Grub4K (rewrite & tests).