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

fix(wat.tv): remove MYTF1 context to remove "Permission insuffisante" error #7898

Merged
merged 3 commits into from
Aug 20, 2023

Conversation

davinkevin
Copy link
Contributor

@davinkevin davinkevin commented Aug 18, 2023

Description of your pull request and other information

Modification in the wat.py extractor to be compatible with changes applied by the platform. See issue #7303 for more detail. I've just applied modification tested in this issue and locally.

Fixes #7303

Template

Before submitting a pull request make sure you have:

In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check all of the following options that apply:

  • I am the original author of this code and I am willing to release it under Unlicense
  • 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?

Copilot Summary

🤖 Generated by Copilot at 5106412

Summary

🛠️🔄❌

Fix wat.tv extraction by updating URL parameters in yt_dlp/extractor/wat.py

wat.tv changed API
pver updated, context dropped
video extraction fixed

Walkthrough

  • Remove context and update pver in JSON URL to fix video extraction from wat.tv (link)

@bashonly
Copy link
Member

bashonly commented Aug 18, 2023

Add a test, unless the first test is still non-DRM and working (and if so, check if it needs to be updated)

@bashonly bashonly added the site-bug Issue with a specific website label Aug 18, 2023
@davinkevin
Copy link
Contributor Author

Add a test, unless the first test is still non-DRM and working (and if so, check if it needs to be updated)

All links are very old (~10 years old) and not working anymore… for a long time.
I can "try" to add test, but I'm out of my expertise area, so it will be way more complicated than this 8 keys modification.

Do you have a simple command to run test just for this extractor?

@bashonly
Copy link
Member

Do you have a simple command to run test just for this extractor?

to run the 1st extractor test:

python3 test/test_download.py TestDownload.test_Wat

2nd and 3rd and so forth:

python3 test/test_download.py TestDownload.test_Wat_1
python3 test/test_download.py TestDownload.test_Wat_2

or run them all

python3 test/test_download.py TestDownload.test_Wat_all

I can "try" to add test, but I'm out of my expertise area, so it will be way more complicated than this 8 keys modification.

Add a dict to the _TESTS list, start simply like:

    {
        'url': 'https://www.tf1.fr/tmc/quotidien-avec-yann-barthes/videos/selah-sue-when-it-all-falls-down-en-live-pour-quotidien-67219751.html',
        'info_dict': {
            'id': '67219751',
            'ext': 'mp4',
        },
    }

Then run the test. It will fail and output the fields that are missing or incorrect. Copy those into your test dict, and run again. Repeat until the test passes.

@davinkevin
Copy link
Contributor Author

New test added 👍

@bashonly bashonly added the pending-review PR needs a review label Aug 20, 2023
Copy link
Member

@bashonly bashonly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to do a little fixup on the tests; I had given some bad instruction about adding a TF1 test to the Wat extractor. In the future, please don't force push. You can push as many commits as you want to your PRs. Thanks for adding the test!

@davinkevin
Copy link
Contributor Author

I've modified the test to be on wat when I've seen the format and behaviour was not correct.
And sorry, I forced push to keep only 1 commit (I really don't like "fix…" commit in the history), and because it's my own branch, I just --amend it over.

@bashonly
Copy link
Member

And sorry, I forced push to keep only 1 commit (I really don't like "fix…" commit in the history), and because it's my own branch, I just --amend it over.

What I'm saying is: don't do this. It makes it difficult to review the PR.

@davinkevin
Copy link
Contributor Author

Ok, noted for future PR here 👍

yt_dlp/extractor/wat.py Outdated Show resolved Hide resolved
@bashonly bashonly removed the pending-review PR needs a review label Aug 20, 2023
@bashonly bashonly merged commit 7cccab7 into yt-dlp:master Aug 20, 2023
13 checks passed
@davinkevin
Copy link
Contributor Author

Thanks and sorry for the commit conflicts! 😇

aalsuwaidi pushed a commit to aalsuwaidi/yt-dlp that referenced this pull request Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site-bug Issue with a specific website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TF1] [wat.tv]: Permission insuffisante
2 participants