2 from __future__ import unicode_literals
4 from .common import InfoExtractor
7 class VyboryMosIE(InfoExtractor):
8 _VALID_URL = r'https?://vybory\.mos\.ru/(?:#precinct/|account/channels\?.*?\bstation_id=)(?P<id>\d+)'
10 'url': 'http://vybory.mos.ru/#precinct/13636',
14 'title': 're:^Участковая избирательная комиссия №2231 [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
15 'description': 'Россия, Москва, улица Введенского, 32А',
19 'skip_download': True,
22 'url': 'http://vybory.mos.ru/account/channels?station_id=13636',
23 'only_matching': True,
26 def _real_extract(self, url):
27 station_id = self._match_id(url)
29 channels = self._download_json(
30 'http://vybory.mos.ru/account/channels?station_id=%s' % station_id,
34 for cam_num, (sid, hosts, name, _) in enumerate(channels, 1):
35 for num, host in enumerate(hosts, 1):
37 'url': 'http://%s/master.m3u8?sid=%s' % (host, sid),
39 'format_id': 'camera%d-host%d' % (cam_num, num),
40 'format_note': '%s, %s' % (name, host),
43 info = self._download_json(
44 'http://vybory.mos.ru/json/voting_stations/136/%s.json' % station_id,
45 station_id, 'Downloading station info')
51 'title': self._live_title(title),
52 'description': info.get('address'),