do you want this management script released?

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
cafevincent
Posts: 54
Joined: 22 Jun 2017, 10:08

do you want this management script released?

Post by cafevincent »

my personal media manager batch script has gotten so versatile you might wanna hear about it. I need to know if there is need for this to be released.

this 17 script cluster runs continuously on a delayed loop. you keep the command prompt open and follow a very simplified, readable output of what's happening (with color coding for each script), and the ability to interact in certain situations. each loop lasts a fraction of a second if no job is found, and ends in a main menu sort of prompt line that allows user to access functions like saveable debug settings (i.e. verbal mode or toggle echo for each script individually), fast duplicate video checking and collection caring.

it has a powerful importing script that handles downloads from a generic downloads directory. it should be generically compatible. I use it for qbittorrent, jdownloader and handbrake incoming files. it extracts any archive, can prompt user for a password, and empties recycle bin if out of space to operate. it is set to put videos, mp3s, roms and others into different directories. it applies gain to mp3s. videos get integrated subtitles off opensubtitles and a filebot rename for added searchable information like movie director, genres, certification, rating, v/a quality and finally, the imdb tag that can be used to quick access the imdb page for each video. renaming has a intricate quality control system in place to make sure no video gets mislabeled.

another power tool here is the teachable quick sorting mechanism that uses easily adjustable database files filled with scored keywords to sort the videos, allowing for a much more complex, better serving directory structure. this, together with other sorting mechanisms allow for things like auto-hide porn, collect single (pilot) episodes, separation of short and long duration videos.

this is what it looks like.

Image

import is grey, declaring the found complete directory. the others are displaying the resulting file when a change of name or location has been achieved. green is the renaming process, white is sort by length, red ones are sorted by the keyword sorter.

this way your downloads are taken care of, your files are moved where they can be found, additional information is readily available and searchable. so, together with icaros thumbnailer and directory opus which supports unlimited thumbnail sizes I believe this can be a proper replacement for a media manager/launcher. it is for me.

I currently have it set up to service this folder structure (capital letters)

Code: Select all

