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
Python and data science snippets on the command line

Python Snippet Tool A tool to get Python and data science snippets at Data Science Simplified on the command line. You can read my article to learn ho

Khuyen Tran 19 Dec 21, 2022
YouCompleteMe: a code-completion engine for Vim

YouCompleteMe: a code-completion engine for Vim Help, Advice, Support Looking for help, advice or support? Having problems getting YCM to work? First

24.5k Jan 06, 2023
Easily handle day to day CLI operation via Python instead of regular Bash programs.

pz Ever wished to use Python in Bash? Would you choose the Python syntax over sed, awk, ...? Should you exactly know what command would you use in Pyt

CZ.NIC 697 Jan 03, 2023
Code for the Open Data Day 2022 publicbodies.org Nepal data scraping activities.

Open Data Day Publicbodies.org Nepal We've gathered on Saturday, 5th March 2022 with Open Knowledge Nepal in order to try and automate the collection

Augusto Herrmann 2 Mar 12, 2022
Rover is a command line interface application that allows through browse through mission data, images, metadata from the NASA Official Website

🤖 rover Rover is a command line interface application that allows through browse through mission data, images, metadata from the NASA Official Websit

Saketha Ramanjam 4 Jan 19, 2022
Commandline Python app to Autodownload mediafire folders and files.

Commandline Python app to Autodownload mediafire folders and files.

Tharuk Renuja 3 May 12, 2022
A CLI Application to detect plagiarism in Source Code Files.

Plag Description A CLI Application to detect plagiarism in Source Code Files. Features Compare source code files for plagiarism. Extract code features

default=dev 2 Nov 10, 2022
jrnl is a simple journal application for the command line.

jrnl To get help, submit an issue on Github. jrnl is a simple journal application for the command line. You can use it to easily create, search, and v

jrnl 5.7k Dec 31, 2022
💻 Physics2Calculator - A simple and powerful calculator for Physics 2

💻 Physics2Calculator A simple and powerful calculator for Physics 2 🔌 Predefined constants pi = 3.14159... k = 8988000000 (coulomb constant) e0 = 8.

Dylan Tintenfich 4 Dec 01, 2021
Just a shell writed on Python

HIGHSHELL (also hSH or HS) Just a shell writed on Python Send bug report • How to use the shell • Broked features • Licenses How to use the shell Inst

0LungSkill0 2 Jan 04, 2022
CLI tool to show the current crypto balance

CryptoBoard The simple python CLI tool for one currency to show the current crypto balance yours purchases. That's all. Data source is from https://ww

John 2 Nov 18, 2021
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 05, 2023
Enlighten Progress Bar is a console progress bar library for Python.

Overview Enlighten Progress Bar is a console progress bar library for Python. The main advantage of Enlighten is it allows writing to stdout and stder

Rockhopper Technologies 265 Dec 28, 2022
Themes for the kitty terminal emulator

Themes for the kitty terminal This is a collection of themes for the kitty terminal emulator. The themes were initially imported from dexpota/kitty-th

Kovid Goyal 190 Jan 05, 2023
Ipylivebash - Run shell script in Jupyter with live output

ipylivebash ipylivebash is a library to run shell script in Jupyter with live ou

Ben Lau 6 Aug 27, 2022
A CLI tools to get you started on any project in any language

Any Template A faster easier to Quick start any programming project. Installation pip3 install any-template Features No third party dependencies. Tem

Adwaith Rajesh 2 Jan 11, 2022
Run an FFmpeg command and see the percentage progress and ETA.

Run an FFmpeg command and see the percentage progress and ETA.

25 Dec 22, 2022
Simple command-line implementation of minesweeper

minesweeper This is a Python implementation of 2-D Minesweeper! Check out the tutorial here: https://youtu.be/Fjw7Lc9zlyU You start a game by running

Kylie 49 Dec 10, 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
Command line interface for unasync

CLI for unasync Command line interface for unasync Getting started Install Run the following command to install the package with pip: pip install unas

Leynier Gutiérrez González 3 Apr 04, 2022