Last active
October 27, 2025 05:04
-
-
Save TiloGit/51ba118216561f7acdda96522d5d4db2 to your computer and use it in GitHub Desktop.
Revisions
-
TiloGit renamed this gist
Oct 27, 2025 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
TiloGit created this gist
Oct 27, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ #in bash run this for env #source my-venv/bin/activate #python from datetime import datetime import os from plexapi.server import PlexServer baseurl = 'https://50-____removed____2a1922.plex.direct:32400' token = 'X---removed---Kb' plex = PlexServer(baseurl, token) print(datetime.now().isoformat() + " _______START SCRIPT ") # --- Search for the show --- item_name = "Balu" # Change this to the show you want itemlist = plex.library.search(item_name, libtype='show') for item in itemlist: print(datetime.now().isoformat() + " with: "+ item.title) ##action list size total_size = 0 for episode in item.episodes(): #print(datetime.now().isoformat() + " with Ep: "+ episode.title) for media in episode.media: for part in media.parts: if part.size: print(datetime.now().isoformat() + " Now: " + episode.title +" with size: " + f"{part.size / (1024 ** 2):.2f} MB ") total_size += part.size print(f"Show: {item.title}") print(f"Total size: {total_size / (1024 ** 3):.2f}") ##download Now # --- Set download directory --- download_dir = os.path.expanduser(f"/media/joedoe/SSDdata/TVshows/{item.title}") os.makedirs(download_dir, exist_ok=True) downloaded_files = item.download(download_dir, keep_original_name=False,subfolders=True) print(datetime.now().isoformat() + " ✅ Download complete!: "+ item.title) for f in downloaded_files: print("📁", f) print(datetime.now().isoformat() + " ________END SCRIPT ")