]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/atvat.py
1584d53fc3784d3ffe1a89ca2856d30f4b94380c
   2 from __future__ 
import unicode_literals
 
   4 from .common 
import InfoExtractor
 
  12 class ATVAtIE(InfoExtractor
): 
  13     _VALID_URL 
= r
'https?://(?:www\.)?atv\.at/(?:[^/]+/){2}(?P<id>[dv]\d+)' 
  15         'url': 'http://atv.at/aktuell/di-210317-2005-uhr/v1698449/', 
  16         'md5': 'c3b6b975fb3150fc628572939df205f2', 
  20             'title': 'DI, 21.03.17 | 20:05 Uhr 1/1', 
  23         'url': 'http://atv.at/aktuell/meinrad-knapp/d8416/', 
  24         'only_matching': True, 
  27     def _real_extract(self
, url
): 
  28         display_id 
= self
._match
_id
(url
) 
  29         webpage 
= self
._download
_webpage
(url
, display_id
) 
  30         video_data 
= self
._parse
_json
(unescapeHTML(self
._search
_regex
( 
  31             r
'class="[^"]*jsb_video/FlashPlayer[^"]*"[^>]+data-jsb="([^"]+)"', 
  32             webpage
, 'player data')), display_id
)['config']['initial_video'] 
  34         video_id 
= video_data
['id'] 
  35         video_title 
= video_data
['title'] 
  38         for part 
in video_data
.get('parts', []): 
  40             part_title 
= part
['title'] 
  43             for source 
in part
.get('sources', []): 
  44                 source_url 
= source
.get('src') 
  47                 ext 
= determine_ext(source_url
) 
  49                     formats
.extend(self
._extract
_m
3u8_formats
( 
  50                         source_url
, part_id
, 'mp4', 'm3u8_native', 
  51                         m3u8_id
='hls', fatal
=False)) 
  54                         'format_id': source
.get('delivery'), 
  57             self
._sort
_formats
(formats
) 
  62                 'thumbnail': part
.get('preview_image_url'), 
  63                 'duration': int_or_none(part
.get('duration')), 
  64                 'is_live': part
.get('is_livestream'), 
  69             '_type': 'multi_video',