mirror of https://github.com/yt-dlp/yt-dlp
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
2.0 KiB
Python
60 lines
2.0 KiB
Python
9 years ago
|
# coding: utf-8
|
||
11 years ago
|
from __future__ import unicode_literals
|
||
|
|
||
|
from .common import InfoExtractor
|
||
|
from ..utils import (
|
||
8 years ago
|
smuggle_url,
|
||
11 years ago
|
)
|
||
|
|
||
|
|
||
|
class LA7IE(InfoExtractor):
|
||
9 years ago
|
IE_NAME = 'la7.it'
|
||
|
_VALID_URL = r'''(?x)(https?://)?(?:
|
||
|
(?:www\.)?la7\.it/([^/]+)/(?:rivedila7|video)/|
|
||
|
tg\.la7\.it/repliche-tgla7\?id=
|
||
|
)(?P<id>.+)'''
|
||
|
|
||
|
_TESTS = [{
|
||
|
# 'src' is a plain URL
|
||
|
'url': 'http://www.la7.it/crozza/video/inccool8-02-10-2015-163722',
|
||
8 years ago
|
'md5': '8b613ffc0c4bf9b9e377169fc19c214c',
|
||
9 years ago
|
'info_dict': {
|
||
5 years ago
|
'id': '0_42j6wd36',
|
||
9 years ago
|
'ext': 'mp4',
|
||
|
'title': 'Inc.Cool8',
|
||
5 years ago
|
'description': 'Benvenuti nell\'incredibile mondo della INC. COOL. 8. dove “INC.” sta per “Incorporated” “COOL” sta per “fashion” ed Eight sta per il gesto atletico',
|
||
9 years ago
|
'thumbnail': 're:^https?://.*',
|
||
8 years ago
|
'uploader_id': 'kdla7pillole@iltrovatore.it',
|
||
|
'timestamp': 1443814869,
|
||
|
'upload_date': '20151002',
|
||
9 years ago
|
},
|
||
|
}, {
|
||
|
'url': 'http://www.la7.it/omnibus/rivedila7/omnibus-news-02-07-2016-189077',
|
||
|
'only_matching': True,
|
||
|
}]
|
||
11 years ago
|
|
||
|
def _real_extract(self, url):
|
||
10 years ago
|
video_id = self._match_id(url)
|
||
9 years ago
|
|
||
4 years ago
|
if not url.startswith('http'):
|
||
|
url = '%s//%s' % (self.http_scheme(), url)
|
||
|
|
||
9 years ago
|
webpage = self._download_webpage(url, video_id)
|
||
|
|
||
5 years ago
|
player_data = self._search_regex(
|
||
|
[r'(?s)videoParams\s*=\s*({.+?});', r'videoLa7\(({[^;]+})\);'],
|
||
|
webpage, 'player data')
|
||
|
vid = self._search_regex(r'vid\s*:\s*"(.+?)",', player_data, 'vid')
|
||
9 years ago
|
|
||
11 years ago
|
return {
|
||
8 years ago
|
'_type': 'url_transparent',
|
||
5 years ago
|
'url': smuggle_url('kaltura:103:%s' % vid, {
|
||
5 years ago
|
'service_url': 'http://nkdam.iltrovatore.it',
|
||
8 years ago
|
}),
|
||
11 years ago
|
'id': video_id,
|
||
5 years ago
|
'title': self._og_search_title(webpage, default=None),
|
||
9 years ago
|
'description': self._og_search_description(webpage, default=None),
|
||
5 years ago
|
'thumbnail': self._og_search_thumbnail(webpage, default=None),
|
||
8 years ago
|
'ie_key': 'Kaltura',
|
||
11 years ago
|
}
|