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

Update regex for extractor in CrtvgIE extractor #9404

Merged
merged 5 commits into from Mar 9, 2024

Conversation

Xpl0itU
Copy link
Contributor

@Xpl0itU Xpl0itU commented Mar 9, 2024

Description of your pull request and other information

This fixes an issue with url formats being different

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?

This fixes an issue with url formats being different
@bashonly
Copy link
Member

bashonly commented Mar 9, 2024

Please share an example URL of the new format, and add it as a test

We need to try to keep the video IDs the same as they were before for --download-archive compat

@Xpl0itU
Copy link
Contributor Author

Xpl0itU commented Mar 9, 2024

We need to try to keep the video IDs the same as they were before for --download-archive compat

This is the new URL format: https://www.crtvg.es/tvg/a-carta/a-parabolica-love-story

It's impossible to keep the old video IDs since the new/alternative format doesn't specify the video ID in either the URL or the page contents

@bashonly
Copy link
Member

bashonly commented Mar 9, 2024

add it as a test

@bashonly
Copy link
Member

bashonly commented Mar 9, 2024

and we could do this

+        if mobj := re.fullmatch(r'[^/#?]+-(?P<old_id>\d{7})', video_id):
+            old_video_id = [make_archive_id(self, mobj.group('old_id'))]
+        else:
+            old_video_id = None

         return {
             'id': video_id,
+            '_old_archive_ids': old_video_id,

@bashonly bashonly added site-bug Issue with a specific website pending-fixes PR has had changes requested labels Mar 9, 2024
@bashonly bashonly removed the pending-fixes PR has had changes requested label Mar 9, 2024
@bashonly bashonly merged commit 785ab1a into yt-dlp:master Mar 9, 2024
6 checks passed
@Xpl0itU Xpl0itU deleted the patch-1 branch March 10, 2024 10:23
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.

None yet

2 participants