Skip to main content

local anime file database with deduplication and sorting

Project description

weltschmerz

Maintain a (local) database for anime files. Contains scripts to hash and sort anime files, as well as looking up files in AniDB utilizing the yumemi Python module.

This project is licensed under the terms of the MIT license. These third-party files are included:

  • pyselect.py: Copyright 2013 Matthew Behrens, under the terms of the MIT license.
  • sorttable.js: Copyright 2007 Stuart Langridge, under the terms of the X11/MIT license.

See also LICENSE.md

Requirements

  • Python 3 (>=3.6)
  • yumemi Python module (optional, for interacting with AniDB)
  • SQL database
    • PostgreSQL works, and is recommended
    • SQLite3 works, but does not support the numeric collation, edit anime.py: ep = Column(String(collation="numeric")) => ep = Column(String)

Configuration file

Copy weltschmerz.cfg.example to weltschmerz.cfg or $HOME/.config/weltschmerz/weltschmerz.cfg and adjust as necessary.

Import AniDB MyMist export

It is recommended to import your MyList first, as that will populate the Anime, Episode, and File tables.

  1. Request an xml-plain-full export of your MyList at AniDB - MyList Export
  2. Download export file
  3. Extract the export file:tar xf <mylist_export>.tgz
  4. Parse the export and populate the local database: ./parse_mylist_export.py --mylist-xml-files anime/a*.xml

Hash local files

weltschmerz files hash --folder /anime/by-id/00/00/01/ --folder /anime/by-id/00/00/02/

Add files to your AniDB MyList

Lookup the local files in AniDB and add them to your MyList, if they are present in AniDB. weltschmerz anidb lookup-files --folder /anime/by-id/00 --folder /anime/by-id/01 --debug --online --add-to-mylist --mylist-state 4

Deduplicate local files

Interactively deduplicate local files, as well as set the modified time of duplicate files to the oldest one. weltschmerz files remove-duplicates --preferred-directory-pattern /anime/by-id

Sort local files

Sort/Move files, this will put the files into folders according to their anime ids (padded to 6 digits) from AniDB. e.g. files for Seikai no Monshou (anime id 1) will be put in <target_basedir>/by-id/00/00/01.

weltschmerz files sort --source-basedir /anime/unsorted --target-basedir /anime

Create symlinks for local anime folders

To be able to look for local anime by name, create symlinks to point to the folders created by "Sort local files". This creates a by-name folder under the target basedir.

  1. Download anime titles dump (XML) from AniDB, see AniDB Wiki - API/Anime Titles for instructions.
  2. Decompress the title dump: gunzip anime-titles.xml.gz
  3. Run script to create the symlinks: ./animetitle.py anime-titles.xml /anime/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

weltschmerz-0.0.3.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

weltschmerz-0.0.3-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file weltschmerz-0.0.3.tar.gz.

File metadata

  • Download URL: weltschmerz-0.0.3.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for weltschmerz-0.0.3.tar.gz
Algorithm Hash digest
SHA256 1818d1e493be0033f62d8e5939fc4a92c122f5c5c1f35fe1eb9973a4e8addec4
MD5 bb7f477701ab7cd9e3fc0eabe69b9c28
BLAKE2b-256 74b4b4a597655854f4d2f8c9dcf6db9bed2fcca7a48427f13593ad2d51ad62cf

See more details on using hashes here.

File details

Details for the file weltschmerz-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: weltschmerz-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 22.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for weltschmerz-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 781e3005c4c1c65248c4e696f445f57e31fe5693b6e62ffb35c77f2289b6260e
MD5 c3f99731af8d935af019714609898638
BLAKE2b-256 01c07233b2c2477283b5dee8e8c7efd610b6c408c107e13b286a9be5054224ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page