diff options
author | Jesus E <heckyel@riseup.net> | 2023-06-17 16:14:59 -0400 |
---|---|---|
committer | Jesus E <heckyel@riseup.net> | 2023-06-17 16:14:59 -0400 |
commit | 0f4bf45cdebbfb10ec0b2e909b65d0396ddd2cc2 (patch) | |
tree | f4c24eba538c968e7c17dbf9861ec896cb29c692 | |
parent | d7f934b7b21b40caf00efdcc8b47ad16c341dd44 (diff) | |
download | yt-local-0f4bf45cdebbfb10ec0b2e909b65d0396ddd2cc2.tar.lz yt-local-0f4bf45cdebbfb10ec0b2e909b65d0396ddd2cc2.tar.xz yt-local-0f4bf45cdebbfb10ec0b2e909b65d0396ddd2cc2.zip |
Fix minor formatting issues
-rw-r--r-- | youtube/yt_data_extract/common.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/youtube/yt_data_extract/common.py b/youtube/yt_data_extract/common.py index 81fe0a5..b029a15 100644 --- a/youtube/yt_data_extract/common.py +++ b/youtube/yt_data_extract/common.py @@ -301,8 +301,8 @@ def extract_item_info(item, additional_info={}): info['id'] = multi_deep_get(item, ['videoId'], ['navigationEndpoint', 'watchEndpoint', 'videoId'], - ['navigationEndpoint', 'reelWatchEndpoint', 'videoId'], # shorts - ) + ['navigationEndpoint', 'reelWatchEndpoint', 'videoId'] # shorts + ) info['view_count'] = extract_int(item.get('viewCountText')) # dig into accessibility data to get view_count for videos marked as recommended, and to get time_published @@ -322,15 +322,15 @@ def extract_item_info(item, additional_info={}): else: info['approx_view_count'] = extract_approx_int(multi_get(item, 'shortViewCountText', - 'viewCountText') # shorts - ) + 'viewCountText' # shorts + )) # handle case where it is "No views" if not info['approx_view_count']: if ('No views' in item.get('shortViewCountText', '') or 'no views' in accessibility_label.lower() or 'No views' in extract_str(item.get('viewCountText', '')) # shorts - ): + ): info['view_count'] = 0 info['approx_view_count'] = '0' |