57 lines
1.5 KiB
Python
57 lines
1.5 KiB
Python
#!/usr/bin/env python3
|
|
import package.database as database
|
|
from pathlib import Path
|
|
|
|
DB = None
|
|
|
|
def remove_vods():
|
|
chats = DB.get_vods()
|
|
#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
|
|
|
|
#shutil.rmtree(f"", ignore_errors=True)
|
|
|
|
if clip_is:
|
|
source = Path(f"../saveoldold/clips/{id}")
|
|
destination = Path(f"../savedup/clips/{id}")
|
|
else:
|
|
source = Path(f"../saveoldold/{id}")
|
|
destination = Path(f"../savedup/{id}")
|
|
|
|
if source.exists() and source.is_dir():
|
|
source.rename(destination)
|
|
print("====================================================")
|
|
print(f"🚀 VOD to remove: {title}")
|
|
print("====================================================")
|
|
|
|
print("====================================================")
|
|
print(f"✅ Processing: VOD removal Done.")
|
|
print("====================================================")
|
|
|
|
def main():
|
|
global DB
|
|
DB = database.Database()
|
|
|
|
remove_vods()
|
|
|
|
if __name__ == "__main__":
|
|
main() |