From ccb795e31f2f9944b1c8b061906eb752009f8ea7 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Mon, 3 Jun 2019 03:20:44 -0700 Subject: Ensure videos in subscriptions from same channel in order --- youtube/subscriptions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'youtube') diff --git a/youtube/subscriptions.py b/youtube/subscriptions.py index a7b94bc..dc8412b 100644 --- a/youtube/subscriptions.py +++ b/youtube/subscriptions.py @@ -130,11 +130,11 @@ def _get_upstream_videos(channel_id): videos = [] json_channel_videos = channel.get_grid_items(channel.get_channel_tab(channel_id)[1]['response']) - for json_video in json_channel_videos: + for i, json_video in enumerate(json_channel_videos): info = yt_data_extract.renderer_info(json_video['gridVideoRenderer']) if 'description' not in info: info['description'] = '' - info['time_published'] = youtube_timestamp_to_posix(info['published']) + info['time_published'] = youtube_timestamp_to_posix(info['published']) - i # subtract a few seconds off the videos so they will be in the right order videos.append(info) return videos -- cgit v1.2.3