Fylm is a wonderful automated command line app for organizing your film media.

Overview

version Codacy Badge Build Status

Overview

Fylm is a wonderful automated command line app for organizing your film media. You can pronounce it Film or File 'em, whichever you like!

It uses (highly suspect) heuristics to identify film files (or folders), then looks them up on TMDb to get all the correct details. Once that's over and done with, it'll rename them according to your OCD standards, and move them.

Features

Fylm can:

  • Rename messy files and folders and make them pretty, like

    high.noon.1952.1080p.this.OTHER-JUNK » High Noon (1952) 1080p

  • Look film details up on TMDb so you don't have to, ensuring things are named correctly.

  • Check your library for duplicates and allow films with different qualities to be upgraded or ignored.

  • Notify your Plex Media Server when it adds something new.

  • Be wired up as a post-script for apps like SABnzbd (you'll want to use the --plaintext switch).

  • Delete extra files you don't want, moving only the important bits you care about.

  • Run in test mode so you can verify search results before committing.

  • Log what it does, so if (not saying they will, but if) things go sideways, you can see why.

  • Send you informative notifications to your phone when it does things.

Installing

Fylm is tested on 3.6, 3.7, and 3.8 and will attempt to adapt as the Python language does. As of Python 2.7 end of life, 2.X is no longer supported. v0.3.1 is the last version to support Python 3.5.

Installing dependencies is simple if you use pip. Depending on your OS configuration, you may need to install packages with sudo:

(sudo) pip install -r requirements.txt
// or
pip3 install -r requirements.txt

If you don't use pip, then you will need to install these manually, or download them and include them inside your copy of Fylm. Or shake a magic stick and hope it works (hint: it won't).

Configuring

All of Fylm's options are configured in config.yaml. Options of note that you should set up:

  • source_dirs
  • destination_dir
  • rename_pattern
  • tmdb.key
  • plex.baseurl
  • plex.token
  • plex.sections
  • pushover

If you're using Pushover, you might also want to add the Fylm logo to your app.

Running

If you don't want or need anything special, simply:

python fylm

from the root project folder will run the app.

However, since we're putting a lot of faith in machines and automation, there are times when you should walk before you run, and look before you leap. For that, there are several great command line options available to you. Most of these can be configured in config.yaml, but using the command line option will override whatever is in config:

--quiet, -q
--test, -t
--debug, -d
--rename, -r
--copy, -c
--move, -m
--hide-bad
--interactive, -i
--limit=n, -l
--pop=n, -p
--force-lookup, -f
--no-duplicates, -d
--overwrite, -o
--source, -s
--no-strict
--no-console
--plaintext
  • quiet will suppress notifications or updates to services like Plex.
  • test will run the app in sandbox mode, which means no changes will actually be performed on the filesystem. A good rule of thumb is to always test first before you run the app on a long list of files.
  • debug will run the app with some extra details (ok, verbose word porridge) in the console.
  • rename will just rename files and folders and leave them in the source folder.
  • copy will force files on the same partition to be copied and verified instead of moved.
  • move will force the behavior of move even if source and destination are on different partitions.
  • hide-bad will hide files and folders that are marked as bad from the console output. Disabled in interactive mode.
  • interactive prompt to confirm or correct TMDb matches.
  • limit=n limits the number of films to process to n.
  • pop=n will set the minimum acceptable TMDb 'popularity' ranking to n.
  • force-lookup will look everything in your source folder(s) up on TMDb, even if something doesn't appear to be a film. Helpful for finding files with missing years, but can take a lot longer to run.
  • no-duplicates will disable duplicate checking entirely.
  • overwrite means that any duplicates it finds at the destination will be overwritten, even if they are smaller or lower quality. Use with caution (and run --test first!). Only YOU can prevent data loss.
  • source overrides your usual source_dir setting with new source folder(s). Comma separate multiple folders.
  • no-strict will dramatically reduce the criteria that is is used to validate TMDb matches. Expect red herrings. Lots. So, --test first.
  • no-console will completely suppress console output. If you wanted that, for some reason.
  • plaintext will output to the console without pretty formatting. You'll want to use this option with SABnzbd.

If you'd like to run this automatically with some specific options, you can create a new file (e.g., post-script.py) and do:

#!/usr/bin/env python
import subprocess
subprocess.call(["python3", "/path/to/fylm/fylm", "-s", "/Volumes/Downloads", "--plaintext"])

Testing

Tests are run using pytest. To install:

(sudo) pip install -r requirements-test.txt

To run tests:

cd fylm/
python -m pytest -xq (--no-print-logs)

Contributing

Contributions are welcome! Please send in a PR with a clear explanation of what you're adding and why, and where applicable, add tests (a new test class, even!) to validate. Please read our code of conduct before contributing.

Credits

Murcury icon by Freepik from www.flaticon.com.

Special thanks to ansicolors.

License

Fylm is licensed under both the MIT License and the Hippocratic License. Were a conflict or dispute to arise between these two licenses, the Hippocratic License license shall take precedence. Under its principles of Do No Harm, no portion of this software may be used to (or be a part of software that can be used to) cause, infer, encourage, incite, or otherwise lead to physical or verbal harm for any person or people, especially marginalized and underrepresented people.

You might also like...
Get latest astronomy job and rumor news in your command line
Get latest astronomy job and rumor news in your command line

astrojobs Tired of checking the AAS job register and astro rumor mill for job news? Get the latest updates in the command line! astrojobs automaticall

organize your books on the command line

organize your books on the command line

Access hacksec.in from your command-line

Access hacksec.in from your command-line

Command line tool to keep track of your favorite playlists on YouTube and many other places.

Command line tool to keep track of your favorite playlists on YouTube and many other places.

🌈 Beautify your command line interfaces.
🌈 Beautify your command line interfaces.

Basics Install: pip install iridi Usage: import iridi # Create gradient text # iridi.print(message, colors, options) # Ask for input with gradient

A command line tool to query source code from your current Python env
A command line tool to query source code from your current Python env

wxc wxc (pronounced "which") allows you to inspect source code in your Python environment from the command line. It is based on the inspect module fro

A command line tool to create a graph representing your Ansible playbook tasks and roles
A command line tool to create a graph representing your Ansible playbook tasks and roles

Ansible Playbook Grapher ansible-playbook-grapher is a command line tool to create a graph representing your Ansible playbook plays, tasks and roles.

pyGinit is a command line tools that help you to initialize your current project a local git repo and remote repo

pyGinit pyGinit is a command line tools that help you to initialize your current project a local git repo and remote repo Requirements Requirements be

Baseline is a cross-platform library and command-line utility that creates file-oriented baselines of your systems.
Baseline is a cross-platform library and command-line utility that creates file-oriented baselines of your systems.

Baselining, on steroids! Baseline is a cross-platform library and command-line utility that creates file-oriented baselines of your systems. The proje

Comments
  • use rapidfuzz instead of fuzzywuzzy

    use rapidfuzz instead of fuzzywuzzy

    FuzzyWuzzy is GPLv2 licensed which would force you to licence the whole project under GPLv2. I had the same problem on one of my projects and so I wrote rapidfuzz which is implementing the same algorithm but is based on a version of fuzzywuzzy that was MIT Licensed and is therefor MIT Licensed aswell, so it can be used in here without forcing a License change. As a nice bonus it is fully implemented in C++ and comes with a few Algorithmic improvements making it between 5 and 100 times faster than FuzzyWuzzy.

    opened by maxbachmann 0
Releases(v0.4.1-beta)
  • v0.4.1-beta(Jul 2, 2022)

    Migrated CI to GitHub actions, improved test coverage and fixed an issue with multiprocessing pool (particularly in test runs).


    v0.4.0 (previous release notes)

    New:

    • Complete overhaul and rewrite with modern Python, based on pathlib and asyncio
    • All lookups are done in parallel, when you launch Fylm, because TMDb no longer rate-limits its API requests
    • Introduce FilmPath, a lowlevel subclass of Path to handle all Film and File operations
    • Fast, recursive searching of all src paths; intelligently identifies where a film root is
    • Duplicates are now handled on the fly, for each film, so new duplicates are caught in the same exec
    • Mapping direcory scans to films runs asyncronously, in parallel
    • Better naming of folders with multiple video files (e.g., 'Extras' is appended)
    • Interactive search now remembers the previous search query
    • Copying now safely moves duplicates to a temporary .dup~ file
    • Expanded scope of tests for increased stability
    • Improved console output
    • Interactive mode now supports upgrading all duplicates
    • Interactive mode now processes duplicates for each file in a src folder
    • Upgrades now compare quality of media as well as file size
    • New colors.yaml file to adjust your colors

    Breaking:

    • Double check your settings in config.yaml, there are a couple of minor changes
    Source code(tar.gz)
    Source code(zip)
  • v0.4.0-beta(May 21, 2021)

    New:

    • Complete overhaul and rewrite with modern Python, based on pathlib and asyncio
    • All lookups are done in parallel, when you launch Fylm, because TMDb no longer rate-limits its API requests
    • Introduce FilmPath, a lowlevel subclass of Path to handle all Film and File operations
    • Fast, recursive searching of all src paths; intelligently identifies where a film root is
    • Duplicates are now handled on the fly, for each film, so new duplicates are caught in the same exec
    • Mapping direcory scans to films runs asyncronously, in parallel
    • Better naming of folders with multiple video files (e.g., 'Extras' is appended)
    • Interactive search now remembers the previous search query
    • Copying now safely moves duplicates to a temporary .dup~ file
    • Expanded scope of tests for increased stability
    • Improved console output
    • Interactive mode now supports upgrading all duplicates
    • Interactive mode now processes duplicates for each file in a src folder
    • Upgrades now compare quality of media as well as file size
    • New colors.yaml file to adjust your colors

    Breaking:

    • Double check your settings in config.yaml, there are a couple of minor changes
    Source code(tar.gz)
    Source code(zip)
  • v0.3.1-beta(Mar 28, 2021)

    New:

    • Intelligent suggestions (upgrades & duplicate handling) in interactive mode
    • Quality-based upgrades (e.g., Bluray can upgrade WEBDL)
    • Improved duplicate checking and stability for duplicate removal
    • Support for HDR 4K files
    • Multiple duplicates support
    • Thanks to new intelligent upgrading, force override can better match its description
    • Improvements to console output, including source dir
    • Ability to hide skipped files in the console output now
    • Minimum file size can now be different per-resolution
    • Fylm is now published under Hippocratic License with additional fallback via GPLv3
    • Additional tests and bug fixes

    Note: this will be the last release that supports Python 3.5, as it is nearing and of life. Future versions will also take of asynchronous eventing, which isn't supported very well in 3.5.

    Breaking:

    • Several config.yaml structural changes for duplicates, see config.yaml for an example
    • Recommend backing up your config.yaml before upgrading
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0-beta(Nov 5, 2019)

    New:

    • New support for files and folders using different naming template
    • New support for multiple copies of a film in the same parent folder
    • Improved duplicate checking and stability for duplicate removal
    • Empty duplicate folders are cleaned up
    • Adjustments to improve accuracy of matching heuristic

    Breaking change:

    • config.yaml now requires both a file and folder rename_pattern
    Source code(tar.gz)
    Source code(zip)
  • v0.2.7-beta(Jul 7, 2019)

    • Fix Plex not properly updating after new release • Progress bar is now hidden in plaintext mode to make SABnzbd a little less cluttered

    (Suspect it may never have been working properly! Oh no)

    Source code(tar.gz)
    Source code(zip)
  • v0.2.6-beta(Jul 6, 2019)

    • Add back support for Python 3.5 and 3.7 (3.6 already supported) • Clean up and future-proofing for later versions of dependencies • alpha -> beta

    Source code(tar.gz)
    Source code(zip)
  • v0.2.5-beta(Nov 25, 2018)

    • Support for only Python 3.6, dropping support for 3.5 and 2.7
    • Ability to delete duplicates in interactive mode
    • Improved matching algorithm
    • Fixed endless loop for blank searches/0 results in interactive mode
    • Detect multi-part files
    • 'Unpacking' directories are now ignored
    • New --move and --copy switches to force move or copy behavior
    • Complete rewrite of console output module using builder pattern and new f-string formatting
    Source code(tar.gz)
    Source code(zip)
