diff options
author | James Taylor <user234683@users.noreply.github.com> | 2019-02-07 20:58:17 -0800 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2019-02-07 20:58:17 -0800 |
commit | 4d7bba92eb62518e2273d030235214f4a7605444 (patch) | |
tree | 3950f6b98ef7a2b828adf906850c6ea598f27c0d /youtube/common.py | |
parent | b669050bed540c106a04ef30d1296ff385ebb6ba (diff) | |
download | yt-local-4d7bba92eb62518e2273d030235214f4a7605444.tar.lz yt-local-4d7bba92eb62518e2273d030235214f4a7605444.tar.xz yt-local-4d7bba92eb62518e2273d030235214f4a7605444.zip |
Use pbj format for playlist requests, ajax deprecated
Diffstat (limited to 'youtube/common.py')
-rw-r--r-- | youtube/common.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/youtube/common.py b/youtube/common.py index 59d757c..df8280d 100644 --- a/youtube/common.py +++ b/youtube/common.py @@ -483,8 +483,11 @@ dispatch = { 'thumbnail': ('thumbnail', get_thumbnail), 'thumbnails': ('thumbnail', lambda node: node[0]['thumbnails'][0]['url']), + 'viewCountText': ('views', get_text), + 'numVideosText': ('size', lambda node: get_text(node).split(' ')[0]), # the format is "324 videos" 'videoCountText': ('size', get_text), 'playlistId': ('id', lambda node: node), + 'descriptionText': ('description', get_formatted_text), 'subscriberCountText': ('subscriber_count', get_text), 'channelId': ('id', lambda node: node), @@ -510,6 +513,10 @@ def renderer_info(renderer): info['views'] = get_text(renderer['viewCountText']) elif 'shortViewCountText' in renderer: info['views'] = get_text(renderer['shortViewCountText']) + + if 'ownerText' in renderer: + info['author'] = renderer['ownerText']['runs'][0]['text'] + info['author_url'] = renderer['ownerText']['runs'][0]['navigationEndpoint']['commandMetadata']['webCommandMetadata']['url'] try: overlays = renderer['thumbnailOverlays'] except KeyError: |