mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-10-30 22:52:40 +00:00
parent
7aad06541e
commit
785ab1af7f
1 changed files with 22 additions and 3 deletions
|
@ -1,18 +1,32 @@
|
||||||
|
import re
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import remove_end
|
from ..utils import make_archive_id, remove_end
|
||||||
|
|
||||||
|
|
||||||
class CrtvgIE(InfoExtractor):
|
class CrtvgIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?crtvg\.es/tvg/a-carta/[^/#?]+-(?P<id>\d+)'
|
_VALID_URL = r'https?://(?:www\.)?crtvg\.es/tvg/a-carta/(?P<id>[^/#?]+)'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'https://www.crtvg.es/tvg/a-carta/os-caimans-do-tea-5839623',
|
'url': 'https://www.crtvg.es/tvg/a-carta/os-caimans-do-tea-5839623',
|
||||||
'md5': 'c0958d9ff90e4503a75544358758921d',
|
'md5': 'c0958d9ff90e4503a75544358758921d',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '5839623',
|
'id': 'os-caimans-do-tea-5839623',
|
||||||
'title': 'Os caimáns do Tea',
|
'title': 'Os caimáns do Tea',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'description': 'md5:f71cfba21ae564f0a6f415b31de1f842',
|
'description': 'md5:f71cfba21ae564f0a6f415b31de1f842',
|
||||||
'thumbnail': r're:^https?://.*\.(?:jpg|png)',
|
'thumbnail': r're:^https?://.*\.(?:jpg|png)',
|
||||||
|
'_old_archive_ids': ['crtvg 5839623'],
|
||||||
|
},
|
||||||
|
'params': {'skip_download': 'm3u8'}
|
||||||
|
}, {
|
||||||
|
'url': 'https://www.crtvg.es/tvg/a-carta/a-parabolica-love-story',
|
||||||
|
'md5': '9a47b95a1749db7b7eb3214904624584',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'a-parabolica-love-story',
|
||||||
|
'title': 'A parabólica / Trabuco, o can mordedor / Love Story',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'description': 'md5:f71cfba21ae564f0a6f415b31de1f842',
|
||||||
|
'thumbnail': r're:^https?://.*\.(?:jpg|png)',
|
||||||
},
|
},
|
||||||
'params': {'skip_download': 'm3u8'}
|
'params': {'skip_download': 'm3u8'}
|
||||||
}]
|
}]
|
||||||
|
@ -24,8 +38,13 @@ def _real_extract(self, url):
|
||||||
formats = self._extract_m3u8_formats(video_url + '/playlist.m3u8', video_id, fatal=False)
|
formats = self._extract_m3u8_formats(video_url + '/playlist.m3u8', video_id, fatal=False)
|
||||||
formats.extend(self._extract_mpd_formats(video_url + '/manifest.mpd', video_id, fatal=False))
|
formats.extend(self._extract_mpd_formats(video_url + '/manifest.mpd', video_id, fatal=False))
|
||||||
|
|
||||||
|
old_video_id = None
|
||||||
|
if mobj := re.fullmatch(r'[^/#?]+-(?P<old_id>\d{7})', video_id):
|
||||||
|
old_video_id = [make_archive_id(self, mobj.group('old_id'))]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
'_old_archive_ids': old_video_id,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'title': remove_end(self._html_search_meta(
|
'title': remove_end(self._html_search_meta(
|
||||||
['og:title', 'twitter:title'], webpage, 'title', default=None), ' | CRTVG'),
|
['og:title', 'twitter:title'], webpage, 'title', default=None), ' | CRTVG'),
|
||||||
|
|
Loading…
Reference in a new issue