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

[XFileShare] Update for 2024 with new InfoExtractor features #32725

Merged
merged 4 commits into from Mar 8, 2024

Conversation

dirkf
Copy link
Contributor

@dirkf dirkf commented Feb 21, 2024

Boilerplate: improvement/own code

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 fragments from yt-dlp where this or the below have already been 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

This PR updates the XFileShare extractor module in three steps:

  1. adds a _search_json() method to InfoExtractor matching the yt-dlp method; it uses the error diagnostic to truncate extra text from the JSON string, which might be confused by a Python json library implementation that uses a different diagnostic template;

  2. updates the common JWPlayer extraction to use traverse_obj() and _search_json(), to support extracting playlists in a .load({**video1},{**video2}, ...) fragment, and to support a transform_source parameter in _extract_jwplayer_data();

  3. updates the XFileShareIE extractor to make use of these features.

As a result, filemoon.sx can be supported as one of the known sites and its separate extractor is removed: resolves #32716.

Supersedes, closes #32452.

youtube_dl/extractor/common.py Outdated Show resolved Hide resolved
youtube_dl/extractor/common.py Outdated Show resolved Hide resolved
* uses the error diagnostic to truncate the JSON string
* may be confused by non-C-Pythons
* use traverse_obj() and _search_json()
* support playlist `.load({**video1},{**video2}, ...)`
* support transform_source=... for _extract_jwplayer_data()
* simplify aa_decode()
* review and update supported sites and tests
* in above, include FileMoon.sx, and remove separate module
* incorporate changes from yt-dlp
* allow for decoding multiple scripts (eg, FileMoon)
* use new JWPlayer extraction
@dirkf dirkf merged commit f7b30e3 into ytdl-org:master Mar 8, 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.

filemoon.sx jwplayer error
1 participant