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
The command line interface for Gradient - Gradient is an an end-to-end MLOps platform

Gradient CLI Get started: Create Account • Install CLI • Tutorials • Docs Resources: Website • Blog • Support • Contact Sales Gradient is an an end-to

Paperspace 58 Dec 06, 2022
Command line tool for monitoring changes of File entities scoped in a Synapse File View

Synapse Monitoring Provides tools for monitoring and keeping track of File entity changes in Synapse with the use of File Views. Learn more about File

Sage Bionetworks 3 May 28, 2022
Terminal epub reader with inline images

nuber Inspired by epy, nuber is an Epub terminal reader with inline images written with Rust and Python using Überzug. Features Display images in term

Moshe Sherman 73 Oct 12, 2022
A simple reverse shell in python

RevShell A simple reverse shell in python Getting started First, start the server python server.py Finally, start the client (victim) python client.py

Lojacopsen 4 Apr 06, 2022
Python CLI utility and library for manipulating SQLite databases

sqlite-utils Python CLI utility and library for manipulating SQLite databases. Some feature highlights Pipe JSON (or CSV or TSV) directly into a new S

Simon Willison 1.1k Jan 04, 2023
Universal Command Line Interface for Amazon Web Services

This package provides a unified command line interface to Amazon Web Services.

Amazon Web Services 13.3k Jan 07, 2023
Standalone Tailwind CSS CLI, installable via pip

Standalone Tailwind CSS CLI, installable via pip Use Tailwind CSS without Node.j

Tim Kamanin 144 Dec 22, 2022
Python Command Line Application (CLI) using Typer, SQLModel, Async-PostgrSQL, and FastAPI

pyflycli is a command-line interface application built with Typer that allows you to view flights above your location.

Kevin Zehnder 14 Oct 01, 2022
A CLI Password Manager made using Python and Postgresql database.

ManageMyPasswords (CLI Edition) A CLI Password Manager made using Python and Postgresql database. Quick Start Guide First Clone The Project git clone

Imira Randeniya 1 Sep 11, 2022
triggercmd is a CLI client for the TRIGGERcmd cloud service.

TriggerCMD CLI client triggercmd is a CLI client for the TRIGGERcmd cloud service. installation the triggercmd package is available in PyPI. to instal

Gustavo Soares 7 Oct 18, 2022
Lexeme - CLI to play a word-guessing game like Wordle

What is this? Python program to play a word-guessing game like Wordle, but… More addictive because you can play it over and over and over, not just on

Dan Lenski 6 Oct 26, 2022
CLI utility to search and download torrents from major torrent sites

CLI Torrent Downloader About CLI Torrent Downloader provides convenient and quick way to search torrent magnet links (and to run associated torrent cl

x0r0x 86 Dec 19, 2022
A python-based terminal application that displays current cryptocurrency prices

CryptoAssetPrices A python-based terminal application that displays current cryptocurrency prices. Covered Cryptocurrencies Bitcoin (BTC) Ethereum (ET

3 Apr 21, 2022
A simple CLI productivity tool to quickly display the syntax of a desired piece of code

Iforgor Iforgor is a customisable and easy to use command line tool to manage code samples. It's a good way to quickly get your hand on syntax you don

Solaris 21 Jan 03, 2023
A Yahtzee-solving python package and command line tool.

yahtzee A Yahtzee-solving python package and command line tool. The algorithm is mathematically guaranteed to have the best strategy. That is, it maxi

David Merrell 0 Aug 19, 2022
swarmexec executes command in swarm service

Swarmexec swarmexec executes command in swarm service Install pip install git+https://github.com/filimon43g/swarmexec.git Config In swarm_config.ini

Phil 2 Nov 23, 2021
Oil is a new Unix shell. It's our upgrade path from bash to a better language and runtime

Oil is a new Unix shell. It's our upgrade path from bash to a better language and runtime. It's also for Python and JavaScript users who avoid shell!

2.4k Jan 08, 2023
Cek Username IG Yang Masih Bisa Dipake

Cek Username IG Cara Install $ pkg update && pkg upgrade $ pkg install python $ pkg install git $ git clone https://github.com/Dekusec/ig-checker $ cd

Deku 3 Nov 28, 2021
ctree - command line christmas tree

ctree ctree - command line christmas tree It is small python script that prints a christmas tree in terminal. It is colourful and always gives you a d

15 Aug 15, 2022
A selfbot made with DPY, doesn't have much commands but there's some useful commands to use.

Phantom Selfbot A selfbot made in DPY, made by Zenith. How to use Add your token in token = 'YOUR-MOMS-TOKEN-HERE' Change the prefix in prefix = If

[Ͼ⁴] Ƶephyr 2 Dec 02, 2021