Cleaner Script - Override the removal rule?

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
User avatar
LysanderM
Donor
Posts: 26
Joined: 20 Feb 2015, 12:56

Cleaner Script - Override the removal rule?

Post by LysanderM »

I'm using amc on my series.sh script on my Synology DS115j.

Code: Select all

#!/bin/sh
source /volume1/public/scripts/FileBot/filebotHelper.sh

$filebotApp -script fn:amc --db TheTVDB --action move --conflict skip -non-strict -r --def deleteAfterExtract=y clean=y plex="$plexServer" pushover="$pushOverToken" pushbullet="" "$seriesString" music=n subtitles=tr artwork=n "$seriesDownloadFolderUT" "ut_kind=single" "ut_state=5" "ut_file=" "ut_label=" --log-file "$logFile"

$filebotApp -script fn:cleaner -r "$seriesDownloadFolder" --log-file "$logFile"
My seriesDownloadFolder is the main download folder of the series, in which the series are moved after the download completed.
However, the downloaded file may contain original SRT files which are in English, etc..

If I execute this script, it result like this:

Code: Select all

Get [Turkish] subtitles for 8 files
Looking up subtitles by hash via OpenSubtitles
Matched [Da Vinci's Demons S01E02 720p BRRip AAC DD5.1 x264-PSYPHER.mp4] to [Da.Vincis.Demons.S01E02.720p.HDTV.x264-IMMERSE] via hash
Matched [Da Vinci's Demons S01E03 720p BRRip AAC DD5.1 x264-PSYPHER.mp4] to [da.vincis.demons.s01e03.720p.bluray.x264-demand-tur] via hash
Matched [Da Vinci's Demons S01E06 720p BRRip AAC DD5.1 x264-PSYPHER.mp4] to [da.vincis.demons.s01e06.720p.bluray.x264-demand-tur] via hash
Matched [Da Vinci's Demons S01E07 720p BRRip AAC DD5.1 x264-PSYPHER.mp4] to [da.vincis.demons.s01e07.720p.bluray.x264-demand] via hash
Matched [Da Vinci's Demons S01E01 720p BRRip AAC DD5.1 x264-PSYPHER.mp4] to [da.vincis.demons.s01e01.720p.bluray.x264-demand] via hash
Matched [Da Vinci's Demons S01E08 720p BRRip AAC DD5.1 x264-PSYPHER.mp4] to [da.vincis.demons.s01e08.720p.bluray.x264-demand] via hash
Matched [Da Vinci's Demons S01E04 720p BRRip AAC DD5.1 x264-PSYPHER.mp4] to [Da.Vincis.Demons.S01E04.The.Magician.HDTV.x264-ASAP] via hash
Matched [Da Vinci's Demons S01E05 720p BRRip AAC DD5.1 x264-PSYPHER.mp4] to [da.vincis.demons.s01e05.720p.bluray.x264-demand-tur] via hash
Fetching [da.vincis.demons.s01e01.720p.bluray.x264-demand.srt]
Export [da.vincis.demons.s01e01.720p.bluray.x264-demand.srt] as: SubRip / UTF-8
Writing [da.vincis.demons.s01e01.720p.bluray.x264-demand.srt] to [Da Vinci's Demons S01E01 720p BRRip AAC DD5.1 x264-PSYPHER.tur.srt]
Fetching [Da.Vincis.Demons.S01E02.720p.HDTV.x264-IMMERSE.srt]
Export [Da.Vincis.Demons.S01E02.720p.HDTV.x264-IMMERSE.srt] as: SubRip / UTF-8
Writing [Da.Vincis.Demons.S01E02.720p.HDTV.x264-IMMERSE.srt] to [Da Vinci's Demons S01E02 720p BRRip AAC DD5.1 x264-PSYPHER.tur.srt]
Fetching [da.vincis.demons.s01e03.720p.bluray.x264-demand-tur.srt]
Export [da.vincis.demons.s01e03.720p.bluray.x264-demand-tur.srt] as: SubRip / UTF-8
Writing [da.vincis.demons.s01e03.720p.bluray.x264-demand-tur.srt] to [Da Vinci's Demons S01E03 720p BRRip AAC DD5.1 x264-PSYPHER.tur.srt]
Fetching [Da.Vincis.Demons.S01E04.The.Magician.HDTV.x264-ASAP.srt]
Export [Da.Vincis.Demons.S01E04.The.Magician.HDTV.x264-ASAP.srt] as: SubRip / UTF-8
Writing [Da.Vincis.Demons.S01E04.The.Magician.HDTV.x264-ASAP.srt] to [Da Vinci's Demons S01E04 720p BRRip AAC DD5.1 x264-PSYPHER.tur.srt]
Fetching [da.vincis.demons.s01e05.720p.bluray.x264-demand-tur.srt]
Export [da.vincis.demons.s01e05.720p.bluray.x264-demand-tur.srt] as: SubRip / UTF-8
Writing [da.vincis.demons.s01e05.720p.bluray.x264-demand-tur.srt] to [Da Vinci's Demons S01E05 720p BRRip AAC DD5.1 x264-PSYPHER.tur.srt]
Fetching [da.vincis.demons.s01e06.720p.bluray.x264-demand-tur.srt]
Export [da.vincis.demons.s01e06.720p.bluray.x264-demand-tur.srt] as: SubRip / UTF-8
Writing [da.vincis.demons.s01e06.720p.bluray.x264-demand-tur.srt] to [Da Vinci's Demons S01E06 720p BRRip AAC DD5.1 x264-PSYPHER.tur.srt]
Fetching [da.vincis.demons.s01e07.720p.bluray.x264-demand.srt]
Export [da.vincis.demons.s01e07.720p.bluray.x264-demand.srt] as: SubRip / UTF-8
Writing [da.vincis.demons.s01e07.720p.bluray.x264-demand.srt] to [Da Vinci's Demons S01E07 720p BRRip AAC DD5.1 x264-PSYPHER.tur.srt]
Fetching [da.vincis.demons.s01e08.720p.bluray.x264-demand.srt]
Export [da.vincis.demons.s01e08.720p.bluray.x264-demand.srt] as: SubRip / UTF-8
Writing [da.vincis.demons.s01e08.720p.bluray.x264-demand.srt] to [Da Vinci's Demons S01E08 720p BRRip AAC DD5.1 x264-PSYPHER.tur.srt]
Rename episodes using [TheTVDB]
Auto-detected query: [Da Vincis Demons]
Fetching episode data for [Da Vinci's Demons]
Auto-detected query: [Da Vincis Demons]
Fetching episode data for [Da Vinci's Demons]
Auto-detected query: [Da Vincis Demons]
Fetching episode data for [Da Vinci's Demons]
[MOVE] Rename [/volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E01 720p BRRip AAC DD5.1 x264-PSYPHER.srt] to [/volume1/video/Diziler/Da Vinci's Demons/Season 01/Da Vinci's Demons S01E01 The Hanged Man.srt]
[MOVE] Rename [/volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E03 720p BRRip AAC DD5.1 x264-PSYPHER.srt] to [/volume1/video/Diziler/Da Vinci's Demons/Season 01/Da Vinci's Demons S01E03 The Prisoner.srt]
[MOVE] Rename [/volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E04 720p BRRip AAC DD5.1 x264-PSYPHER.srt] to [/volume1/video/Diziler/Da Vinci's Demons/Season 01/Da Vinci's Demons S01E04 The Magician.srt]
[MOVE] Rename [/volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E06 720p BRRip AAC DD5.1 x264-PSYPHER.srt] to [/volume1/video/Diziler/Da Vinci's Demons/Season 01/Da Vinci's Demons S01E06 The Devil.srt]
[MOVE] Rename [/volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E07 720p BRRip AAC DD5.1 x264-PSYPHER.srt] to [/volume1/video/Diziler/Da Vinci's Demons/Season 01/Da Vinci's Demons S01E07 The Hierophant.srt]
[MOVE] Rename [/volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E08 720p BRRip AAC DD5.1 x264-PSYPHER.srt] to [/volume1/video/Diziler/Da Vinci's Demons/Season 01/Da Vinci's Demons S01E08 The Lovers.srt]
[MOVE] Rename [/volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E02 720p BRRip AAC DD5.1 x264-PSYPHER.tur.srt] to [/volume1/video/Diziler/Da Vinci's Demons/Season 01/Da Vinci's Demons S01E02 The Serpent.srt]
[MOVE] Rename [/volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E05 720p BRRip AAC DD5.1 x264-PSYPHER.tur.srt] to [/volume1/video/Diziler/Da Vinci's Demons/Season 01/Da Vinci's Demons S01E05 The Tower.srt]
[MOVE] Rename [/volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E01 720p BRRip AAC DD5.1 x264-PSYPHER.mp4] to [/volume1/video/Diziler/Da Vinci's Demons/Season 01/Da Vinci's Demons S01E01 The Hanged Man.mp4]
[MOVE] Rename [/volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E02 720p BRRip AAC DD5.1 x264-PSYPHER.mp4] to [/volume1/video/Diziler/Da Vinci's Demons/Season 01/Da Vinci's Demons S01E02 The Serpent.mp4]
[MOVE] Rename [/volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E03 720p BRRip AAC DD5.1 x264-PSYPHER.mp4] to [/volume1/video/Diziler/Da Vinci's Demons/Season 01/Da Vinci's Demons S01E03 The Prisoner.mp4]
[MOVE] Rename [/volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E04 720p BRRip AAC DD5.1 x264-PSYPHER.mp4] to [/volume1/video/Diziler/Da Vinci's Demons/Season 01/Da Vinci's Demons S01E04 The Magician.mp4]
[MOVE] Rename [/volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E05 720p BRRip AAC DD5.1 x264-PSYPHER.mp4] to [/volume1/video/Diziler/Da Vinci's Demons/Season 01/Da Vinci's Demons S01E05 The Tower.mp4]
[MOVE] Rename [/volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E06 720p BRRip AAC DD5.1 x264-PSYPHER.mp4] to [/volume1/video/Diziler/Da Vinci's Demons/Season 01/Da Vinci's Demons S01E06 The Devil.mp4]
[MOVE] Rename [/volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E07 720p BRRip AAC DD5.1 x264-PSYPHER.mp4] to [/volume1/video/Diziler/Da Vinci's Demons/Season 01/Da Vinci's Demons S01E07 The Hierophant.mp4]
[MOVE] Rename [/volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E08 720p BRRip AAC DD5.1 x264-PSYPHER.mp4] to [/volume1/video/Diziler/Da Vinci's Demons/Season 01/Da Vinci's Demons S01E08 The Lovers.mp4]
Skipped [/volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E01 720p BRRip AAC DD5.1 x264-PSYPHER.tur.srt] because [/volume1/video/Diziler/Da Vinci's Demons/Season 01/Da Vinci's Demons S01E01 The Hanged Man.srt] already exists
Skipped [/volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E03 720p BRRip AAC DD5.1 x264-PSYPHER.tur.srt] because [/volume1/video/Diziler/Da Vinci's Demons/Season 01/Da Vinci's Demons S01E03 The Prisoner.srt] already exists
Skipped [/volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E04 720p BRRip AAC DD5.1 x264-PSYPHER.tur.srt] because [/volume1/video/Diziler/Da Vinci's Demons/Season 01/Da Vinci's Demons S01E04 The Magician.srt] already exists
Skipped [/volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E06 720p BRRip AAC DD5.1 x264-PSYPHER.tur.srt] because [/volume1/video/Diziler/Da Vinci's Demons/Season 01/Da Vinci's Demons S01E06 The Devil.srt] already exists
Skipped [/volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E07 720p BRRip AAC DD5.1 x264-PSYPHER.tur.srt] because [/volume1/video/Diziler/Da Vinci's Demons/Season 01/Da Vinci's Demons S01E07 The Hierophant.srt] already exists
Skipped [/volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E08 720p BRRip AAC DD5.1 x264-PSYPHER.tur.srt] because [/volume1/video/Diziler/Da Vinci's Demons/Season 01/Da Vinci's Demons S01E08 The Lovers.srt] already exists
Processed 22 files
Notify Plex: 192.168.1.10
http://192.168.1.10:32400/library/sections/all/refresh?X-Plex-Token=32400
Sending Pushover notification
Done ヾ(@⌒ー⌒@)ノ

Delete /volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E01 720p BRRip AAC DD5.1 x264-PSYPHER.tur.srt
Delete /volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E03 720p BRRip AAC DD5.1 x264-PSYPHER.tur.srt
Delete /volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E04 720p BRRip AAC DD5.1 x264-PSYPHER.tur.srt
Delete /volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E06 720p BRRip AAC DD5.1 x264-PSYPHER.tur.srt
Delete /volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E07 720p BRRip AAC DD5.1 x264-PSYPHER.tur.srt
Delete /volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Da Vinci's Demons S01E08 720p BRRip AAC DD5.1 x264-PSYPHER.tur.srt
Delete /volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/Facebook and twitter.txt
Delete /volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER/SilverTorrent.org.txt
Delete /volume1/video/Diziler_download/Da Vinci's Demons S01 Complete Season 1 720p BRRip x264 AAC DD5.1-PSYPHER
Done ヾ(@⌒ー⌒@)ノ
It's just skips moving the files -even if he founds the Turkish subtitles- which he thinks that are already exists.
rednoah wrote:... however it will also never touch any files in any folder that contains 1 video or more...
quotation link

Does filebot have the chance to bypass this case?
If so, BYPASSPARAMETER would solve my problem as in the following script:

Code: Select all

#!/bin/sh
source /volume1/public/scripts/FileBot/filebotHelper.sh

$filebotApp -script fn:cleaner -r "$seriesDownloadFolder" BYPASSPARAMETER --log-file "$logFile"

$filebotApp -script fn:amc --db TheTVDB --action move --conflict skip -non-strict -r --def deleteAfterExtract=y clean=y plex="$plexServer" pushover="$pushOverToken" pushbullet="" "$seriesString" music=n subtitles=tr artwork=n "$seriesDownloadFolderUT" "ut_kind=single" "ut_state=5" "ut_file=" "ut_label=" --log-file "$logFile"

$filebotApp -script fn:cleaner -r "$seriesDownloadFolder" --log-file "$logFile"
Or maybe an overwrite parameter for renaming would solve either.

LysanderM
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Cleaner Script - Override the removal rule?

Post by rednoah »

1.
--db is not used in the amc script. Instead you should use ut_label to force a certain mode. See manual for details.

2.
It's very strange that you don't set --output. It's best to set --output and not use absolute paths in the format unless necessary for some reason.

3.
If you have subtitles without language tag then that will be interpreted of <any language> and stop more subtitles of any language from being downloaded.

You might be able to ignore all subtitles using --def ignore. And then have filebot download new ones with correctly set language tags.

Or you can also adjust your format and add ".eng" to all subtitles files if you can assume that "no language" equals "english" for your purposes.
:idea: Please read the FAQ and How to Request Help.
Post Reply