mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-05-02 21:45:59 +00:00
Add old_archive_ids for RTVEinfantil
This commit is contained in:
parent
4f7f25b5f0
commit
7e59c08847
@ -1,6 +1,7 @@
|
|||||||
import base64
|
import base64
|
||||||
import io
|
import io
|
||||||
import struct
|
import struct
|
||||||
|
import urllib.parse
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
@ -32,8 +33,8 @@ class RTVEBaseIE(InfoExtractor):
|
|||||||
alphabet_data, _, url_data = data.partition(b'#')
|
alphabet_data, _, url_data = data.partition(b'#')
|
||||||
quality_str, _, url_data = url_data.rpartition(b'%%')
|
quality_str, _, url_data = url_data.rpartition(b'%%')
|
||||||
quality_str = quality_str.decode() or ''
|
quality_str = quality_str.decode() or ''
|
||||||
alphabet = RTVEALaCartaIE._get_alphabet(alphabet_data)
|
alphabet = RTVEBaseIE._get_alphabet(alphabet_data)
|
||||||
url = RTVEALaCartaIE._get_url(alphabet, url_data)
|
url = RTVEBaseIE._get_url(alphabet, url_data)
|
||||||
yield quality_str, url
|
yield quality_str, url
|
||||||
encrypted_data.read(4) # CRC
|
encrypted_data.read(4) # CRC
|
||||||
|
|
||||||
@ -182,10 +183,11 @@ class RTVEALaCartaIE(RTVEBaseIE):
|
|||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '7048976',
|
'id': '7048976',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Saber vivir - 07/07/24',
|
'title': 'Gusano',
|
||||||
'thumbnail': r're:https://img2\.rtve\.es/v/.*\.png',
|
'thumbnail': r're:https://img2\.rtve\.es/v/.*\.png',
|
||||||
'duration': 2162.68,
|
'duration': 292.86,
|
||||||
'series': 'Agus & Lui: Churros y Crafts',
|
'series': 'Agus & Lui: Churros y Crafts',
|
||||||
|
'_old_archive_ids': ['rtveinfantil 7048976'],
|
||||||
},
|
},
|
||||||
}]
|
}]
|
||||||
|
|
||||||
@ -209,11 +211,14 @@ class RTVEALaCartaIE(RTVEBaseIE):
|
|||||||
|
|
||||||
self._merge_subtitles(self.extract_subtitles(video_id), target=subtitles)
|
self._merge_subtitles(self.extract_subtitles(video_id), target=subtitles)
|
||||||
|
|
||||||
|
is_infantil = urllib.parse.urlparse(url).path.startswith('/infantil/')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'subtitles': subtitles,
|
'subtitles': subtitles,
|
||||||
**self._parse_metadata(metadata),
|
**self._parse_metadata(metadata),
|
||||||
|
'_old_archive_ids': [f'rtveinfantil {video_id}'] if is_infantil else None,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -317,7 +322,7 @@ class RTVELiveIE(RTVEBaseIE):
|
|||||||
|
|
||||||
class RTVETelevisionIE(InfoExtractor):
|
class RTVETelevisionIE(InfoExtractor):
|
||||||
IE_NAME = 'rtve.es:television'
|
IE_NAME = 'rtve.es:television'
|
||||||
_VALID_URL = r'https?://(?:www\.)?rtve\.es/television/[^/]+/[^/]+/(?P<id>\d+).shtml'
|
_VALID_URL = r'https?://(?:www\.)?rtve\.es/television/[^/?#]+/[^/?#]+/(?P<id>\d+).shtml'
|
||||||
|
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'https://www.rtve.es/television/20091103/video-inedito-del-8o-programa/299020.shtml',
|
'url': 'https://www.rtve.es/television/20091103/video-inedito-del-8o-programa/299020.shtml',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user