Fix limiting copying playlists

This commit is contained in:
Maks Snegov 2024-02-02 18:07:33 -08:00
parent f33297382e
commit 0e9ba7048d

View File

@ -169,12 +169,12 @@ def copy_playlist_items(yt_api,
delete_from_src: bool = False,
limit: int = -1,
dry_run: bool = False):
if limit < 0:
limit = len(src_playlist)
src_videos = list_playlist(yt_api, src_playlist)
dst_videos = list_playlist(yt_api, dst_playlist)
if limit < 0:
limit = len(src_videos)
dst_video_map = {video['snippet']['resourceId']['videoId']: video['id']
for video in dst_videos}