Code: Select all
--apply import
Code: Select all
cmd /c filebot . -script fn:amc --action move --apply import --def movieFormat="N:\video\{plex}" ^
--def seriesFormat="U:\video\{plex}" --def excludeList="w:\filebot_logs\amc.txt" --def --output ^
w:\filebot_logs" --def minFileSize=0 --def minLengthMS=0 --def subtitles=en --def artwork=y ^
--def deleteAfterExtract=y --conflict auto -non-strict --log-file "w:\filebot_logs\filebot.log"
This script (with or without the --apply option) automates 80% of what I need to be done. But that remaining 20% is kinda sucky and I bet if I knew more I could wrap more into filebot, especially the manual step of moving featurettes folders to their new movie folders. I spot-tested --apply clean and it didn't do anything either, but I'm afraid of it anyway because I'm not sure what it thinks is clutter and it's not hard to bash declutter. So here is what I am running after filebot finishes:
Code: Select all
#!/usr/bin/bash
#
# Parse filebot log and remove files that were skipped/failed because they exist in output dir
# also cleanup garbage files, sample files
#
# This is designed to run under Windows 10 with Cygwin because WSL doesn't support mapped drives
# That means you'll notice some \r\n instead of just \n in the perl regexps.
#
# Looks for filebot.log in "W:\filebot_logs" - edit as needed if you're crazy enough to use this
# Looks for media files left after filebot run (the original source dir) in "W:\incoming\!NEWEST\(( MOVIES ))" - edit as needed
#
# I'm sure there is a better way, maybe entirely in filebot scripting,
# but I don't trust amc.txt exactly, and it grows over time
#
# The only remaining manual step is to copy extras/featurettes/etc dirs
# from extras_nosamples_manualcheck.txt to the appropriate destination (plex) folder
#
# Tested to work with filebot execution run.bat file from windows cmd prompt located inside top of media dir using this command; run AFTER filebot has run:
# cmd /c filebot . -script fn:amc --action move --def movieFormat="N:\video\{plex}" ^
# --def seriesFormat="U:\video\{plex}" --def excludeList="w:\filebot_logs\amc.txt" ^
# --def --output "w:\filebot_logs" --def minFileSize=0 --def minLengthMS=0 --def subtitles=en ^
# --def artwork=y --def deleteAfterExtract=y --conflict auto -non-strict
# --log-file "w:\filebot_logs\filebot.log"
#
echo "Deleting trash"
cd "W:\incoming\!NEWEST\(( MOVIES ))"
shopt -s nocaseglob
rm -f *\*.ske *\*.nfo *\*.txt *\*.exe *\*.me *\*.info *\*.jpg *\*.png *\*.gif *\*sample* \
*\*.html *\*.ico *\*.url *\*.torrent *\*.cbr *\*.!qb *\*.yify *\*.md5 *\*.sqlite *\*.bmp
shopt -u nocaseglob
echo " - Done"
cd "W:\filebot_logs"
echo "Creating scripts"
perl -p -e 's/\"//g; s/\“//g; s/\”//g;' filebot.log > filebot_noquotes.txt
grep "Skipped \[" filebot_noquotes.txt > skipped.txt
grep "Failed to process \[" filebot_noquotes.txt > failed.txt
grep "Ignore video extra" filebot_noquotes.txt > extras.txt
grep -i sample extras.txt > samples.txt
perl -p -e 's/Ignore video extra\: /rm -f \"/g; s/\r\n/\"\r\n/g' samples.txt > delete_samples.bash
grep -i -v sample extras.txt > extras_nosamples_manualcheck.txt
perl -p -e 's/Skipped \[/rm -f \"/g; s/\] because.*$/\"/g;' skipped.txt > delete_skipped.bash
perl -p -e 's/Failed to process \[/rm -f \"/g; s/\] because.*$/\"/g;' failed.txt > delete_failed.bash
echo "Deleting samples"
bash delete_samples.bash
echo " - Done"
echo "Deleting Skipped"
bash delete_skipped.bash
echo " - Done"
echo "Deleting Failed"
bash delete_failed.bash
echo " - Done"
2. Skipped versus Failed: what's the difference? Skipped says "because the file already exists." Failed says "because the file already exists and is an exact duplicate", or words to that effect. Is there a way to tell filebot to go ahead and delete the Failed and/or Skipped files? If they exist, I don't want to keep them (or script to delete them), especially if they are exact dupes.
3. Movies or TV shows with skip buzzwords in them like "trailer" or "extras": should I rename the dir and the files to nottrailer and notextras or tr@iler and extr@s, run filebot, and rename them back? Will filebot even recognize the movie/series properly to get nfo, pics, subtitles, etc? Or should I just rely on Plex for that?
4. Please feel free to mock my roundabout solutions to what may be simpler problems. I'd just like to learn more about filebot, hopefully without learning groovy script. I do not find it groovy at all If you think I should make a separate thread for this please let me know.