[+] Split into movie/TV

This commit is contained in:
2026-03-09 01:15:57 -04:00
parent 51284967fb
commit 0ba8e08d96
2 changed files with 18 additions and 6 deletions
+1
View File
@@ -218,3 +218,4 @@ __marimo__/
config.toml config.toml
browser_profile browser_profile
old/ old/
data/
+16 -5
View File
@@ -30,7 +30,7 @@ def format_file_tree(file_tree: list) -> str:
return "\n".join(lines) return "\n".join(lines)
def process_imdb_workflow(imdb_id: str, dl_dir: str = "/data/qb", jellyfin_dir: str = "/data/jellyfin"): def process_imdb_workflow(imdb_id: str, dl_dir: str = "/data/qb", jellyfin_base_dir: str = "/data/Jellyfin"):
""" """
Workflow to automatically find, download, and map torrents for an IMDb ID into a Jellyfin library. Workflow to automatically find, download, and map torrents for an IMDb ID into a Jellyfin library.
""" """
@@ -45,6 +45,12 @@ def process_imdb_workflow(imdb_id: str, dl_dir: str = "/data/qb", jellyfin_dir:
title_dir = f"{title} ({year})" title_dir = f"{title} ({year})"
print(f"Found Title: {title_dir}") print(f"Found Title: {title_dir}")
movietype = imdb_info['data'].get('movietype', 'Movie')
if movietype == 'TV Series':
jellyfin_dir = f"{jellyfin_base_dir}/TV"
else:
jellyfin_dir = f"{jellyfin_base_dir}/Movie"
print(f"\n=== [1] Searching Torrents for {imdb_id} ===") print(f"\n=== [1] Searching Torrents for {imdb_id} ===")
imdb_url = f"https://www.imdb.com/title/{imdb_id}/" imdb_url = f"https://www.imdb.com/title/{imdb_id}/"
search_res = search_mteam_torrents(imdb_url) search_res = search_mteam_torrents(imdb_url)
@@ -134,8 +140,13 @@ def process_imdb_workflow(imdb_id: str, dl_dir: str = "/data/qb", jellyfin_dir:
print(f"Finished processing torrent: {tid}") print(f"Finished processing torrent: {tid}")
if __name__ == "__main__": if __name__ == "__main__":
import sys import argparse
# Allow executing directly with `uv run workflow.py tt7742120` parser = argparse.ArgumentParser(description="Workflow to automatically find, download, and map torrents for an IMDb ID into Jellyfin.")
test_id = sys.argv[1] if len(sys.argv) > 1 else "tt38872297" parser.add_argument("imdb_id", type=str, help="The IMDb ID to process (e.g., tt38872297)")
process_imdb_workflow(test_id) parser.add_argument("--dl-dir", type=str, default="/data/qb", help="The qBittorrent download directory")
parser.add_argument("--jellyfin-dir", type=str, default="/data/Jellyfin", help="The base Jellyfin library directory")
args = parser.parse_args()
process_imdb_workflow(args.imdb_id, dl_dir=args.dl_dir, jellyfin_base_dir=args.jellyfin_dir)