moved youtube scirpts into there own folder

This commit is contained in:
SumGuyV5 committed 2026-09-13 16:01:40 +00:00
1 parent 8bf85fea2e
commit afe6490d20
15 files changed
+127 -102

No files matched your search

+3 -3
View File
@@ -2,9 +2,9 @@
# Expose components from individual modules using relative imports
from .chat_vod import combine_twitch_vod_and_chat
from .download_thumbnails import main as download_thumbnails
from .download_videos import main as download_videos
from .video_info import main as video_info
from .download_thumbnails import download_thumbnails
from .download_videos import download_videos
from .video_info import video_info
# Explicitly define what is exposed when importing the subpackage
__all__ = [
+3
View File
@@ -4,6 +4,9 @@ import cv2
import package.utils as utils
def get_video_height(video_path: str) -> int:
"""
Gets the videos height
"""
# Open the video file
video = cv2.VideoCapture(video_path)
+2 -2
View File
@@ -80,7 +80,7 @@ def save_image(url: str, filename: str, stream: bool = True):
except Exception as e:
print(f"❌ An error occurred during file writing: {e}")
async def main():
async def download_thumbnails():
# Initialize connection & automatically authorize the App token
await config.get_twitch()
twitch = config.TWITCH # Twitch(APP_ID, APP_SECRET)
@@ -141,4 +141,4 @@ async def main():
await download_clip_thumbnail(id, thumbnail_url)
if __name__ == '__main__':
asyncio.run(main())
asyncio.run(download_thumbnails())
+2 -5
View File
@@ -14,7 +14,7 @@ def write_csv(data, file_name):
# Write all rows at once
writer.writerows(data)
def download():
def download_videos():
"""Find all undownloaded videos and clips, and download them safely."""
undownloaded = DB.get_undownloaded()
@@ -96,8 +96,5 @@ def download():
print("Finished Downloading Pipeline.")
def main():
download()
if __name__ == "__main__":
main()
download_videos()
+5 -5
View File
@@ -40,7 +40,7 @@ async def get_game_name_by_id(game_id: str) -> str:
pass
return "Unknown Game"
async def get_vod_game_name(vod_id: str):
async def get_vod_game_name(vod_id: str) -> tuple:
"""Asynchronously query Twitch GQL endpoint for VOD game metadata."""
game_id = "0"
game_name = "Unknown Game"
@@ -83,7 +83,7 @@ async def get_vod_game_name(vod_id: str):
return game_id, game_name
async def get_streamer_vods():
async def get_streamer_vods() -> list:
await config.get_twitch()
print(f"Starting VOD extraction for {config.USER.display_name}...")
@@ -121,7 +121,7 @@ async def get_streamer_vods():
print(f"\nFinished extracting VODs. Total gathered: {len(all_vods)}")
return all_vods
async def get_streamer_clips():
async def get_streamer_clips() -> list:
await config.get_twitch()
print(f"Starting clip extraction for {config.USER.display_name}...")
@@ -151,7 +151,7 @@ async def get_streamer_clips():
print(f"\nFinished extracting clips. Total gathered: {len(all_clips)}")
return all_clips
async def main():
async def video_info():
print("--- Script Started ---")
vods_list = await get_streamer_vods()
@@ -179,4 +179,4 @@ async def main():
print(f"Recent VOD: '{clips_list[0]['title']}'")
if __name__ == "__main__":
asyncio.run(main())
asyncio.run(video_info())