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

[utils,ie] Misc yt-dlp back-ports, etc #32799

Merged
merged 5 commits into from
May 30, 2024
Merged

[utils,ie] Misc yt-dlp back-ports, etc #32799

merged 5 commits into from
May 30, 2024

Conversation

dirkf
Copy link
Contributor

@dirkf dirkf commented May 29, 2024

Own/yt-dlp code, Improvement

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])
  • Use Preview tab to see how your pull request will actually look like

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:

  • I am the original author of this code and I am willing to release it under Unlicense, except for code from yt-dlp for which this or the below was already asserted.
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

Description of your pull request and other information

The main object of this PR is to bring traverse_obj() to par with recent changes in yt-dlp (thx Grub4k for these):

To make XML traversal work in Py2.6, a new compat_etree_iterfind is added based on CPython 2.7 code.

To match yt-dlp there is a traversal.py (not yet nested) and separate tests for utils and traversal.

Secondly, some small additional back-ports related to the InfoExtractor API have been provided:

  • add _yes_playlist() method
  • avoid crash using _NETRC_MACHINE
  • use _search_json() in _search_nextjs_data()
  • _search_nextjs_data() default is JSON, not text.

dirkf added 5 commits May 29, 2024 03:13
* remove `is_user_input` option per yt-dlp/yt-dlp#8673
* support traversal of compat_xml_etree_ElementTree_Element per yt-dlp/yt-dlp#8911
* allow un/branching using all and any per yt-dlp/yt-dlp#9571
* support traversal of compat_cookies.Morsel and multiple types in `set()` keys per yt-dlp/yt-dlp#9577
thx Grub4k for these
* also, move traversal tests to a separate class
* allow for unordered dicts in tests for Py<3.7
NB This isn't actually a compat fn; it should be utils.int_from_int_or_char
* add _yes_playlist() method
* avoid crash using _NETRC_MACHINE
* use _search_json() in _search_nextjs_data()
* _search_nextjs_data() default is JSON, not text
* test for above
@dirkf dirkf merged commit 2192474 into ytdl-org:master May 30, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant