2 from __future__ import unicode_literals
8 from .common import InfoExtractor
10 # audios on oe1.orf.at are only available for 7 days, so we can't
14 class OE1IE(InfoExtractor):
15 IE_DESC = 'oe1.orf.at'
16 _VALID_URL = r'http://oe1\.orf\.at/programm/(?P<id>[0-9]+)'
18 def _real_extract(self, url):
19 mobj = re.match(self._VALID_URL, url)
20 show_id = mobj.group('id')
22 data = self._download_json(
23 'http://oe1.orf.at/programm/%s/konsole' % show_id,
27 timestamp = datetime.datetime.strptime('%s %s' % (
28 data['item']['day_label'],
31 unix_timestamp = calendar.timegm(timestamp.utctimetuple())
35 'title': data['item']['title'],
36 'url': data['item']['url_stream'],
38 'description': data['item'].get('info'),
39 'timestamp': unix_timestamp