get videoType from video results
This commit is contained in:
parent
7ebb57d2a5
commit
2b6ced5226
2 changed files with 4 additions and 0 deletions
|
|
@ -24,6 +24,9 @@ PAGE_TYPE = [
|
||||||
NAVIGATION_VIDEO_ID = ['navigationEndpoint', 'watchEndpoint', 'videoId']
|
NAVIGATION_VIDEO_ID = ['navigationEndpoint', 'watchEndpoint', 'videoId']
|
||||||
NAVIGATION_PLAYLIST_ID = ['navigationEndpoint', 'watchEndpoint', 'playlistId']
|
NAVIGATION_PLAYLIST_ID = ['navigationEndpoint', 'watchEndpoint', 'playlistId']
|
||||||
NAVIGATION_WATCH_PLAYLIST_ID = ['navigationEndpoint', 'watchPlaylistEndpoint', 'playlistId']
|
NAVIGATION_WATCH_PLAYLIST_ID = ['navigationEndpoint', 'watchPlaylistEndpoint', 'playlistId']
|
||||||
|
NAVIGATION_VIDEO_TYPE = [
|
||||||
|
'playNavigationEndpoint', 'watchEndpoint', 'watchEndpointMusicSupportedConfigs', 'watchEndpointMusicConfig', 'musicVideoType'
|
||||||
|
]
|
||||||
HEADER_DETAIL = ['header', 'musicDetailHeaderRenderer']
|
HEADER_DETAIL = ['header', 'musicDetailHeaderRenderer']
|
||||||
DESCRIPTION = ['description'] + RUN_TEXT
|
DESCRIPTION = ['description'] + RUN_TEXT
|
||||||
CAROUSEL = ['musicCarouselShelfRenderer']
|
CAROUSEL = ['musicCarouselShelfRenderer']
|
||||||
|
|
|
||||||
|
|
@ -107,6 +107,7 @@ class Parser:
|
||||||
|
|
||||||
elif resultType == 'video':
|
elif resultType == 'video':
|
||||||
search_result['views'] = None
|
search_result['views'] = None
|
||||||
|
search_result['videoType'] = nav(data, PLAY_BUTTON + NAVIGATION_VIDEO_TYPE, True)
|
||||||
|
|
||||||
elif resultType == 'upload':
|
elif resultType == 'upload':
|
||||||
browse_id = nav(data, NAVIGATION_BROWSE_ID, True)
|
browse_id = nav(data, NAVIGATION_BROWSE_ID, True)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue