[Beam] make sure "id" and "title" are always presented
This commit is contained in:
parent
fbf8614584
commit
aee23eccb7
@ -34,7 +34,7 @@ class BeamProLiveIE(InfoExtractor):
|
|||||||
'description': 'md5:0b161ac080f15fe05d18a07adb44a74d',
|
'description': 'md5:0b161ac080f15fe05d18a07adb44a74d',
|
||||||
'is_live': True,
|
'is_live': True,
|
||||||
},
|
},
|
||||||
# 'skip': r're:.* is offline$',
|
'skip': 'niterhayven is offline',
|
||||||
'params': {
|
'params': {
|
||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
},
|
},
|
||||||
@ -57,6 +57,10 @@ class BeamProLiveIE(InfoExtractor):
|
|||||||
info['formats'] = formats
|
info['formats'] = formats
|
||||||
if chan_data:
|
if chan_data:
|
||||||
info.update(self._extract_info(chan_data))
|
info.update(self._extract_info(chan_data))
|
||||||
|
if not info.get('title'):
|
||||||
|
info['title'] = self._live_title(channel_id)
|
||||||
|
if not info.get('id'): # barely possible but just in case
|
||||||
|
info['id'] = compat_str(abs(hash('{0}/{1}'.format(channel_id, formats[0]))) % (10 ** 8))
|
||||||
|
|
||||||
return info
|
return info
|
||||||
|
|
||||||
@ -66,10 +70,11 @@ class BeamProLiveIE(InfoExtractor):
|
|||||||
def _extract_info(self, info):
|
def _extract_info(self, info):
|
||||||
thumbnail = info['thumbnail'].get('url') if info.get('thumbnail') else None
|
thumbnail = info['thumbnail'].get('url') if info.get('thumbnail') else None
|
||||||
username = info['user'].get('url') if info.get('username') else None
|
username = info['user'].get('url') if info.get('username') else None
|
||||||
|
video_id = compat_str(info['id']) if info.get('id') else None
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': compat_str(info['id']),
|
'id': video_id,
|
||||||
'title': info.get('name') or 'Untitled Broadcast',
|
'title': info.get('name'),
|
||||||
'description': clean_html(info.get('description')),
|
'description': clean_html(info.get('description')),
|
||||||
'age_limit': self._rating_to_age(info.get('audience')),
|
'age_limit': self._rating_to_age(info.get('audience')),
|
||||||
'is_live': True if info.get('online') else False,
|
'is_live': True if info.get('online') else False,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user