AMC and the Show "Debris"

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Raxnar
Posts: 6
Joined: 16 Mar 2021, 04:09

AMC and the Show "Debris"

Post by Raxnar »

For some reason the AMC Script keeps moving the show I am downloading called Debris to a folder called "Space Debris". While this is a valid show it is not the show that is being downloaded.

Here is the script being used.

Code: Select all

filebot.launcher.exe -script fn:amc --output "E:\Media" --action duplicate -non-strict "E:\download\sickrage" --log-file E:\media\amc.log --def excludeList=amc.txt --def exec="curl 'http:\\localhost:8081\api\<REDACTED> cmd=show.refresh&tvdbid={info.id}'"
Here is the output of the AMC.LOG entry for this show.
Input: E:\Download\Sickrage\Debris.S01E03.Solar.Winds.1080p.HDTV.x264-aFi[xsp]\afi-debris.s01e03.1080p.mkv
Group: {Series=afi debris} => [afi-debris.s01e03.1080p.mkv]
Rename episodes using [TheTVDB] with [Airdate]
Lookup via [afi debris]
Fetching episode data for [Space Debris]
[DUPLICATE] from [E:\Download\Sickrage\Debris.S01E03.Solar.Winds.1080p.HDTV.x264-aFi[xsp]\afi-debris.s01e03.1080p.mkv] to [E:\Media\TV Shows\Space Debris\Season 01\Space Debris - S01E03 - There Be Monsters.mkv]
Processed 1 file
Here is the Sysinfo output.
C:\Users\Raxnar>filebot -script fn:sysinfo
Initialize Logs folder: C:\Users\Raxnar\AppData\Roaming\FileBot\logs
Current application revision (r8340) does not match cache revision (r8046): reset cache
Initialize new disk cache: C:\Users\Raxnar\AppData\Roaming\FileBot\cache\0
FileBot 4.9.3 (r8340)
JNA Native: 6.1.0
MediaInfo: 20.09
7-Zip-JBinding: 16.02
Tools: fpcalc/1.5.0
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2021-02-22 (r738)
Groovy: 3.0.7
JRE: OpenJDK Runtime Environment 15.0.2
JVM: 64-bit OpenJDK 64-Bit Server VM
CPU/MEM: 12 Core / 4.3 GB Max Memory / 36 MB Used Memory
OS: Windows 10 (amd64)
STORAGE: NTFS [(C:)] @ 85 GB | NTFS [Data 2] @ 5 TB | NTFS [Data] @ 13 TB
DATA: C:\Users\Raxnar\AppData\Roaming\FileBot
Package: MSI
Activate License [REDACTED] on [Mon Mar 15 21:19:02 PDT 2021]
License: FileBot License [REDACTED] (Valid-Until: 2068-10-17)
Done ?(?????)?
I am fairly certain I can fix this with a --Filter argument but have wracked my brain and cannot get it to work...
--Filter 'n != "Space Debris"'
.

Yet it keeps generating errors which is likely because I'm not understanding something from the documentation and Formatting :(

Or is there a better way to correct this than --Filter?

This script is working flawlessly otherwise from QBitTorrent.

Many Thanks!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC and the Show "Debris"

Post by rednoah »

The --filter option should work:
viewtopic.php?t=2127

e.g.

Code: Select all

--filter "n != 'Space Debris'"

:idea: Please post the console output if you continue to have trouble.


:idea: Keep in mind that single quote '...' only works in bash and PowerShell, but not CMD so it likely can't be used in qBT either. Please read Cmdline and Argument Passing for details.



EDIT:

Since you're using qBT, you'll want to keep the command template as simple as possible, and bundle all the complexity into external text files.


You can pass your --filter expression as *.groovy text file:

Code: Select all

--filter C:/TheGreatFilter.groovy

You can furthermore reduce the entire argument sequence to a single external text file:

Code: Select all

filebot @C:/MyFileBotCommand.txt --def "ut_label=%L" "ut_title=%N" "ut_kind=multi" "ut_dir=%F"

:idea: Please read @file syntax for details.
:idea: Please read the FAQ and How to Request Help.
Raxnar
Posts: 6
Joined: 16 Mar 2021, 04:09

Re: AMC and the Show "Debris"

Post by Raxnar »

I appreciate the details but a lot of what you are referencing is foreign to me. I am not a code writer.

Since it seems I cannot just use --filter "n != 'Space Debris'", I am trying the .groovy method you mention.

contents of the Groovy file should just be the double quoted section?
filter.groovy content would then be

Code: Select all

"n != 'Space Debris'"
Or should the .groovy file also contain --filter?
Edit: I tried this, made things worse.

When I now run this code, which will be what resides in QB.

Code: Select all

