aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonardo Taccari <iamleot@gmail.com>2017-12-13 12:24:07 +0100
committerSergey M․ <dstftw@gmail.com>2017-12-27 23:27:43 +0700
commit1ae0f0a21dec0cfce85b6f8285cc64cd702846b5 (patch)
tree71abbd6ffcdd88951aae4884efef1a33dde04cde
parent616bb95b280e74b1a5048e95128259e2a85ca962 (diff)
downloadyoutube-dl-1ae0f0a21dec0cfce85b6f8285cc64cd702846b5.zip
youtube-dl-1ae0f0a21dec0cfce85b6f8285cc64cd702846b5.tar.gz
youtube-dl-1ae0f0a21dec0cfce85b6f8285cc64cd702846b5.tar.bz2
[internazionale] Add extractor
-rw-r--r--youtube_dl/extractor/extractors.py1
-rw-r--r--youtube_dl/extractor/internazionale.py46
2 files changed, 47 insertions, 0 deletions
diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py
index 04125d9..e7b93a6 100644
--- a/youtube_dl/extractor/extractors.py
+++ b/youtube_dl/extractor/extractors.py
@@ -466,6 +466,7 @@ from .indavideo import (
)
from .infoq import InfoQIE
from .instagram import InstagramIE, InstagramUserIE
+from .internazionale import InternazionaleIE
from .internetvideoarchive import InternetVideoArchiveIE
from .iprima import IPrimaIE
from .iqiyi import IqiyiIE
diff --git a/youtube_dl/extractor/internazionale.py b/youtube_dl/extractor/internazionale.py
new file mode 100644
index 0000000..2ebf05d
--- /dev/null
+++ b/youtube_dl/extractor/internazionale.py
@@ -0,0 +1,46 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class InternazionaleIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?internazionale\.it/video/(?P<id>.*)'
+ _TESTS = [{
+ 'url': 'https://www.internazionale.it/video/2015/02/19/richard-linklater-racconta-una-scena-di-boyhood',
+ 'md5': '11b54a3d3333e455c00684e50a65c58e',
+ 'info_dict': {
+ 'id': '265968',
+ 'ext': 'mp4',
+ 'description': 'md5:efb7e5bbfb1a54ae2ed5a4a015f0e665',
+ 'title': 'Richard Linklater racconta una scena di Boyhood',
+ 'thumbnail': r're:^https?://.*\.jpg$',
+ }
+ }]
+
+ def _real_extract(self, url):
+ video_id = self._match_id(url)
+ webpage = self._download_webpage(url, video_id)
+
+ data_job_id = self._html_search_regex(r'data-job-id="([^"]+)"', webpage, 'data-job-id')
+ data_video_path = self._html_search_regex(r'data-video-path="([^"]+)"', webpage, 'data-video-path')
+
+ formats = []
+
+ formats.extend(self._extract_m3u8_formats(
+ 'https://video.internazionale.it/%s/%s.m3u8' % (data_video_path, data_job_id),
+ video_id))
+
+ formats.extend(self._extract_mpd_formats(
+ 'https://video.internazionale.it/%s/%s.mpd' % (data_video_path, data_job_id),
+ video_id))
+
+ self._sort_formats(formats)
+
+ return {
+ 'id': data_job_id,
+ 'title': self._og_search_title(webpage),
+ 'thumbnail': self._og_search_thumbnail(webpage),
+ 'description': self._og_search_description(webpage),
+ 'formats': formats,
+ }