[RCTIplus] Add new extractor

This commit is contained in:
SpiderRider067 2021-01-15 16:41:28 -05:00
parent 9c9b458145
commit f240f46f7c
2 changed files with 41 additions and 0 deletions

View File

@ -960,6 +960,7 @@ from .raywenderlich import (
RayWenderlichCourseIE, RayWenderlichCourseIE,
) )
from .rbmaradio import RBMARadioIE from .rbmaradio import RBMARadioIE
from .rcti import RCTIplusIE
from .rds import RDSIE from .rds import RDSIE
from .redbulltv import ( from .redbulltv import (
RedBullTVIE, RedBullTVIE,

View File

@ -0,0 +1,40 @@
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class RCTIplusIE(InfoExtractor):
IE_NAME = 'RCTIplus'
_VALID_URL = r'https://www\.rctiplus\.com/programs/\d+?/.*?/episode/(?P<id>\d+)/.*'
_TEST = {
'url': 'https://www.rctiplus.com/programs/540/upin-ipin/episode/5642/esok-puasa-upin-ipin-ep1',
'md5': 'e9b7c88101aab04d9115e2718dae7260',
'info_dict': {
'id': '5642',
'title': 'Esok Puasa - Upin & Ipin Ep.1',
'ext': 'm3u8',
}
}
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
title = self._og_search_title(webpage)
auth_key = self._search_regex(
r'\'Authorization\':"(?P<auth>[^"]+)"', webpage, 'auth-key')
request_url = ('https://api.rctiplus.com/api/v1/episode/' + video_id
+ '/url?appierid=.1')
json = self._download_json(
request_url, video_id, headers={'Authorization': auth_key})
video_url = json.get('data').get('url')
formats = self._extract_m3u8_formats(video_url, video_id)
self._sort_formats(formats)
return {
'id': video_id,
'title': title,
'formats': formats,
}