]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/abc.py
c0e5d1abffca7ded0186f64e2b38d7a74ea25d30
1 from __future__
import unicode_literals
5 from . common
import InfoExtractor
13 class ABCIE ( InfoExtractor
):
14 IE_NAME
= 'abc.net.au'
15 _VALID_URL
= r
'http://www\.abc\.net\.au/news/(?:[^/]+/){1,2}(?P<id>\d+)'
18 'url' : 'http://www.abc.net.au/news/2014-11-05/australia-to-staff-ebola-treatment-centre-in-sierra-leone/5868334' ,
19 'md5' : 'cb3dd03b18455a661071ee1e28344d9f' ,
23 'title' : 'Australia to help staff Ebola treatment centre in Sierra Leone' ,
24 'description' : 'md5:809ad29c67a05f54eb41f2a105693a67' ,
27 'url' : 'http://www.abc.net.au/news/2015-08-17/warren-entsch-introduces-same-sex-marriage-bill/6702326' ,
28 'md5' : 'db2a5369238b51f9811ad815b69dc086' ,
32 'upload_date' : '20150816' ,
33 'uploader' : 'ABC News (Australia)' ,
34 'description' : 'Government backbencher Warren Entsch introduces a cross-party sponsored bill to legalise same-sex marriage, saying the bill is designed to promote "an inclusive Australia, not a divided one.". Read more here: http://ab.co/1Mwc6ef' ,
35 'uploader_id' : 'NewsOnABC' ,
36 'title' : 'Marriage Equality: Warren Entsch introduces same sex marriage bill' ,
38 'add_ie' : [ 'Youtube' ],
40 'url' : 'http://www.abc.net.au/news/2015-10-23/nab-lifts-interest-rates-following-westpac-and-cba/6880080' ,
41 'md5' : 'b96eee7c9edf4fc5a358a0252881cc1f' ,
45 'title' : 'NAB lifts interest rates, following Westpac and CBA' ,
46 'description' : 'md5:f13d8edc81e462fce4a0437c7dc04728' ,
49 'url' : 'http://www.abc.net.au/news/2015-10-19/6866214' ,
50 'only_matching' : True ,
53 def _real_extract ( self
, url
):
54 video_id
= self
._ match
_ id
( url
)
55 webpage
= self
._ download
_ webpage
( url
, video_id
)
58 r
'inline(?P<type>Video|Audio|YouTube)Data\.push\((?P<json_data>[^)]+)\);' ,
61 raise ExtractorError ( 'Unable to extract video urls' )
63 urls_info
= self
._ parse
_ json
(
64 mobj
. group ( 'json_data' ), video_id
, transform_source
= js_to_json
)
66 if not isinstance ( urls_info
, list ):
67 urls_info
= [ urls_info
]
69 if mobj
. group ( 'type' ) == 'YouTube' :
70 return self
. playlist_result ([
71 self
. url_result ( url_info
[ 'url' ]) for url_info
in urls_info
])
74 'url' : url_info
[ 'url' ],
75 'vcodec' : url_info
. get ( 'codec' ) if mobj
. group ( 'type' ) == 'Video' else 'none' ,
76 'width' : int_or_none ( url_info
. get ( 'width' )),
77 'height' : int_or_none ( url_info
. get ( 'height' )),
78 'tbr' : int_or_none ( url_info
. get ( 'bitrate' )),
79 'filesize' : int_or_none ( url_info
. get ( 'filesize' )),
80 } for url_info
in urls_info
]
82 self
._ sort
_ formats
( formats
)
86 'title' : self
._ og
_ search
_ title
( webpage
),
88 'description' : self
._ og
_ search
_ description
( webpage
),
89 'thumbnail' : self
._ og
_ search
_ thumbnail
( webpage
),