diff options
author | Sergey M․ <dstftw@gmail.com> | 2016-09-18 17:28:41 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2016-09-18 17:30:55 +0700 |
commit | a1da888d0cc92fdf3506b30ee85ce241e9090408 (patch) | |
tree | 6780aa420f8e2d3e39e63e90ab21668b5ac34f3a | |
parent | 3acff9423df437dd4bd1530a69011fc9ddc74ad1 (diff) |
[vyborymos] Improve station info extraction
-rw-r--r-- | youtube_dl/extractor/vyborymos.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/youtube_dl/extractor/vyborymos.py b/youtube_dl/extractor/vyborymos.py index 884aecb71..9e703c4b6 100644 --- a/youtube_dl/extractor/vyborymos.py +++ b/youtube_dl/extractor/vyborymos.py @@ -2,6 +2,7 @@ from __future__ import unicode_literals from .common import InfoExtractor +from ..compat import compat_str class VyboryMosIE(InfoExtractor): @@ -28,7 +29,7 @@ class VyboryMosIE(InfoExtractor): channels = self._download_json( 'http://vybory.mos.ru/account/channels?station_id=%s' % station_id, - station_id) + station_id, 'Downloading channels JSON') formats = [] for cam_num, (sid, hosts, name, _) in enumerate(channels, 1): @@ -41,14 +42,13 @@ class VyboryMosIE(InfoExtractor): }) info = self._download_json( - 'http://vybory.mos.ru/json/voting_stations/136/%s.json' % station_id, - station_id, 'Downloading station info') - - title = info['name'] + 'http://vybory.mos.ru/json/voting_stations/%s/%s.json' + % (compat_str(station_id)[:3], station_id), + station_id, 'Downloading station JSON', fatal=False) return { 'id': station_id, - 'title': self._live_title(title), + 'title': self._live_title(info['name'] if info else station_id), 'description': info.get('address'), 'is_live': True, 'formats': formats, |