2016-08-04 02:37:27 -06:00
from . common import InfoExtractor
from . . utils import unescapeHTML
class VODPlatformIE ( InfoExtractor ) :
2020-01-12 09:34:21 -07:00
_VALID_URL = r ' https?://(?:(?:www \ .)?vod-platform \ .net|embed \ .kwikmotion \ .com)/[eE]mbed/(?P<id>[^/?#]+) '
2022-07-31 19:23:25 -06:00
_EMBED_REGEX = [ r ' <iframe[^>]+src=([ " \' ])(?P<url>(?:https?:)?//(?:(?:www \ .)?vod-platform \ .net|embed \ .kwikmotion \ .com)/[eE]mbed/.+?) \ 1 ' ]
2020-01-12 09:34:21 -07:00
_TESTS = [ {
2016-08-04 02:37:27 -06:00
# from http://www.lbcgroup.tv/watch/chapter/29143/52844/%D8%A7%D9%84%D9%86%D8%B5%D8%B1%D8%A9-%D9%81%D9%8A-%D8%B6%D9%8A%D8%A7%D9%81%D8%A9-%D8%A7%D9%84%D9%80-cnn/ar
' url ' : ' http://vod-platform.net/embed/RufMcytHDolTH1MuKHY9Fw ' ,
' md5 ' : ' 1db2b7249ce383d6be96499006e951fc ' ,
' info_dict ' : {
' id ' : ' RufMcytHDolTH1MuKHY9Fw ' ,
' ext ' : ' mp4 ' ,
' title ' : ' LBCi News_ النصرة في ضيافة الـ " سي.أن.أن " ' ,
2024-06-11 17:09:58 -06:00
} ,
2020-01-12 09:34:21 -07:00
} , {
' url ' : ' http://embed.kwikmotion.com/embed/RufMcytHDolTH1MuKHY9Fw ' ,
' only_matching ' : True ,
} ]
2016-08-04 02:37:27 -06:00
def _real_extract ( self , url ) :
video_id = self . _match_id ( url )
webpage = self . _download_webpage ( url , video_id )
title = unescapeHTML ( self . _og_search_title ( webpage ) )
hidden_inputs = self . _hidden_inputs ( webpage )
2016-09-16 12:30:38 -06:00
formats = self . _extract_wowza_formats (
hidden_inputs . get ( ' HiddenmyhHlsLink ' ) or hidden_inputs [ ' HiddenmyDashLink ' ] , video_id , skip_protocols = [ ' f4m ' , ' smil ' ] )
2016-08-04 02:37:27 -06:00
return {
' id ' : video_id ,
' title ' : title ,
' thumbnail ' : hidden_inputs . get ( ' HiddenThumbnail ' ) or self . _og_search_thumbnail ( webpage ) ,
' formats ' : formats ,
}