]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/servus.py
e579d42cf525b56500b98c84272b67b279e36baa
   2 from __future__ 
import unicode_literals
 
   6 from .common 
import InfoExtractor
 
   9 class ServusIE(InfoExtractor
): 
  10     _VALID_URL 
= r
'https?://(?:www\.)?servus\.com/(?:(?:at|de)/p/[^/]+|tv/videos)/(?P<id>[aA]{2}-\w+|\d+-\d+)' 
  12         'url': 'https://www.servus.com/de/p/Die-Gr%C3%BCnen-aus-Sicht-des-Volkes/AA-1T6VBU5PW1W12/', 
  13         'md5': '3e1dd16775aa8d5cbef23628cfffc1f4', 
  15             'id': 'AA-1T6VBU5PW1W12', 
  17             'title': 'Die Grünen aus Sicht des Volkes', 
  18             'description': 'md5:1247204d85783afe3682644398ff2ec4', 
  19             'thumbnail': r
're:^https?://.*\.jpg', 
  22         'url': 'https://www.servus.com/at/p/Wie-das-Leben-beginnt/1309984137314-381415152/', 
  23         'only_matching': True, 
  25         'url': 'https://www.servus.com/tv/videos/aa-1t6vbu5pw1w12/', 
  26         'only_matching': True, 
  28         'url': 'https://www.servus.com/tv/videos/1380889096408-1235196658/', 
  29         'only_matching': True, 
  32     def _real_extract(self
, url
): 
  33         video_id 
= self
._match
_id
(url
).upper() 
  34         webpage 
= self
._download
_webpage
(url
, video_id
) 
  36         title 
= self
._search
_regex
( 
  37             (r
'videoLabel\s*=\s*(["\'])(?P
<title
>(?
:(?
!\
1).)+)\
1', 
  38              r'<h\d
+[^
>]+\bclass
=["\']heading--(?:one|two)["\'][^
>]*>(?P
<title
>[^
<]+)'), 
  39             webpage, 'title
', default=None, 
  40             group='title
') or self._og_search_title(webpage) 
  41         title = re.sub(r'\s
*-\s
*Servus TV\s
*$
', '', title) 
  42         description = self._og_search_description(webpage) 
  43         thumbnail = self._og_search_thumbnail(webpage) 
  45         formats = self._extract_m3u8_formats( 
  46             'https
://stv
.rbmbtnx
.net
/api
/v1
/manifests
/%s.m3u8
' % video_id, 
  47             video_id, 'mp4
', entry_protocol='m3u8_native
', m3u8_id='hls
') 
  48         self._sort_formats(formats) 
  53             'description
': description, 
  54             'thumbnail
': thumbnail,