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 CCMA extractor #24157

Closed
wants to merge 4 commits into from
Closed

Fix CCMA extractor #24157

wants to merge 4 commits into from

Conversation

guillemglez
Copy link

@guillemglez guillemglez commented Feb 27, 2020

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
  • 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

Fixing two bugs present in CCMA extractor.

  1. Incorrect timestamp:

For some reason, provided UTC timestamp does not comply ISO8601, as its format is YYYY-DD-MM instead of expected YYYY-MM-DD.

This is made evident in the also provided "text" field of emission date object. Example:

    "data_emissio": {
                "text": "14/05/2002�21:39",
                "utc": "2002-14-05T21:39:28+0200"
    }
  1. Multiple subtitles support ([CCMA] Videos with several subtitles won't download #24347)

The extractor used to raise an exception when attempting the download of a URL featuring multiple subtitle languages.

Behavior of the subtitols field is:

  • When a single language is available, the field is the expected dict.

  • When multiple languages are available, a list of dict is provided.

A test is added with an URL featuring multiple subtitles, to ensure no exception is raised during extraction.

For some reason, provided UTC timestamp does not comply ISO8601, as its
format is YYYY-DD-MM instead of expected YYYY-MM-DD.

This can be checked with the also provided "text" field of
emission date object. Example:
"data_emissio": {
            "text": "14/05/2002�21:39",
            "utc": "2002-14-05T21:39:28+0200"
}

This commit fixes this behavior.
Added test is one of the cases of broken compatibility.
Issue is in featuring multiple languages in the subtitles field.
CCMA extractor used to raise an exception when attempting the download of
a URL featuring multiple languages in the subtitles.

When a single language is available, the field is the expected dict.
When multiple languages are available, a list of dicts is provided.

This commit fixes this issue.
@felisucoibi
Copy link

please merge

@guillemglez
Copy link
Author

please merge

True, it's been more than one month this has been here. Same for #24347. Is anything in particular missing/blocking it from being merged, @dstftw ?

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.

2 participants