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
Open-Source Python CLI package for copying DynamoDB tables and items in parallel batch processing + query natural & Global Secondary Indexes (GSIs)

Python Command-Line Interface Package to copy Dynamodb data in parallel batch processing + query natural & Global Secondary Indexes (GSIs).

1 Oct 31, 2021
Wordle for CLUE - WORDLE clone for Adafruit Clue

Wordle_for_CLUE This project is a clone of the very popular word solving puzzle

Michael Lacock 4 Feb 15, 2022
A terminal spreadsheet multitool for discovering and arranging data

VisiData v2.6.1 A terminal interface for exploring and arranging tabular data. VisiData supports tsv, csv, sqlite, json, xlsx (Excel), hdf5, and many

Saul Pwanson 6.2k Jan 04, 2023
CLI tool that helps manage shell libraries.

shmgr CLI tool that helps manage shell libraries. Badges 📛 project status badges: version badges: tools / frameworks used by test suite (i.e. used by

Bryan Bugyi 0 Dec 15, 2021
A CLI based task manager tool which helps you track your daily task and activity.

CLI based task manager tool This is the simple CLI tool can be helpful in increasing your productivity. More like your todolist. It uses Postgresql as

ritik 1 Jan 19, 2022
Darkdump - Search The Deep Web Straight From Your Terminal

Darkdump - Search The Deep Web Straight From Your Terminal About Darkdump Darkdump is a simple script written in Python3.9 in which it allows users to

Josh Schiavone 264 Dec 30, 2022
Wik is use to get information about anything on the shell using Wikipedia.

WIK wik is a tool to view wikipedia pages from your terminal. It also let you search for any wikipedia up to date article on one query from your termi

Yash Singh 340 Dec 18, 2022
Command line interface to watch your childhood shows in hindi and english, designed with python

Sweet dreams: Most of your childhood shows Command line interface to watch your

Not Your Surya 3 Feb 13, 2022
Management commands to help backup and restore your project database and media files

Django Database Backup This Django application provides management commands to help backup and restore your project database and media files with vari

687 Jan 04, 2023
Magnificent app which corrects your previous console command.

The Fuck The Fuck is a magnificent app, inspired by a @liamosaur tweet, that corrects errors in previous console commands. Is The Fuck too slow? Try t

Vladimir Iakovlev 75k Jan 02, 2023
TUIFIManager - A cross-platform terminal-based file manager

TUIFI Manager A cross-platform terminal-based file manager (and component), mean

142 Dec 26, 2022
Dark powered asynchronous completion framework for neovim/Vim8

deoplete.nvim Dark powered asynchronous completion framework for neovim/Vim8 Note: The development of this plugin is finished. Accepts minor patches a

Shougo 5.9k Dec 30, 2022
Use case: quick JSON processing/restructuring with jq without terminal

alfred-jq Alfred workflow to conveniently process JQ on clipboard based on a jq query Also available at: packal/jq Use case: quick JSON processing/res

T on Meta Mode 5 Sep 30, 2022
Convert markdown to HTML using the GitHub API and some additional tweaks with Python.

Convert markdown to HTML using the GitHub API and some additional tweaks with Python. Comes with full formula support and image compression.

phseiff 70 Dec 23, 2022
Get Air Quality Index for your city/country 😷

Air Quality Index CLI Get Air Quality index for your City. Installation $ pip install air-quality-cli Contents Air Quality Index CLI Installation Cont

Yankee 40 Oct 21, 2022
A Reverse Shell Python Packages

A Reverse Shell Python Packages

1 Nov 03, 2021
NudeNet wrapper made to provide a simple cli interface to the library

Nudenet Wrapper. Small warpper script for NudeNet Made to provide a small and easy to use cli interface with the library. You can indicate a single im

1 Oct 20, 2021
Automated CI toolchain to produce precompiled opencv-python, opencv-python-headless, opencv-contrib-python and opencv-contrib-python-headless packages.

OpenCV on Wheels Pre-built CPU-only OpenCV packages for Python. Check the manual build section if you wish to compile the bindings from source to enab

OpenCV 3.2k Jan 04, 2023
Cthulhu is a simple python CLI application that streams torrents directly from 1337x.

Cthulhu is a simple python CLI application that facilitates the streaming of torrents directly from 1337x. It uses webtorrent to stream video

Raiyan 27 Dec 27, 2022
Command Line Based Todo Script

Todo-CLI Features Full-Fledged Command Line Based Todo List with the following features planned: Interactive Interface OS Notifications Save and Remov

DSC IIEST 5 Nov 17, 2021