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

[internazionale] Add new extractor for www.internazionale.it #14973

Closed
wants to merge 2 commits into from
Closed

[internazionale] Add new extractor for www.internazionale.it #14973

wants to merge 2 commits into from

Conversation

iamleot
Copy link
Contributor

@iamleot iamleot commented Dec 13, 2017

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])
  • Use Preview tab to see how your pull request will actually look like

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

Add a new extractor for internazionale.it.
This was implemented analyzing the web browser requests via
mitmproxy and manually inspecting part of the
JavaScript code served.

'url': 'https://video.internazionale.it/%s/%s.m3u8'
% (video_path, id),
'ext': 'mp4',
'protocol': 'm3u8',
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. _extract_m3u8_formats.
  2. At least mpd is also available.


video_container = self._html_search_regex(r'<div class="video-container" (.*)>', webpage, 'video_container')

id = self._html_search_regex(r'data-job-id="([^"]+)"', video_container, 'id')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do not shadow built-in names.

video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)

video_container = self._html_search_regex(r'<div class="video-container" (.*)>', webpage, 'video_container')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Capturing empty string does not make any sense. What's the point capturing this at all? id and path occur only once in webpage.

'info_dict': {
'id': '265968',
'ext': 'mp4',
'description': 'Il regista statunitense Richard Linklater ci racconta una scena del film Boyhood e la sua passione per l’imprecisione della memoria. Il film è un’avventura durata 12 anni, durante la quale Linklater ha seguito il protagonista dal 2002 al 2014 per raccontare la sua crescita e il rapporto con i genitori divorziati. Leggi',
Copy link
Collaborator

Choose a reason for hiding this comment

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

md5:.

'description': 'Tre ragazzi raccontano quanto è difficile essere italiani di fatto ma non di diritto: una vita fatta di burocrazia, opportunità negate e grandi contraddizioni. Leggi',
'title': 'Storie di italiani senza cittadinanza',
'thumbnail': r're:^https?://.*\.jpg$',
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove duplicates.

- Use `md5:...' instead of provide a long description in info_dict and
  only keep one test.
- Directly search for `data-job-id' and `data-video-path' attributes.
- Extract m3u8 and mpd via _extract_m3u8_formats() and _extract_mpd_formats()

TODO: Figure out why `python test/test_download.py TestDownload.test_Internazionale`
TODO: with a DownloadError and `ERROR: requested format not available'.

TODO: For m3u8 `youtube_dl -F' on a Internazionale URL indicate as extension
TODO: `m3u8' instead of mp4, is this correct?
@iamleot
Copy link
Contributor Author

iamleot commented Dec 18, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants