Skip to content

Command Line

Justin edited this page Jan 3, 2021 · 4 revisions

Utilizing the CLI is a bit more powerful as it allows you to override certain functions of this script. In addition you can set up a cronjob to call it on a regular basis to catch any missed or previously unavailable trailers.


Arguments

  • -d Required: Directory. Defines the directory to parse
  • -r Optional: Recursive. Use this to scan an entire library
  • -t Optional: Title. Use this to force a title (Must be used with year)
  • -y Optional: Year. Use this to force a year (Must be used with title)
  • -q Optional: Quiet. Use this to limit stdout messages to only post scan stats (useful for cron jobs)
  • -imdb Optional: IMDB id. Use this to force an IMDBid
  • -tmdb Optional: TMDB id. Use this to force a TMDBid
  • --use_threads Optional: Threads. Use this with recursive mode to speed up processing time. (careful this can be resource intensive)
  • --delete_corrupt Optional: Check for corruption in your local trailers, remove them, then attempt to download a new one.

Usage Examples

Get a trailer for a specific movie directory

  • TrailerTech.py -d "/path/to/movieFolder"

Get a trailer while ignoring some data found in the movie directory

  • TrailerTech.py -imdb 12345 -d "/path/to/movieFolder"
  • TrailerTech.py -tmdb tt12345 -d "/path/to/movieFolder"
  • TrailerTech.py -t MovieTitle -y 1999 -d "/path/to/movieFolder"

Get trailers for an entire library

  • TrailerTech.py -rd "/path/to"
  • TrailerTech.py --use_threads -rd "/path/to"

CronJob setup to run once a week on Sunday

  1. Open a terminal window
  2. To edit your cron jobs crontab -e
  3. At the end of the file enter 0 0 * * 0 /usr/bin/python3 /path/to/script/TrailerTech.py --use_threads -rd "/path/to" >/dev/null 2>&1

Clone this wiki locally