Fix youtube mixes
They cannot be viewed on their own, so change url in items to go to the video+playlist instead Signed-off-by: Jesús <heckyel@hyperbola.info>
This commit is contained in:
parent
a16b05af80
commit
6b6a6653a0
@ -502,10 +502,16 @@ def add_extra_html_info(item):
|
|||||||
|
|
||||||
item['video_info'] = json.dumps(video_info)
|
item['video_info'] = json.dumps(video_info)
|
||||||
|
|
||||||
|
elif item['type'] == 'playlist' and item['playlist_type'] == 'radio':
|
||||||
|
item['url'] = concat_or_none(
|
||||||
|
URL_ORIGIN,
|
||||||
|
'/watch?v=', item['first_video_id'],
|
||||||
|
'&list=', item['id']
|
||||||
|
)
|
||||||
elif item['type'] == 'playlist':
|
elif item['type'] == 'playlist':
|
||||||
item['url'] = (URL_ORIGIN + '/playlist?list=' + item['id']) if item.get('id') else None
|
item['url'] = concat_or_none(URL_ORIGIN, '/playlist?list=', item['id'])
|
||||||
elif item['type'] == 'channel':
|
elif item['type'] == 'channel':
|
||||||
item['url'] = (URL_ORIGIN + "/channel/" + item['id']) if item.get('id') else None
|
item['url'] = concat_or_none(URL_ORIGIN, "/channel/", item['id'])
|
||||||
|
|
||||||
|
|
||||||
def parse_info_prepare_for_html(renderer, additional_info={}):
|
def parse_info_prepare_for_html(renderer, additional_info={}):
|
||||||
|
@ -226,6 +226,7 @@ def extract_item_info(item, additional_info={}):
|
|||||||
info['type'] = 'video'
|
info['type'] = 'video'
|
||||||
elif primary_type in ('playlist', 'radio', 'show'):
|
elif primary_type in ('playlist', 'radio', 'show'):
|
||||||
info['type'] = 'playlist'
|
info['type'] = 'playlist'
|
||||||
|
info['playlist_type'] = primary_type
|
||||||
elif primary_type == 'channel':
|
elif primary_type == 'channel':
|
||||||
info['type'] = 'channel'
|
info['type'] = 'channel'
|
||||||
elif type == 'videoWithContextRenderer': # stupid exception
|
elif type == 'videoWithContextRenderer': # stupid exception
|
||||||
@ -313,11 +314,15 @@ def extract_item_info(item, additional_info={}):
|
|||||||
elif primary_type in ('playlist', 'radio'):
|
elif primary_type in ('playlist', 'radio'):
|
||||||
info['id'] = item.get('playlistId')
|
info['id'] = item.get('playlistId')
|
||||||
info['video_count'] = extract_int(item.get('videoCount'))
|
info['video_count'] = extract_int(item.get('videoCount'))
|
||||||
|
info['first_video_id'] = deep_get(item, 'navigationEndpoint',
|
||||||
|
'watchEndpoint', 'videoId')
|
||||||
elif primary_type == 'channel':
|
elif primary_type == 'channel':
|
||||||
info['id'] = item.get('channelId')
|
info['id'] = item.get('channelId')
|
||||||
info['approx_subscriber_count'] = extract_approx_int(item.get('subscriberCountText'))
|
info['approx_subscriber_count'] = extract_approx_int(item.get('subscriberCountText'))
|
||||||
elif primary_type == 'show':
|
elif primary_type == 'show':
|
||||||
info['id'] = deep_get(item, 'navigationEndpoint', 'watchEndpoint', 'playlistId')
|
info['id'] = deep_get(item, 'navigationEndpoint', 'watchEndpoint', 'playlistId')
|
||||||
|
info['first_video_id'] = deep_get(item, 'navigationEndpoint',
|
||||||
|
'watchEndpoint', 'videoId')
|
||||||
|
|
||||||
if primary_type in ('playlist', 'channel'):
|
if primary_type in ('playlist', 'channel'):
|
||||||
conservative_update(info, 'video_count', extract_int(item.get('videoCountText')))
|
conservative_update(info, 'video_count', extract_int(item.get('videoCountText')))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user