Owner
Brandon Shelley
Quantum foam traveler. UX / Product @ Google. Work with me at https://pacificaviator.co.
Brandon Shelley
A command-line based, minimal torrent streaming client made using Python and Webtorrent-cli. Stream your favorite shows straight from the command line.

A command-line based, minimal torrent streaming client made using Python and Webtorrent-cli. Installation pip install -r requirements.txt It use

Jonardon Hazarika 17 Dec 11, 2022
Ralph is a command-line tool to fetch, extract, convert and push your tracking logs from various storage backends to your LRS or any other compatible storage or database backend.

Ralph is a command-line tool to fetch, extract, convert and push your tracking logs (aka learning events) from various storage backends to your

France Université Numérique 18 Jan 5, 2023
A cd command that learns - easily navigate directories from the command line

NAME autojump - a faster way to navigate your filesystem DESCRIPTION autojump is a faster way to navigate your filesystem. It works by maintaining a d

William Ting 14.5k Jan 3, 2023
AML Command Transfer. A lightweight tool to transfer any command line to Azure Machine Learning Services

AML Command Transfer (ACT) ACT is a lightweight tool to transfer any command from the local machine to AML or ITP, both of which are Azure Machine Lea

Microsoft 11 Aug 10, 2022
Ros command - Unifying the ROS command line tools

Unifying the ROS command line tools One impairment to ROS 2 adoption is that all

null 37 Dec 15, 2022
Text based command line webcam photobooth app

Skunkbooth Why See it in action Usage Installation Run Media location Contributing Install Poetry Clone the repo Activate poetry shell Install dev dep

David Yang 45 Dec 26, 2022
Command line util for grep.app - Search across a half million git repos

grepgithub Command line util for grep.app - Search across a half million git repos Grepgithub uses grep.app API to search GitHub repositories, providi

Nenad Popovic 18 Dec 28, 2022
A simple command line chat app to communicate via the terminal.

A simple command line chat app to communicate via the terminal. I'm new to networking so sorry if some of my terminology or code is messed up.

PotNoodle 1 Oct 26, 2021
A lightweight Python module and command-line tool for generating NATO APP-6(D) compliant military symbols from both ID codes and natural language names

Python military symbols This is a lightweight Python module, including a command-line script, to generate NATO APP-6(D) compliant military symbol icon

Nick Royer 5 Dec 27, 2022
A very simple and lightweight ToDo app using python that can be used from the command line

A very simple and lightweight ToDo app using python that can be used from the command line

Nilesh Sengupta 2 Jul 20, 2022