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
command line tool for frequent nmigen tasks (generate sources, show design)

nmigen-tool command line tool for frequent nmigen tasks (generate sources, show design) Usage: generate verilog: nmigen generate verilog nmigen_librar

Hans Baier 8 Nov 27, 2022
ghfetch is ai customizable CLI GitHub personal README generator.

ghfetch is ai customizable CLI GitHub personal README generator. Inspired by famous fetch such as screenfetch, neofetch and ufetch, the purpose of this tool is to introduce yourself as if you were a

Alessio Celentano 3 Sep 10, 2021
GanTTY - Project planning from the terminal

GanTTY - Project planning from the terminal

Timeo Sam Pochin 161 Dec 26, 2022
Python command line tool and python engine to label table fields and fields in data files.

Python command line tool and python engine to label table fields and fields in data files. It could help to find meaningful data in your tables and data files or to find Personal identifable informat

APICrafter 22 Dec 05, 2022
Pynavt is a cli tool to create clean architecture app for you including Fastapi, bcrypt and jwt.

Pynavt _____ _ | __ \ | | | |__) | _ _ __ __ ___ _| |_ | ___/ | | | '_ \ / _` \ \ / /

Alejandro Castillo 1 Dec 13, 2021
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.

Mohamed El Mouctar Haidara 424 Dec 20, 2022
Doro is a CLI based pomodoro app and countdown timer application built using python.

Doro - CLI based pomodoro app Doro is a CLI based pomodoro app and countdown timer application built using python. Install $ pip install doro Usage Po

Suresh Kumar 14 May 23, 2022
A linux-like remote terminal for Micropython

A linux-like remote terminal for Micropython

Christian Köver - Draxl 2 Nov 14, 2021
Free and Open-Source Command Line tool for Text Replacement

Sniplet Free and Open Source Text Replacement Tool Description: Sniplet is a work in progress CLI tool which can do text replacement globally in Linux

Veeraraghavan Narasimhan 13 Nov 28, 2022
🎄 Advent of Code command-line tool.

🎄 advent-cli advent-cli is a command-line tool for interacting with Advent of Code, specifically geared toward writing solutions in Python. It can be

Christian Ferguson 6 Dec 01, 2022
The project help you to quickly build layouts in terminal,cross-platform

The project help you to quickly build layouts in terminal,cross-platform

gojuukaze 133 Nov 30, 2022
MasterDuel Image Recognition Translation Command Line Tool

MasterDuelTranslate(Use Ygo Card DataBase,belong win32 window shot & image match)

PatchouliTC 77 Dec 01, 2022
Python-Stock-Info-CLI: Get stock info through CLI by passing stock ticker.

Python-Stock-Info-CLI Get stock info through CLI by passing stock ticker. Installation Use the following command to install the required modules at on

Ayush Soni 1 Nov 05, 2021
Simple CLI interface for linear task manager

Linear CLI (Unmaintained) Simple CLI interface for linear task manager Usage Install: pip install linearcli Setup: Generate a pe

Mike Lyons 1 Jan 07, 2022
spotifytools is a Python command line tool

spotifytools spotifytools is a Python command line tool Documentation The documentation is available on the following link Releases Instalation instru

0 Sep 28, 2021
CPOST is a CLI tool to assist with the proper sizing of Clara Deploy pipelines

CPOST (Clara Pipeline Operator Sizing Tool) Tool to measure resource usage of Clara Platform pipeline operators Cpost is a tool that will help you run

NVIDIA Corporation 5 Sep 27, 2021
Jupyter notebook client in neovim

🪐 Jupyter-Nvim Read jupyter notebooks in neovim Note: The plugin is still in alpha stage 👾 Usage Just open any *.ipynb file and voila! ✨ Contributin

Ahmed Khalf 85 Dec 29, 2022
Personal and work vim 8 configuration with submodules

vimfiles Windows Vim 8 configuration files based on the recommendations of Ruslan Osipov, Keep Your vimrc file clean and The musings of bluz71. :help

1 Aug 27, 2022
A ZSH plugin that enables you to use OpenAI's powerful Codex AI in the command line.

A ZSH plugin that enables you to use OpenAI's powerful Codex AI in the command line.

Tom Dörr 976 Jan 03, 2023
liquidctl – liquid cooler control Cross-platform tool and drivers for liquid coolers and other devices

Cross-platform CLI and Python drivers for AIO liquid coolers and other devices

1.7k Jan 08, 2023