#!/usr/bin/env python3 from pathlib import Path import package.database as database DB = None def fix_download(): chats = DB.get_undownloaded() #chats = DB.get_clips() for chat in chats: ( id, title, created_at, view_count, duration, url, thumbnail_url, game_id, game_name, stream_id, creator_name, clip_is, downloaded, uploaded_yt, uploaded_yt_chats, uploaded_yt_shorts, ) = chat if clip_is: file_name = Path(f"download/clips/{id}/{id}.mp4") else: file_name = Path(f"download/videos/{id}/{id}.mp4") if file_name.exists(): DB.mark_as_downloaded(id) print("====================================================") print(f"✅ Processing: download Fix.") print("====================================================") def main(): global DB DB = database.Repository() fix_download() if __name__ == "__main__": main()