]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/sbs.py
1 # -*- coding: utf-8 -*-
2 from __future__
import unicode_literals
6 from . common
import InfoExtractor
13 class SBSIE ( InfoExtractor
):
14 IE_DESC
= 'sbs.com.au'
15 _VALID_URL
= r
'https?://(?:www\.)?sbs\.com\.au/ondemand/video/(?:single/)?(?P<id>[0-9]+)'
18 # Original URL is handled by the generic IE which finds the iframe:
19 # http://www.sbs.com.au/thefeed/blog/2014/08/21/dingo-conservation
20 'url' : 'http://www.sbs.com.au/ondemand/video/single/320403011771/?source=drupal&vertical=thefeed' ,
21 'md5' : '3150cf278965eeabb5b4cea1c963fe0a' ,
25 'title' : 'Dingo Conservation' ,
26 'description' : 'Dingoes are on the brink of extinction; most of the animals we think are dingoes are in fact crossbred with wild dogs. This family run a dingo conservation park to prevent their extinction' ,
27 'thumbnail' : 're:http://.*\.jpg' ,
29 'add_ies' : [ 'generic' ],
31 'url' : 'http://www.sbs.com.au/ondemand/video/320403011771/Dingo-Conservation-The-Feed' ,
32 'only_matching' : True ,
35 def _real_extract ( self
, url
):
36 video_id
= self
._ match
_ id
( url
)
38 webpage
= self
._ download
_ webpage
( url
, video_id
)
40 player
= self
._ search
_ regex
(
41 r
'(?s)playerParams\.releaseUrls\s*=\s*(\ {.*?\n\} );\n' ,
43 player
= re
. sub ( r
"'\s*\+\s*[\da-zA-Z_]+\s*\+\s*'" , '' , player
)
45 release_urls
= self
._ parse
_ json
( js_to_json ( player
), video_id
)
47 theplatform_url
= release_urls
. get ( 'progressive' ) or release_urls
[ 'standard' ]
49 title
= remove_end ( self
._ og
_ search
_ title
( webpage
), ' (The Feed)' )
50 description
= self
._ html
_ search
_ meta
( 'description' , webpage
)
51 thumbnail
= self
._ og
_ search
_ thumbnail
( webpage
)
54 '_type' : 'url_transparent' ,
56 'url' : theplatform_url
,
58 'description' : description
,
59 'thumbnail' : thumbnail
,