get videoType from video results

This commit is contained in:
Lucas Macedo 2022-03-22 22:56:21 -03:00
commit 2b6ced5226
2 changed files with 4 additions and 0 deletions

View file

@ -24,6 +24,9 @@ PAGE_TYPE = [
NAVIGATION_VIDEO_ID = ['navigationEndpoint', 'watchEndpoint', 'videoId']
NAVIGATION_PLAYLIST_ID = ['navigationEndpoint', 'watchEndpoint', 'playlistId']
NAVIGATION_WATCH_PLAYLIST_ID = ['navigationEndpoint', 'watchPlaylistEndpoint', 'playlistId']
NAVIGATION_VIDEO_TYPE = [
'playNavigationEndpoint', 'watchEndpoint', 'watchEndpointMusicSupportedConfigs', 'watchEndpointMusicConfig', 'musicVideoType'
]
HEADER_DETAIL = ['header', 'musicDetailHeaderRenderer']
DESCRIPTION = ['description'] + RUN_TEXT
CAROUSEL = ['musicCarouselShelfRenderer']

View file

@ -107,6 +107,7 @@ class Parser:
elif resultType == 'video':
search_result['views'] = None
search_result['videoType'] = nav(data, PLAY_BUTTON + NAVIGATION_VIDEO_TYPE, True)
elif resultType == 'upload':
browse_id = nav(data, NAVIGATION_BROWSE_ID, True)