]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/ufctv.py
2 from __future__
import unicode_literals
4 from . common
import InfoExtractor
11 class UFCTVIE ( InfoExtractor
):
12 _VALID_URL
= r
'https?://(?:www\.)?ufc\.tv/video/(?P<id>[^/]+)'
14 'url' : 'https://www.ufc.tv/video/ufc-219-countdown-full-episode' ,
18 'title' : 'UFC 219 Countdown: Full Episode' ,
19 'description' : 'md5:26d4e8bf4665ae5878842d7050c3c646' ,
20 'timestamp' : 1513962360 ,
21 'upload_date' : '20171222' ,
25 'skip_download' : True ,
29 def _real_extract ( self
, url
):
30 display_id
= self
._ match
_ id
( url
)
31 video_data
= self
._ download
_ json
( url
, display_id
, query
={
34 video_id
= str ( video_data
[ 'id' ])
35 title
= video_data
[ 'name' ]
36 m3u8_url
= self
._ download
_ json
(
37 'https://www.ufc.tv/service/publishpoint' , video_id
, query
={
42 'User-Agent' : 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0_1 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A402 Safari/604.1' ,
44 m3u8_url
= m3u8_url
. replace ( '_iphone.' , '.' )
45 formats
= self
._ extract
_ m
3u8_ formats
( m3u8_url
, video_id
, 'mp4' )
46 self
._ sort
_ formats
( formats
)
51 'description' : video_data
. get ( 'description' ),
52 'duration' : parse_duration ( video_data
. get ( 'runtime' )),
53 'timestamp' : parse_iso8601 ( video_data
. get ( 'releaseDate' )),