filebot.launcher.exe -script fn:amc --output "E:\Media" --action duplicate -non-strict "E:\download\sickrage" --filter e:\media\filter.groovy --log-file E:\media\amc.log --def excludeList=amc.txt --def exec="curl 'http:\\localhost:8081\api\<REDACTED>?cmd=show.refresh&tvdbid={info.id}'"
No errors are generated however it is not filtering the miss match and moves the file to the wrong folder for Space Debris.

Here is the Log Output running the command with the --filter + Groovy file:

Code: Select all

Input: E:\Download\Sickrage\Debris.S01E03.Solar.Winds.1080p.HDTV.x264-aFi[xsp]\afi-debris.s01e03.1080p.mkv
xattr: [afi-debris.s01e03.1080p.mkv] => [Space Debris - 1x03 - There Be Monsters]
Group: {Series=space debris} => [afi-debris.s01e03.1080p.mkv]
Rename episodes using [TheTVDB] with [Airdate]
Lookup via [Space Debris]
Fetching episode data for [Space Debris]
Apply filter ["n != 'Space Debris'"] on [14] options
Include [Space Debris - 1x01 - Pilot Error]
Include [Space Debris - 1x02 - Sensor of the Beholder]
Include [Space Debris - 1x03 - There Be Monsters]
Include [Space Debris - 1x04 - Sound in Space]
Include [Space Debris - 1x05 - Casual Friday]
Include [Space Debris - 1x06 - The Best Medicine]
Include [Space Debris - 2x01 - Boys' Club]
Include [Space Debris - 2x02 - The Slip]
Include [Space Debris - 2x03 - The One with Time Travel]
Include [Space Debris - 2x04 - Cult Classic]
Include [Space Debris - 2x05 - The Ol' Switcheroo]
Include [Space Debris - 2x06 - Captain For a Day]
Include [Space Debris - 2x07 - Milton's Brain]
Include [Space Debris - 2x08 - Christmas in Space]
[14] options remaining
[DUPLICATE] from [E:\Download\Sickrage\Debris.S01E03.Solar.Winds.1080p.HDTV.x264-aFi[xsp]\afi-debris.s01e03.1080p.mkv] to [E:\Media\TV Shows\Space Debris\Season 01\Space Debris - S01E03 - There Be Monsters.mkv]
Processed 1 file
Execute: curl 'http:\\localhost:8081\api\<REDACTED>?cmd=show.refresh&tvdbid=329038'
Done ヾ(@⌒ー⌒@)ノ
Even if I look at this shows folder in the GUI for FileBot it miss matches the show.
Image

If I try to run this using a script file...

script.txt containing:

Code: Select all

-script
fn:amc
--output E:\Media
--action duplicate -non-strict E:\download\sickrage
--log-file @path\media\amc.log
--filter E:\Media\filter.groovy
--def excludeList=amc.txt
--def exec=curl `http:\\localhost:8081\api\603a8aa2b3e782787cd19116fce1488b?cmd=show.refresh&tvdbid={info.id}`
This is what happens.

Code: Select all

E:\Media>filebot @e:\media\script.txt

Did you read the manual?
└ https://www.filebot.net/cli.html

Did you quote and escape your arguments correctly?
└ https://www.filebot.net/help/args.html

args[1] = -script
args[2] = fn:amc
args[3] = --output E:\Media
args[4] = --action duplicate -non-strict E:\download\sickrage
args[5] = --log-file @path\media\amc.log
args[6] = --filter E:\Media\filter.groovy
args[7] = --def excludeList=amc.txt
args[8] = --def exec=curl `http:\\localhost:8081\api\<REDACTED>?cmd=show.refresh&tvdbid={info.id}`

Failed to read text file: --filter E:\Media\filter.groovy
I am running all these tests from a command prompt, as I presume that's what QB will be doing.

I also tried removing -non-strict but that did not help.

Could we be chasing a problem that is really with TVDB?

Well while writing my story above I may have the filter working now? but it won't match to the proper show...

I figured out, please correct me if I'm wrong that the content of the .groovy file needed to be:

Code: Select all

n != 'Space Debris'
without the double quotes.

Logs:

Code: Select all

Input: E:\Download\Sickrage\Debris.S01E03.Solar.Winds.1080p.HDTV.x264-aFi[xsp]\afi-debris.s01e03.1080p.mkv
xattr: [afi-debris.s01e03.1080p.mkv] => [Space Debris - 1x03 - There Be Monsters]
Group: {Series=space debris} => [afi-debris.s01e03.1080p.mkv]
Rename episodes using [TheTVDB] with [Airdate]
Lookup via [Space Debris]
Fetching episode data for [Space Debris]
Apply filter [n != 'Space Debris'] on [14] options
Exclude [Space Debris - 1x01 - Pilot Error]
Exclude [Space Debris - 1x02 - Sensor of the Beholder]
Exclude [Space Debris - 1x03 - There Be Monsters]
Exclude [Space Debris - 1x04 - Sound in Space]
Exclude [Space Debris - 1x05 - Casual Friday]
Exclude [Space Debris - 1x06 - The Best Medicine]
Exclude [Space Debris - 2x01 - Boys' Club]
Exclude [Space Debris - 2x02 - The Slip]
Exclude [Space Debris - 2x03 - The One with Time Travel]
Exclude [Space Debris - 2x04 - Cult Classic]
Exclude [Space Debris - 2x05 - The Ol' Switcheroo]
Exclude [Space Debris - 2x06 - Captain For a Day]
Exclude [Space Debris - 2x07 - Milton's Brain]
Exclude [Space Debris - 2x08 - Christmas in Space]
[0] options remaining
Failed to identify or process any files
Finished without processing any files
Abort (×_×)
Looks like the filter worked and BUT instead of going and matching the proper show it decided to completely skip the show and not process it. :(

Open to other ways to fix this mismatch so that I don't have to manually move the show each time.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: AMC and the Show "Debris"

Post by kim »

Looks like you are testing on a file that already is "tagged" and renamed

Code: Select all

xattr: [afi-debris.s01e03.1080p.mkv] => [Space Debris - 1x03 - There Be Monsters]

try clear xattr
viewtopic.php?t=324
viewtopic.php?p=5394#p5394
Raxnar
Posts: 6
Joined: 16 Mar 2021, 04:09

Re: AMC and the Show "Debris"

Post by Raxnar »

I don't believe so, the destination where the show is supposed to go is clear of the file and the AMC.txt file had the record of the file purged.

File Bot is just simply mismatching the show to Space Debris. Would like to know how to correct this.

https://thetvdb.com/series/debris
That is the show it should be matching.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC and the Show "Debris"

Post by rednoah »

Raxnar wrote: 19 Mar 2021, 23:25 Looks like the filter worked and BUT instead of going and matching the proper show it decided to completely skip the show and not process it. :(
The correct Debris match somehow not being an option in the first place seems to be the root cause of you getting the wrong Space Debris match instead.


:arrow: You will likely have to resort to using the GUI for this one.


:arrow: If automation is desired at all costs, then you could add an additional filebot command that picks out the Debris episodes to process them separately with a forced series ID via the --file-filter and --q options. But this is not something that you can integrate into the amc script script call you already have. This path will require you to get comfortable with basic CMD or PowerShell scripting, so I'd probably just use the GUI if this is a one-off issue for you and specific to this one series.
:idea: Please read the FAQ and How to Request Help.
Raxnar
Posts: 6
Joined: 16 Mar 2021, 04:09

Re: AMC and the Show "Debris"

Post by Raxnar »

That's unfortunate but I think I understand.

I honestly don't see this show lasting very long.

Appreciate your time on this.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: AMC and the Show "Debris"

Post by kim »

A quick test in GUI:

on 1st run:
problem = group = "afi"
Filebot is not the best a handling if e.g. show name is not 1st...
test remove "afi"

if 2+ run aka = renamed / "tagged":
problem is "tagged" aka xattr info or nfo file
clear xattr
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: AMC and the Show "Debris"

Post by kim »

You can use e.g. this:

Code: Select all

--filter "!readLines('Path\\tvdb_excludes.txt').join().findAll(/\d+[^(\d{4})]/)*.toInteger().contains(id)"
tvdb_excludes.txt:

Code: Select all

 id	Name of TV Show / Movie
-------------------------------
329038	Space Debris (2015)
EDIT:

Code: Select all

[DEPRECATED] readLines() is deprecated. Please use lines() instead.
Not tested so if lines works ?
Raxnar
Posts: 6
Joined: 16 Mar 2021, 04:09

Re: AMC and the Show "Debris"

Post by Raxnar »

Interesting, I don't fully understand the code you wrote but may play with it.

I did get the exclude filter to work though, the issue is it is not moving on to match the next show for some reason. So if I use the filter, it just skips the show entirely.

Thanks!
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: AMC and the Show "Debris"

Post by kim »

Sound like you made an include list not exclude ?

include = lines + "383491 Debris (2021)"
exclude = !lines + "329038 Space Debris (2015)"

only exclude will work for other shows

if correct you need to share the log
Raxnar
Posts: 6
Joined: 16 Mar 2021, 04:09

Re: AMC and the Show "Debris"

Post by Raxnar »

No it was an exclude list for sure.

Anyway, this last weekend the next episode downloaded and without any modifications to my original script it was processed 100% correctly.

Perhaps something was fixed in the TVDB the Filebot/AMC script were gathering?

Don't know but it worked perfectly finally.
Post Reply