]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/radiobremen.py
3 from . common
import InfoExtractor
4 from .. utils
import parse_duration
7 class RadioBremenIE ( InfoExtractor
):
8 _VALID_URL
= r
'http?://(?:www\.)?radiobremen\.de/mediathek/(?:index\.html)?\?id=(?P<id>[0-9]+)'
9 IE_NAME
= 'radiobremen'
12 'url' : 'http://www.radiobremen.de/mediathek/?id=141876' ,
18 'title' : 'Druck auf Patrick Öztürk' ,
19 'thumbnail' : r
're:https?://.*\.jpg$' ,
20 'description' : 'Gegen den SPD-Bürgerschaftsabgeordneten Patrick Öztürk wird wegen Beihilfe zum gewerbsmäßigen Betrug ermittelt. Am Donnerstagabend sollte er dem Vorstand des SPD-Unterbezirks Bremerhaven dazu Rede und Antwort stehen.' ,
24 def _real_extract ( self
, url
):
25 video_id
= self
._ match
_ id
( url
)
27 meta_url
= 'http://www.radiobremen.de/apps/php/mediathek/metadaten.php?id= %s ' % video_id
28 meta_doc
= self
._ download
_ webpage
(
29 meta_url
, video_id
, 'Downloading metadata' )
30 title
= self
._ html
_ search
_ regex
(
31 r
'<h1.*>(?P<title>.+)</h1>' , meta_doc
, 'title' )
32 description
= self
._ html
_ search
_ regex
(
33 r
'<p>(?P<description>.*)</p>' , meta_doc
, 'description' , fatal
= False )
34 duration
= parse_duration ( self
._ html
_ search
_ regex
(
35 r
'Länge:</td>\s+<td>(?P<duration>[0-9]+:[0-9]+)</td>' ,
36 meta_doc
, 'duration' , fatal
= False ))
38 page_doc
= self
._ download
_ webpage
(
39 url
, video_id
, 'Downloading video information' )
41 r
"ardformatplayerclassic\(\'playerbereich\',\'(?P<width>[0-9]+)\',\'.*\',\'(?P<video_id>[0-9]+)\',\'(?P<secret>[0-9]+)\',\'(?P<thumbnail>.+)\',\'\'\)" ,
44 "http://dl-ondemand.radiobremen.de/mediabase/ %s / %s _ %s _ %s .mp4" %
45 ( video_id
, video_id
, mobj
. group ( "secret" ), mobj
. group ( 'width' )))
50 'width' : int ( mobj
. group ( 'width' )),
55 'description' : description
,
58 'thumbnail' : mobj
. group ( 'thumbnail' ),