-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
[ie/arte.tv] Extract accessible subtitles #8231
Merged
seproDev
merged 3 commits into
yt-dlp:master
from
Nicals:handle_arte_tv_accessible_subtitles
Jan 18, 2024
Merged
[ie/arte.tv] Extract accessible subtitles #8231
seproDev
merged 3 commits into
yt-dlp:master
from
Nicals:handle_arte_tv_accessible_subtitles
Jan 18, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You should be able to use this as a unit test: {
'url': 'https://www.arte.tv/fr/videos/104913-001-A/sous-controle-1-6/',
'info_dict': {
'id': '104913-001-A',
'ext': 'mp4',
'description': 'md5:ea65e21c4b9881b3ef1c333a914779da',
'thumbnail': 'https://api-cdn.arte.tv/img/v2/image/BL5WhDp2pnXcYhQJz9A8be/940x530',
'upload_date': '20230927',
'timestamp': 1695783600,
'duration': 1907,
'title': 'Sous contrôle (1/6)',
'subtitles': {
'fr': 'mincount:1',
'fr-acc': 'mincount:1',
},
},
} |
47d2800
to
b47f4a8
Compare
seproDev
requested changes
Nov 30, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned before, you can directly test for available subtitle languages in the _TESTS
list.
Also, please don't force push. All commits will be squashed upon merge.
Grub4K
reviewed
Nov 30, 2023
seproDev
approved these changes
Jan 14, 2024
bashonly
approved these changes
Jan 18, 2024
aalsuwaidi
pushed a commit
to aalsuwaidi/yt-dlp
that referenced
this pull request
Apr 21, 2024
Authored by: Nicals, seproDev Co-authored-by: sepro <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
IMPORTANT: PRs without the template will be CLOSED
Description of your pull request and other information
The arte.tv website can propose multiple subtitles for the same language. Some normal subtitles and some accessible subtitles for people suffering from hearing loss.
For example, on this video, we have two sets of french subtitles: subforced and accessible ones.
When listing the subtitles, we got the following list:
This PR identifies those accessible subtitles and adds and -acc suffix to the language code.
Implementation details:
I'm not familiar with this code base.
I tried to add a test in the
ArteTVIE._TESTS
, but it seems that the test runner doesn't allow to access subtitles info (ignored here).So I've added a new test case for this extractor. Since its the first test done this way, I'm not sure this is something we want for yt_dlp.
If you have any other idea to implement this test, I would be happy to implement it.
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:
What is the purpose of your pull request?
Copilot Summary
🤖 Generated by Copilot at 47d2800
Summary
🎥🧪🔄
Add support for accessible subtitles in Arte videos and a test module for it. Modify
yt_dlp/extractor/arte.py
to identify and convert the accessible subtitle formats and return them with modified language codes. Addtest/extractor/test_arte.py
to test the new feature withpytest
.Walkthrough
ArteTVIE
extractor class inyt_dlp/extractor/arte.py
to check for subtitle formats with the suffix-MAL.m3u8
and append a-acc
suffix to the language code (link, link)_contvert_accessible_subs_locale
method in the_real_extract
method to convert the subtitles before returning them (link)test/extractor/test_arte.py
to test the new feature (link)test_extract_accessible_subtitles
that uses thepytest
framework and theparametrize
decorator to test two examples of accessible subtitles (link)ArteTVIE
extractor class and call its_contvert_accessible_subs_locale
method on theoriginal_subs
parameter (link)expected_locale
parameter, and that the value of that key is the same as the original subtitles for the French language (link)