-from __future__ import unicode_literals
-
import time
from .common import InfoExtractor
-from ..utils import (
- int_or_none,
- HEADRequest,
-)
+from ..networking import HEADRequest
+from ..utils import int_or_none
class CultureUnpluggedIE(InfoExtractor):
'creator': 'Coldstream Creative',
'duration': 2203,
'view_count': int,
- }
+ },
}, {
'url': 'http://www.cultureunplugged.com/documentary/watch-online/play/53662',
'only_matching': True,
self._request_webpage(HEADRequest(
'http://www.cultureunplugged.com/setClientTimezone.php?timeOffset=%d' % -(time.timezone / 3600)), display_id)
movie_data = self._download_json(
- 'http://www.cultureunplugged.com/movie-data/cu-%s.json' % video_id, display_id)
+ f'http://www.cultureunplugged.com/movie-data/cu-{video_id}.json', display_id)
video_url = movie_data['url']
title = movie_data['title']
view_count = int_or_none(movie_data.get('views'))
thumbnails = [{
- 'url': movie_data['%s_thumb' % size],
+ 'url': movie_data[f'{size}_thumb'],
'id': size,
'preference': preference,
} for preference, size in enumerate((
- 'small', 'large')) if movie_data.get('%s_thumb' % size)]
+ 'small', 'large')) if movie_data.get(f'{size}_thumb')]
return {
'id': video_id,