From 0f4bf45cdebbfb10ec0b2e909b65d0396ddd2cc2 Mon Sep 17 00:00:00 2001 From: Jesus E Date: Sat, 17 Jun 2023 16:14:59 -0400 Subject: Fix minor formatting issues --- youtube/yt_data_extract/common.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'youtube/yt_data_extract') 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' -- cgit v1.2.3