updates available platforms and 1080p support
This commit is contained in:
parent
efc57145c1
commit
c4c923826e
@ -1161,6 +1161,16 @@ class InfoExtractor(object):
|
|||||||
unique_formats.append(f)
|
unique_formats.append(f)
|
||||||
formats[:] = unique_formats
|
formats[:] = unique_formats
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _remove_duplicate_formats_by_id(formats):
|
||||||
|
format_ids = set()
|
||||||
|
unique_formats = []
|
||||||
|
for f in formats:
|
||||||
|
if f['format_id'] not in format_ids:
|
||||||
|
format_ids.add(f['format_id'])
|
||||||
|
unique_formats.append(f)
|
||||||
|
formats[:] = unique_formats
|
||||||
|
|
||||||
def _is_valid_url(self, url, video_id, item='video', headers={}):
|
def _is_valid_url(self, url, video_id, item='video', headers={}):
|
||||||
url = self._proto_relative_url(url, scheme='http:')
|
url = self._proto_relative_url(url, scheme='http:')
|
||||||
# For now assume non HTTP(S) URLs always valid
|
# For now assume non HTTP(S) URLs always valid
|
||||||
|
@ -57,7 +57,8 @@ class HotStarIE(InfoExtractor):
|
|||||||
raise ExtractorError('This video is DRM protected.', expected=True)
|
raise ExtractorError('This video is DRM protected.', expected=True)
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
for f in ('JIO',):
|
platforms = video_data['availableAlso'].split('|')
|
||||||
|
for f in platforms:
|
||||||
format_data = self._download_json(
|
format_data = self._download_json(
|
||||||
'http://getcdn.hotstar.com/AVS/besc',
|
'http://getcdn.hotstar.com/AVS/besc',
|
||||||
video_id, 'Downloading %s JSON metadata' % f,
|
video_id, 'Downloading %s JSON metadata' % f,
|
||||||
@ -86,6 +87,7 @@ class HotStarIE(InfoExtractor):
|
|||||||
'width': int_or_none(format_data.get('width')),
|
'width': int_or_none(format_data.get('width')),
|
||||||
'height': int_or_none(format_data.get('height')),
|
'height': int_or_none(format_data.get('height')),
|
||||||
})
|
})
|
||||||
|
self._remove_duplicate_formats_by_id(formats)
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user