a bunch of routines to transform ghibili movies from Chinese names to jellyfin-friendly names

larry1chan@qq.com 3d0de185c2 first version il y a 8 mois
docker 3d0de185c2 first version il y a 8 mois
.gitignore 3d0de185c2 first version il y a 8 mois
README.md 3d0de185c2 first version il y a 8 mois
build_jellyfin_dir.py 3d0de185c2 first version il y a 8 mois
delete_media.py 3d0de185c2 first version il y a 8 mois
discard_media.py 3d0de185c2 first version il y a 8 mois
ghibili.py 3d0de185c2 first version il y a 8 mois
ghibili2.py 3d0de185c2 first version il y a 8 mois
ghibili3.py 3d0de185c2 first version il y a 8 mois
ghibili4.py 3d0de185c2 first version il y a 8 mois
ghibli_imdb_results-saved.json 3d0de185c2 first version il y a 8 mois
ghibli_imdb_results.json 3d0de185c2 first version il y a 8 mois
ghibli_jellyfin_ready (original dir info).json 3d0de185c2 first version il y a 8 mois
ghibli_jellyfin_ready.json 3d0de185c2 first version il y a 8 mois
remove_symlinks.py 3d0de185c2 first version il y a 8 mois
removed_symlinks.txt 3d0de185c2 first version il y a 8 mois
small_media_files.txt 3d0de185c2 first version il y a 8 mois
sync_dry_run.txt 3d0de185c2 first version il y a 8 mois
sync_errors.txt 3d0de185c2 first version il y a 8 mois
sync_media.py 3d0de185c2 first version il y a 8 mois
transform_files.py 3d0de185c2 first version il y a 8 mois

README.md

Ghibli Anime Jellyfin Preparation Toolkit

This project provides a set of Python scripts to process a collection of Japanese animation (anime) files, originally named in Chinese, and transform them into a directory and file structure suitable for Jellyfin media server. The toolkit also supports fetching and organizing metadata from online movie databases such as IMDb and TMDB.

Features

  • Directory Traversal & Title Extraction:Collects unique Chinese anime titles from a directory tree.
  • English Title & Metadata Matching:Matches Chinese titles to their English equivalents and fetches metadata (IMDb/TMDB IDs).
  • Metadata Transformation:Converts collected metadata into a Jellyfin-friendly JSON format.
  • Directory & File Structure Generation:Builds a new directory tree with properly named files, supporting symlinks, renaming, and dry-run modes.
  • Jellyfin Integration: Prepares your anime collection for easy import into Jellyfin, with correct naming and metadata.

Main Scripts

  • ghibili3.py:Traverses your anime directory, matches Chinese titles to English, and fetches metadata from IMDb/TMDB. Outputs results to ghibli_imdb_results.json.
  • transform_files.py:Transforms the metadata and file information into a Jellyfin-ready format, outputting ghibli_jellyfin_ready.json.
  • build_jellyfin_dir.py:Builds the target directory structure for Jellyfin using the transformed JSON. Supports options for dry-run, symlinking, renaming files/directories, and more.
  • sync_media.py:Synchronizes media files between directories, with support for dry-run and error logging.
  • Other utility scripts:

Usage Example

  1. Collect and Match Titles:

    python ghibili3.py ./anime --tmdb <TMDB_API_KEY>
    

This generates ghibli_imdb_results.json.

  1. Transform Metadata for Jellyfin:

    python transform_files.py
    

This generates ghibli_jellyfin_ready.json.

  1. Build Jellyfin Directory Structure:

    python build_jellyfin_dir.py ghibli_jellyfin_ready.json ./jellyfin_anime --symlink --rename-dir --dry-run
    

Remove --dry-run to actually create files and directories.

Requirements

  • Python 3.7+
  • requests library (for metadata fetching)

Install dependencies:

pip install requests

Directory Structure

  • anime/ — Original anime files, named in Chinese.
  • ghibli_imdb_results.json — Metadata results from IMDb/TMDB.
  • ghibli_jellyfin_ready.json — Jellyfin-ready metadata and file info.
  • jellyfin_anime/ — Output directory for Jellyfin import (created by scripts).

Notes

  • The scripts are designed for batch processing and assume a consistent directory structure.
  • Always use --dry-run first to preview changes before making modifications.
  • For best results, ensure your anime files are organized in per-title directories.

License

MIT License


This toolkit is not affiliated with Studio Ghibli or Jellyfin.