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

[Mediaklikk] Fix extractor (fixes #8053) #8086

Merged
merged 1 commit into from Sep 16, 2023

Conversation

zhallgato
Copy link
Contributor

@zhallgato zhallgato commented Sep 11, 2023

IMPORTANT: PRs without the template will be CLOSED

Description of your pull request and other information

Mediaklikk modified its site structure and the extractor broke. bashonly fixed the extractor. I only tested it and updated the included tests.

Old tests:

  1. Dead URL, opens a 404 page. Fixed with a newer video
  2. Dead URL, opens a 404 page. Fixed with a newer video
  3. Live URL. Fixed with extra info
  4. Dead URL, opens the video list page. Fixed with a newer video
  5. Dead URL, opens an empty page. Fixed with a newer video

Fixes #8053

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 (I only fixed the tests, the original code fix was published by bashonly under the issue in a comment)

What is the purpose of your pull request?

Copilot Summary

🤖 Generated by Copilot at a953c5a

Summary

🛠️📺🆔

Improved extraction for MediaKlikk videos. The extractor now uses a better way to find the playlist url, updates the tests with fresh data, and adds a new field for the video identifier.

The MediaKlikkIE extractor
Was not very good at its factor
So it got a new way
To find the playlist url
And also a nice display_id actor

Walkthrough

  • Add display_id field to info_dict of test cases and derive it from url path (link, link)
  • Update test cases with new urls, ids, upload_dates and thumbnails that match current website layout and content (link)
  • Extract playlist url from player json using traverse_obj and url_or_none instead of regex and raise error if invalid (link, link)

@bashonly
Copy link
Member

Old tests:

  1. Dead URL, opens a 404 page. Fixed with a newer video
  2. Dead URL, opens a 404 page. Fixed with a newer video
  3. Live URL. Fixed with extra info
  4. Dead URL, opens the video list page. Fixed with a newer video
  5. Dead URL, opens an empty page. Fixed with a newer video

Good job finding some new tests.

However, the old tests have some URL formats that we still want to test for matching.

Instead of replacing the dead tests, we should add skip keys to the dead tests, and add the new tests below them. The value for the skip key should be the reason why we are skipping, e.g.

    }, {
         'url': 'https://...',
         'info_dict': {
             'id': '...',
         },
+        'skip': 'Webpage redirects to videos list',
    }, {

@bashonly bashonly added site-bug Issue with a specific website pending-review PR needs a review pending-fixes PR has had changes requested and removed pending-review PR needs a review labels Sep 12, 2023
@zhallgato
Copy link
Contributor Author

Thanks for the info regarding the old tests. I readded them.

@bashonly bashonly added pending-review PR needs a review and removed pending-fixes PR has had changes requested labels Sep 12, 2023
@coletdjnz coletdjnz removed the pending-review PR needs a review label Sep 16, 2023
Copy link
Member

@coletdjnz coletdjnz left a comment

Choose a reason for hiding this comment

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

LGTM

@coletdjnz coletdjnz merged commit 6e07e4b into yt-dlp:master Sep 16, 2023
13 checks passed
aalsuwaidi pushed a commit to aalsuwaidi/yt-dlp that referenced this pull request Apr 21, 2024
Fixes yt-dlp#8053

Authored by: bashonly, zhallgato
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.

Mediaklikk
3 participants