All Projects → caronc → nzbget-tidyit

caronc / nzbget-tidyit

Licence: LGPL-3.0 license
Will clean up your video media library by eliminating directories that no longer contain the video file they once hosted

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to nzbget-tidyit

fylm
A wonderful automated command line app for organizing your film media. Built for Plex and SABnzbd.
Stars: ✭ 25 (+31.58%)
Mutual labels:  nzbget, nzbget-script
Guides
Here you will find Guides mainly for Sonarr/Radarr/Bazarr and everything related to it.
Stars: ✭ 207 (+989.47%)
Mutual labels:  nzbget
Saltbox
Ansible-based solution for rapidly deploying a Docker containerized cloud media server.
Stars: ✭ 117 (+515.79%)
Mutual labels:  nzbget
Sickbeard mp4 automator
Automatically convert video files to a standardized format with metadata tagging to create a beautiful and uniform media library
Stars: ✭ 1,142 (+5910.53%)
Mutual labels:  nzbget
Sickgear
SickGear has proven the most reliable stable TV fork of the great Sick-Beard to fully automate TV enjoyment with innovation.
Stars: ✭ 452 (+2278.95%)
Mutual labels:  nzbget
Cloudbox
Ansible-based solution for rapidly deploying a Docker containerized cloud media server.
Stars: ✭ 1,763 (+9178.95%)
Mutual labels:  nzbget
YAPO-e-plus
YAPO e+ - Yet Another Porn Organizer (extended)
Stars: ✭ 92 (+384.21%)
Mutual labels:  video-library
nzb-monkey
Reference implementation of how to handle a NZBLNK-URI.
Stars: ✭ 65 (+242.11%)
Mutual labels:  nzbget
Thoradia
Thoradia Add-ons Repository
Stars: ✭ 208 (+994.74%)
Mutual labels:  nzbget
Muximux
A lightweight way to manage your HTPC
Stars: ✭ 1,008 (+5205.26%)
Mutual labels:  nzbget
Ppscripts
Post-processing scripts for Sick Beard, NzbDrone/sonarr and CouchPotato Server
Stars: ✭ 6 (-68.42%)
Mutual labels:  nzbget
Nzbtomedia
Provides NZB and Torrent postprocessing To CouchPotatoServer, SickBeard/SickRage, HeadPhones, Mylar and Gamez
Stars: ✭ 642 (+3278.95%)
Mutual labels:  nzbget
Plexguide.com
Welcome to https://PlexGuide.com ~ Rapidly deploy multiple-hasty Docker Containers through Ansible with local or Unlimited Google HD Space!
Stars: ✭ 1,631 (+8484.21%)
Mutual labels:  nzbget
Organizr
HTPC/Homelab Services Organizer - Written in PHP
Stars: ✭ 3,605 (+18873.68%)
Mutual labels:  nzbget
Gooby
Gooby: The ultimate infinite Plex media server using a VPS and Cloud service
Stars: ✭ 230 (+1110.53%)
Mutual labels:  nzbget
sherpa
a mini-package-manager for QNAP NAS
Stars: ✭ 63 (+231.58%)
Mutual labels:  nzbget
Nzb Subliminal
Fetches subtitles for the videos it's provided. It can be easily integrated into NZBGet and SABnzbd too.
Stars: ✭ 85 (+347.37%)
Mutual labels:  nzbget
Nzbget
Efficient Usenet Downloader
Stars: ✭ 819 (+4210.53%)
Mutual labels:  nzbget
Heimdall
As the name suggests Heimdall Application Dashboard is a dashboard for all your web applications. It doesn't need to be limited to applications though, you can add links to anything you like.
Stars: ✭ 3,501 (+18326.32%)
Mutual labels:  nzbget
Usenet Docker
Docker-compose configuration for Sabnzbd, CouchPotato, Plex, Sonarr, Plexpy, Nzbhydra, Muximux, Radarr, NZBGet and Ombi with a Nginx proxy.
Stars: ✭ 153 (+705.26%)
Mutual labels:  nzbget

Note: This script was intended to be an NZBGet and Scheduling script for NZBGet. However, it also works perfectly well as a standalone script for others too! It can be easily adapted to anyone's environment. See the Command Line section below for details how you can easily use this on it's own (without NZBGet).

Paypal

TidyIt Scheduler Script

TidyIt is a script designed to tidy up your video library; house cleaning one could say. It takes care of directories that once held video content, but now is just either empty, or contains old meta data and other junk.

This script is especially useful if you use a third party application such as Plex or KODI (XBMC) to manage your video library. It also works great for Synology devices too. In fact, most third party applications and/or appliances that allow you to remove a video from your library will only remove the video itself. They will not remove all the other content that surrounds it.

Since the primary focus of this script is to remove content from your media library, I will not be held responsible for any irrecoverable data loss you experience. I can confirm the tool works for me, but that doesn't mean it will work for you. The good news is that the script is filled with safe guards! Thus you'd have to stray far from the default settings to damage your library.

The script intentionally operates in a log only mode by default unless you explicitly specify it to run differently. I encourage you to run the script in this log only mode first anyway; get an idea as to what it wants to do and the files it wants to handle. If you're happy with its decisions, you can flip a switch (to the Move or Delete mode) and the script will begin tidying up your library as promised to you.

The script operates in 3 modes:

  • Preview: This is the default option. It runs the script and just reports to the screen what it would have otherwise done. It doesn't actually do anthing at all to your library though. This might be all you need as it's output can allow you to take your own actions. Alternatively this is a great method to run in until you get the options the way you like them.
  • Delete: This mode performs the same check the Preview does however anything flagged to be handled is removed.
  • Move: This mode moves handled content into another directory (that you identify). This allows you to review what is considered junk and decide for yourself if it should be removed. This method also requires you to be responsible for managing the directory you move content to.

Installation Instructions

  1. Ensure you have at least Python v2.7 or higher installed onto your system.
# Pull in dependencies:
pip install -r requirements.txt
  1. Simply place the TidyIt.py into your NZBGet scripts directory.
    • NZBGet users: you will want to place these inside of your nzbget/scripts directory. Please ensure you are running (at least) NZBGet v11.0 or higher. You can acquire the latest version of of it from here.

The Non-NZBGet users can also use this script via a cron (or simply call it from the command line) to automatically tidy their directories too. See the Command Line section below for more instructions on how to do this.

Command Line

TidyIt.py has a built in command line interface that can be easily tied to a cron entry or can be easilly called from the command line to automate the cleanup of your media libraries.

Here are the switches available to you:

Usage: TidyIt.py [options] [scandir1 [scandir2 [...]]]

Options:
  -h, --help            Show this help message and exit.
  -n ENCODING, --encoding=ENCODING
                        The system encoding to use (utf-8, ISO-8859-1, etc).
                        The default value is 'UTF-8'.
  -s ENTRIES, --safe-entries=ENTRIES
                        If a safe-entry file/dir is located within a path
                        scanned then the path is ignored. Use safe-entry files
                        (or dirs) to intentionally ignore directories of your
                        choice that reside in your video library. You can
                        specify more then one safe-entry by separating them
                        with a comma (,). The default value(s) are
                        '.tidysafe'.
  -t ENTRIES, --always-trash=ENTRIES
                        Identify any file extensions you wish to always trash
                        if matched. By default this is not set. You can
                        specify more then one trash entry by separating each
                        of them with a comma (,).
  -M ENTRIES, --meta-content=ENTRIES
                        Identify any files and/or directories that should be
                        treated as meta content. Meta content is only handled
                        if it's the last thing within a media directory. You
                        can specify more then one meta entry by separating
                        each of them with a comma (,). By Default the
                        following are already defined: 'Thumbs.db', '@eaDir',
                        '.wdtv', '.DS_Store', '.AppleDouble', '__MACOSX'.
  -m SIZE_IN_MB, --video-minsize=SIZE_IN_MB
                        Specify the minimum size a video must be before it's
                        treated as part of your collection. This value is used
                        to diffentiate between video file and samples files.
                        This value is interpreted in MB (Megabytes) and
                        defaults to 150 MB.
  -x ENTRIES, --video-extras=ENTRIES
                        Identify the extra files you keep around with your
                        video files as a comma delimited lit. The script will
                        scan for these files explicitly and remove them if a
                        video file bearing the same name is not found.  For
                        this reason you do not want to specify video
                        extensions here. This defaults to '.nfo,.??.srt,.srt,.
                        sub,.txt,.sub,.idx,.jpg,.tbn,.nzb,.xml,.diz' if
                        nothing is specified.
  -a AGE_IN_SEC, --min-age=AGE_IN_SEC
                        Specify the minimum age a directory and/or file must
                        be before considering it for processing. This value is
                        interpreted in seconds and defaults to 3600 sec(s).
  -c, --clean           Unless this switch is specified, this script only runs
                        in a log only mode (a dry-run) allowing you to see the
                        actions the script would have otherwise performed.
                        This switch can be combined with the --move-path (-p)
                        switch to move handled instead.
  -p PATH, --move-path=PATH
                        Identifiy the path to place content into instead of
                        removing it.  By specifying a --move-path, the --clean
                        (-c) switch is implied however handled content is
                        moved instead of being removed.
  -k, --keep-directories
                        Do not delete video directories during cleanup.
  -L FILE, --logfile=FILE
                        Send output to the specified logfile instead of
                        stdout.
  -D, --debug           Debug Mode

Here is a simple example:

# Scan your library (print only mode)
python TidyIt.py /usr/share/TVShows
# Happy with the results? Okay then run the script with the --clean (-c) switch:

python TidyIt.py -c /usr/share/TVShows

You can scan multiple directories with the following command:

# Scan your libraries (print only mode)
python TidyIt.py /usr/share/TVShows /usr/share/Movies

If you don't want your content to be removed; you can just have handled content moved to another directory for your review later on. All directory paths are preserved so it won't take any rocket science to figure out where the removed content came from. It's basically a safer mode then the --clean (-c) switch provides.

# Scan your libraries and move any content to be handled to the
# TidyIt.Trash in your home directory (~ is supported)
python TidyIt.py -m ~/TidyIt.Trash /usr/share/TVShows

If the script behaves as you expect it should, you can schedule it as a cron to frequently clean your libraries every day with a command such as:

# $> crontab -e
0 0 * * * /path/to/TidyIt.py -c /usr/share/TVShows /usr/share/Movies
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].