+---MUSIC
|   \---NEW (mp3)
+---GAMES
|   \---RETROARCH
|       \---PAYLOAD (for roms)
+---NVIDIA (hidden porn, outside videos dir so they won't show up in playlists)
+---SOURCE (new files come here, I have this junctioned to the SSD drive)
\---VIDEOS
    +---MOVIES
    |   +---CONCERTS
    |   +---DOCUMENTARIES
    |   |   +---SCARCITY
    |   |   +---GLOBALISTS
    |   |   +---DISINFORMATION
    |   |   +---AGENDAS
    |   |   +---ABUNDANCE
    |   +---FEATURES
    |   |   +---ACTION
    |   |   +---COMEDY
    |   |   +---CRIME
    |   |   +---DRAMA
    |   |   +---FANTASY
    |   |   +---HORROR
    |   |   +---MYSTERY
    |   |   +---SCIENCE
    |   |   +---THRILLER
    |   |   +---VENTURE
    |   |   +---WARFARE
    |   |   \---WESTERN
    |   +---FEATURETTES
    |   +---PORNOGRAPHY (porn you can admit to, like andrew blake films)
    |   +---PSYCHEDELIC
    |   \---STANDUP
    +---SERIES
    |   +---COMEDY
    |   |   +---CARTOON
    |   |   +---CLASSIC
    |   |   +---MODERN
    |   |   +---REALITY
    |   |   +---SKETCH
    |   |   \---STANDUP
    |   +---PILOTS (could be divided by genre)
    |   +---REALITY
    |   +---STORIES (normal series)
    |   \---TRIPPY
    \---SHORTS
        +---CONSPIRACIES
        +---ENTERTAINING (youtube funnies + awesome)
        +---MEDIA (film/tv/game related)
        |   +---ANALYSIS (in-depth)
        |   +---EXTRAS
        |   +---FACTS
        |   +---FANDOM (trailer edits etc tributes)
        |   +---FEATURES
        |   +---GAMES
        |   \---TRAILERS
        +---MUSIC
        |   +---BIGBEAT
        |   +---CLASSICAL
        |   +---CLUBBING (anything with a steady beat)
        |   +---COUNTRY
        |   +---DUB
        |   +---ELECTRO
        |   +---EXPERIMENTAL
        |   +---GEEKY
        |   +---METAL
        |   +---RAP
        |   +---REGGAE
        |   +---ROCK
        |   +---SWING
        |   +---SYNTHWAVE
        |   +---TRIPHOP
        |   \---XXX
        +---PSYCHEDELIC
        \---USEFUL (youtube tidbits)
sorting in directories like documentaries, music, media is very difficult, so a clean directory is very unlikely but it helps a lot. the specifics on what each script does is in the next post, please read on
Last edited by cafevincent on 20 Sep 2018, 14:24, edited 22 times in total.
cafevincent
Posts: 54
Joined: 22 Jun 2017, 10:08

Re: wanna see my take on HTPC automation?

Post by cafevincent »

Scripts and their functions:

launch.cmd

Code: Select all

one 300s looping row that functions as the main menu. a prompt to choose a command, adjust a few settings. the echo on the whole script cluster is designed to complement this management style, where only minimal 1-line outputs are echoed, unless verbal mode is enabled. [i]list[/i] shows new files added today.
import.cmd

Code: Select all

detects completed files in a directory. I use it with qbittorrent, handbrake, jdownloader and others. for videos it integrates subs off internet, renames them to include info like certification, genre, rating, movie director etc. then moves them to videos root for futher sorting. also applies gain balancing for mp3 before moving, and puts emulator roms to a single location for retroarch. other release types get moved to d:\ root for manual filing.
direct.cmd

Code: Select all

director of sorting videos to the collection, executing different methods like keywords, duration and file counting and nesting.
report.cmd

Code: Select all

hands over call requests between batch files, echoing accurately their logical progression in the process tree. sets a helpful color scheme to output of each script using colorx/echox. management script are grey/white, naming related are green, filing related are red/violet, etc. in verbal mode also echoes defined variables for bug hunting. also allows for echo control for each individual script.
echoes.cmd

Code: Select all

displays a sort of 2-line settings screen with sort of checkboxes to control echo on/off for each individual script. massively helpful for bug hunting. the settings here are saved to appdata.
Image

handle.cmd

Code: Select all

basically uses filebot to rename files in a super strict way so there should be no misnamed files ever. it does this by doing a comparison of original name and filebot name, among other things. anything that does not match will be prompted for the user to approve, which can either be with or without automatic timeout.
reader.cmd

Code: Select all

extrapolates filename into variables such as name, year, episode tag etc. used by handle.cmd and others. can decipher some complex season/episode tags, fast.
unpack.cmd

Code: Select all

extracts all archives in a directory tree and deletes them. prompts user for a password if required. tries to use the most used password fanedit.org first automatically. empties out the recycle bin if out of space. also does archives within archives.
subber.cmd

Code: Select all

fetches english and finnish subtitles and integrates them. easy to customize. also removes chapters because they are annoying as they are forced in MPC-HC. removal is recommended only here, when desired subtitles are already fetched by the popular hash. uses filebot, mkvmerge and mkvpropedit.
retype.cmd

Code: Select all

changes specifics in the filename such as removing problematic characters for scripts. changes complex movie/tv certifications to simple, more searchable k13, k17 etc.
sorter.cmd

Code: Select all

uses a database of scored keywords to sort files in a directory into subdirectories. can do things like hide most of your porn. just add your own keywords to make it smarter. stores a log of sorted files with their word scores so you can adjust your scores better. difficult sort jobs like short\media it runs at 1:100 chance to reduce workload.
length.cmd

Code: Select all

sorts videos based on length, specifically it divides remaining files in collection root after series and porn are moved away. under 26min are shorts, the rest are movies of some sort. adjustable. uses ffprobe.
pilots.cmd

Code: Select all

operates in series root, calculating if each new file is a first in the series and if so places it to dedicated pilots directory. if a second file in a show is added, the pilot will be collected for further filing by sorter.cmd and nester.cmd. allows double pilots.
nester.cmd

Code: Select all

creates a directory for each individual series.
extras.cmd

Code: Select all

when a extras or featurettes dir exists the content usually is missing the name of the movie. this renames the extras to include that name. these are special flagged in length.cmd to be excluded from automatic sorting further from the videos root so they can be manually approved. also does some pre-emptive deleting like `trailers` meaning a video with all the trailers in a row. annoying.
upkeep.cmd

Code: Select all

a caring program for the video collection. looks for duplicate files with amazing speed for manual comparison using name, size and duration in different combinations. can be set to update other things in the collection, all at once or little by little. things like add subs, rename, retype. could also auto-delete to recycle bin if confident enough. can be set to run at a specific time of the week. does around 3000 files/hour.
lookup.cmd

Code: Select all

add this to the right-click menu in explorer to open the imdb page for files that include the imdb tag in one click. it can also spot a file ending in `fanedit` in which case it will open the fanedit.org page for that edit instead. note that fanedits need to be specifically named, manually.
would this be something of interest? is it too specific for me? should I release this? I just need to run through the code to check everything is in good order first.
Last edited by cafevincent on 20 Sep 2018, 17:19, edited 4 times in total.
cafevincent
Posts: 54
Joined: 22 Jun 2017, 10:08

Re: do you want this management script released?

Post by cafevincent »

really? no comments?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: do you want this management script released?

Post by rednoah »

Don't be discouraged. Some people will read this and use this. There just isn't so many users that check the forums on weekdays and this thread is barely a day old.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: do you want this management script released?

Post by kim »

I have seen people ask about some of the stuff your scripts does.

If you can share or better make a version with only stuff that is about subs, duplicate file or filebot...
that is I don't think people want/needs the sorting parts ?

The more standalone the parts are the better, so people can take/use only the parts they need

EDIT: I think I can use the "handle.cmd"
Last edited by kim on 20 Sep 2018, 22:33, edited 2 times in total.
cafevincent
Posts: 54
Joined: 22 Jun 2017, 10:08

Re: do you want this management script released?

Post by cafevincent »

good idea. I could make it so the director part checks what parts of the script you've downloaded and executes the ones it finds. same could be done for the sorter, each directory comes with it's own database. if that database is missing then that directory would not be forked.
howdymilsap
Posts: 35
Joined: 14 Jul 2018, 17:22

Re: do you want this management script released?

Post by howdymilsap »

so this is pretty incredible. Will you release your code on github? I'd like to take a look - most likely I wouldn't be implementing the entire set of scripts (I need the {plex} folder structure), but some of the supporting scripts and logic would be interesting to take a look at.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: do you want this management script released?

Post by kim »

any scripts coming ?
Post Reply