/TMDB_fetcher-French

A python tool using the TMDB Movie data base API to build French speaking Movie sheets and download posters on a local disk drive.

Primary LanguagePythonOtherNOASSERTION

TMDB_fetcher-French

A python tool using the TMDB Movie data base API to build French speaking Movie sheets and download posters on a local disk drive.

This tool is used to walkthrough a Directory tree (typically an external disc drive of Usb Key) and looks for movie files. For each found movie is perporms :

  • Looks for the TMDB movie data base and tries to find a French title matching the file
  • Renames the file with the <French file name> - <year> format.
  • Builds a description sheet, stored besides the file , name is <film_name>_tmdb.txt
  • downloads the poster image for the film, stores is besides the film with same name.
  • Builds at the root folder a glbal catalog listing all the found movies on the diretctory tree
  • Optionnaly builds a Movies sheets document gathering all the movie sheets of the directory tree.

The tool is currently designed to fetch French language data (film titles, descriptions), and the outputs of the tool are in French. Howver, this could be easilly adapted to any languages as TMDB is an international data base.

TMDB api

  • TMDB API is a movie data base existing since 2008, see : https://pypi.org/project/tmdbv3api/

  • Compared with other data bases like IMDB, TMDB has the great advantage to be widely international and can provide results in any languages as well as search for movie titles in any language.

  • Important : A personnal TMDB key must be obtained from TMDB Web site. To do so, you must register an account at https://www.themoviedb.org/account/signup The key must be provided as a parameter.

Usage

python .\TMDB_fetcher.py --help
TMDB_fetcher.py script.

This tool allows for walking through a directory tree containing movie files and to query the TMDB movie database
in order to establish a note describing each found movie.
The note will have the same name as the movie file, with .txt extension.
As a default it will be located in the same place as the movie file.
A catalog can be established listing all the found files.

Note : A key must have prealably registered an account at https://www.themoviedb.org/account/signup
       and requested a key from your account.
       The key must be provided as a parameter.

Copyright Christophe Mineau - www.labellenote.fr
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License



Usage:
    TMDB_fetcher.py <path> --key=<TMDB_KEY> [--buildCatalog] [--sheet=<>] [--verbose] [--posters]
    TMDB_fetcher.py <path> --cleanup
    TMDB_fetcher.py  (-h | --help)

Options:
   -h --help               Get help.
  --version                Get this program version.
  --key=<key>              Key provided by TMDBapi.com, see http://www.TMDBapi.com/apikey.aspx
  --sheet=<single|individual|both>     individual : creates one description sheet per movie; single : 1 file describing all movies; both : both  [default: individual]
  --verbose                Prints all informations got from TMDB
  --buildCatalog           Builds a catalog file (MOVIE_CATALOG.TXT) of all movies found in the tree.
  --movieSheet=<1|2|3>     1 : one description sheet per movie; 2 : one file describing all movies; 3 : both  [default: 1]
  --posters                Downloads the poster of the film
  --cleanup                Removes all files generated by this tool.


Example:
  python TMDB_fetcher.py "E:\Videos" -k=abcdef
  python TMDB_fetcher.py "D:" -k=abcdef --buildCatalog --movieSheet=3


Dependencies

  • python 3
  • tmdbv3api => pip install tmdbv3api
  • json
  • argparse ==> pip install argparse
  • docopt ==> pip install docopt
  • textwrap
  • logging ==> pip install logging
  • import wget ==> pip install wget