return video type on get watch playlist
This commit is contained in:
parent
33232aef0c
commit
56b266dbdb
3 changed files with 6 additions and 2 deletions
|
|
@ -25,7 +25,7 @@ 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 = [
|
NAVIGATION_VIDEO_TYPE = [
|
||||||
'playNavigationEndpoint', 'watchEndpoint', 'watchEndpointMusicSupportedConfigs', 'watchEndpointMusicConfig', 'musicVideoType'
|
'watchEndpoint', 'watchEndpointMusicSupportedConfigs', 'watchEndpointMusicConfig', 'musicVideoType'
|
||||||
]
|
]
|
||||||
HEADER_DETAIL = ['header', 'musicDetailHeaderRenderer']
|
HEADER_DETAIL = ['header', 'musicDetailHeaderRenderer']
|
||||||
DESCRIPTION = ['description'] + RUN_TEXT
|
DESCRIPTION = ['description'] + RUN_TEXT
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,9 @@ class Parser:
|
||||||
search_result['videoId'] = nav(
|
search_result['videoId'] = nav(
|
||||||
data, PLAY_BUTTON + ['playNavigationEndpoint', 'watchEndpoint', 'videoId'],
|
data, PLAY_BUTTON + ['playNavigationEndpoint', 'watchEndpoint', 'videoId'],
|
||||||
True)
|
True)
|
||||||
|
search_result['videoType'] = nav(
|
||||||
|
data, PLAY_BUTTON + ['playNavigationEndpoint'] + NAVIGATION_VIDEO_TYPE,
|
||||||
|
True)
|
||||||
|
|
||||||
if resultType in ['song', 'video', 'album']:
|
if resultType in ['song', 'video', 'album']:
|
||||||
search_result['duration'] = None
|
search_result['duration'] = None
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,8 @@ def parse_watch_track(data):
|
||||||
'length': nav(data, ['lengthText', 'runs', 0, 'text'], True),
|
'length': nav(data, ['lengthText', 'runs', 0, 'text'], True),
|
||||||
'thumbnail': nav(data, THUMBNAIL),
|
'thumbnail': nav(data, THUMBNAIL),
|
||||||
'feedbackTokens': feedback_tokens,
|
'feedbackTokens': feedback_tokens,
|
||||||
'likeStatus': like_status
|
'likeStatus': like_status,
|
||||||
|
'videoType': nav(data, ['navigationEndpoint'] + NAVIGATION_VIDEO_TYPE, True)
|
||||||
}
|
}
|
||||||
track.update(song_info)
|
track.update(song_info)
|
||||||
return track
|
return track
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue