Custom AMC features (AniDB Maps, Sonarr, Couchpotato, etc)

Running FileBot from the console, Groovy scripting, shell scripts, etc
cowmix
Power User
Posts: 30
Joined: 09 Jan 2015, 11:03

Custom AMC features (AniDB Maps, Sonarr, Couchpotato, etc)

Post by cowmix »

I've been using filebot on my server at home and have added some automation features that people might find useful or rednoah might want to merge into the official script :)

Additonal features:
  • Notify Sonarr to update series disk scan (Use this with disabled rename and completed download move in sonarr)
    example usage: "sonarr=<url>:<port>/<basepath>|<token>"
  • Notify Couchpotato to update series disk scan (Use this with disabled rename in couchpotato)
    example usage: "potato=<url>:<port>/<basepath>|<token>"
  • Updated Plex to only update libraries that have changed instead of entire library,
    example usage: "plex=<url>:<port>|<token>"
  • Search video files for embedded subtitles and skip opensubtitle search if found
  • Search AniDB but use TVDB for seasons and episode listing
    (uses the amazing list mapping from https://github.com/ScudLee/anime-lists)
    (primayTitle is updated with AniDB title, n is TVDB)
  • Search AniDB but use TMDB for movie renaming
    (uses the amazing list mapping from https://github.com/ScudLee/anime-lists)
    (primayTitle is updated with AniDB title, n is TMDB)
  • Some hopefully good updates to anime detection, may be buggy since I primarily use label detection
  • Do not notify Sonarr, Plex, CouchPotato or Pushbullet if running in test mode
  • Switch to dvd order in TVDB if bluray/dvd/bdrip/dvdrip tags found


https://github.com/cowmix88/Filebot-Scripts

Features may be buggy, I recommend using rednoah's more stable default version if you don't know what your doing.
Last edited by cowmix on 08 Dec 2015, 10:13, edited 2 times in total.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by rednoah »

Good job. I guess you had a good look through the code! :D

Had a look at those AniDB<->TheTVDB/TheMovieDB mappings. Didn't know somebody collects all that data. Might come in handy sometime.

As for grabbing stuff from GitHub I'd make sure to cache it locally so it doesn't have to be fetched every time:

Code: Select all

def dom = new net.filebot.web.CachedXmlResource(urlString).getDocument()
:idea: Please read the FAQ and How to Request Help.
cowmix
Power User
Posts: 30
Joined: 09 Jan 2015, 11:03

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by cowmix »

Thanks! I was looking for a way to cache but I wasn't sure how. I've updated the gist.

I looked through the code a lot, especially to see how I could use the ids I was receiving from the mapping list and I was happy to see that you were handling a lot of it already so I could just grab the name from the id and re-pass it in the query. Thanks for open source :)

Edit: updated to anime movie mapping to use tmdb ids in xml file isntead of imdb ids if present
psicotron3
Posts: 3
Joined: 17 Feb 2014, 22:25

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by psicotron3 »

Nice script. Was expecting for something like that for a while.

I just tested and it worked fine, but gave an error at the end of the processos. I don´t know yet what´s wrong, because the files were renamed correctly.

This is the log:

Code: Select all

Parameter: excludeList = D:/Marcelo/amc.txt
Argument: D:\Media\Videos\Anime\Zankyou no Terror
Roots: [D:\Media\Videos\Anime\Zankyou no Terror]
Input: D:\Media\Videos\Anime\Zankyou no Terror\Zankyou no Terror - 01 - Falling.mkv
Input: D:\Media\Videos\Anime\Zankyou no Terror\Zankyou no Terror - 02 - Call & Response.mkv
Input: D:\Media\Videos\Anime\Zankyou no Terror\Zankyou no Terror - 03 - Search & Destroy.mkv
Input: D:\Media\Videos\Anime\Zankyou no Terror\Zankyou no Terror - 04 - Break Through.mkv
Input: D:\Media\Videos\Anime\Zankyou no Terror\Zankyou no Terror - 05 - Hide & Seek.mkv
Input: D:\Media\Videos\Anime\Zankyou no Terror\Zankyou no Terror - 06 - Ready or Not.mkv
Input: D:\Media\Videos\Anime\Zankyou no Terror\Zankyou no Terror - 07 - Deuce.mkv
Input: D:\Media\Videos\Anime\Zankyou no Terror\Zankyou no Terror - 08 - My Fair Lady.mkv
Input: D:\Media\Videos\Anime\Zankyou no Terror\Zankyou no Terror - 09 - Highs & Lows.mkv
Input: D:\Media\Videos\Anime\Zankyou no Terror\Zankyou no Terror - 10 - Helter Skelter.mkv
Input: D:\Media\Videos\Anime\Zankyou no Terror\Zankyou no Terror - 11 - Von.mkv
Group: [anime:terror in resonance] => [Zankyou no Terror - 01 - Falling.mkv, Zankyou no Terror - 02 - Call & Response.mkv, Zankyou no Terror - 03 - Search & Destroy.mkv, Zankyou no Terror - 04 - Break Through.mkv, Zankyou no Terror - 05 - Hide & Seek.mkv, Zankyou no Terror - 06 - Ready or Not.mkv, Zankyou no Terror - 07 - Deuce.mkv, Zankyou no Terror - 08 - My Fair Lady.mkv, Zankyou no Terror - 09 - Highs & Lows.mkv, Zankyou no Terror - 10 - Helter Skelter.mkv, Zankyou no Terror - 11 - Von.mkv]
Found: Anime Series in AniDb: [10537] => [Zankyou no Terror]
Succes: Mapping AniDb to TVDB: [Zankyou no Terror] => [Terror in Resonance, Season: 1]
Rename episodes using [TheTVDB]
Fetching episode data for [Terror in Resonance]
Apply Filter: {s == 1}
Include [Terror in Resonance - 1x01 - Falling]
Include [Terror in Resonance - 1x02 - Call & Response]
Include [Terror in Resonance - 1x03 - Search & Destroy]
Include [Terror in Resonance - 1x04 - Break Through]
Include [Terror in Resonance - 1x05 - Hide & Seek]
Include [Terror in Resonance - 1x06 - Ready or Not]
Include [Terror in Resonance - 1x07 - Deuce]
Include [Terror in Resonance - 1x08 - My Fair Lady]
Include [Terror in Resonance - 1x09 - Highs & Lows]
Include [Terror in Resonance - 1x10 - Helter Skelter]
Include [Terror in Resonance - 1x11 - VON]
[HARDLINK] Rename [D:\Media\Videos\Anime\Zankyou no Terror\Zankyou no Terror - 01 - Falling.mkv] to [D:\Marcelo\Anime\Terror in Resonance\Season 01\Zankyou no Terror - 1x01 - Falling.mkv]
[HARDLINK] Rename [D:\Media\Videos\Anime\Zankyou no Terror\Zankyou no Terror - 02 - Call & Response.mkv] to [D:\Marcelo\Anime\Terror in Resonance\Season 01\Zankyou no Terror - 1x02 - Call & Response.mkv]
[HARDLINK] Rename [D:\Media\Videos\Anime\Zankyou no Terror\Zankyou no Terror - 03 - Search & Destroy.mkv] to [D:\Marcelo\Anime\Terror in Resonance\Season 01\Zankyou no Terror - 1x03 - Search & Destroy.mkv]
[HARDLINK] Rename [D:\Media\Videos\Anime\Zankyou no Terror\Zankyou no Terror - 04 - Break Through.mkv] to [D:\Marcelo\Anime\Terror in Resonance\Season 01\Zankyou no Terror - 1x04 - Break Through.mkv]
[HARDLINK] Rename [D:\Media\Videos\Anime\Zankyou no Terror\Zankyou no Terror - 05 - Hide & Seek.mkv] to [D:\Marcelo\Anime\Terror in Resonance\Season 01\Zankyou no Terror - 1x05 - Hide & Seek.mkv]
[HARDLINK] Rename [D:\Media\Videos\Anime\Zankyou no Terror\Zankyou no Terror - 06 - Ready or Not.mkv] to [D:\Marcelo\Anime\Terror in Resonance\Season 01\Zankyou no Terror - 1x06 - Ready or Not.mkv]
[HARDLINK] Rename [D:\Media\Videos\Anime\Zankyou no Terror\Zankyou no Terror - 07 - Deuce.mkv] to [D:\Marcelo\Anime\Terror in Resonance\Season 01\Zankyou no Terror - 1x07 - Deuce.mkv]
[HARDLINK] Rename [D:\Media\Videos\Anime\Zankyou no Terror\Zankyou no Terror - 08 - My Fair Lady.mkv] to [D:\Marcelo\Anime\Terror in Resonance\Season 01\Zankyou no Terror - 1x08 - My Fair Lady.mkv]
[HARDLINK] Rename [D:\Media\Videos\Anime\Zankyou no Terror\Zankyou no Terror - 09 - Highs & Lows.mkv] to [D:\Marcelo\Anime\Terror in Resonance\Season 01\Zankyou no Terror - 1x09 - Highs & Lows.mkv]
[HARDLINK] Rename [D:\Media\Videos\Anime\Zankyou no Terror\Zankyou no Terror - 10 - Helter Skelter.mkv] to [D:\Marcelo\Anime\Terror in Resonance\Season 01\Zankyou no Terror - 1x10 - Helter Skelter.mkv]
[HARDLINK] Rename [D:\Media\Videos\Anime\Zankyou no Terror\Zankyou no Terror - 11 - Von.mkv] to [D:\Marcelo\Anime\Terror in Resonance\Season 01\Zankyou no Terror - 1x11 - VON.mkv]
Processed 11 files
StringIndexOutOfBoundsException: String index out of range: -1
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at java_lang_String$substring$5.call(Unknown Source)
	at Script1$_run_closure67_closure122.doCall(Script1.groovy:411)
	at Script1$_run_closure67.doCall(Script1.groovy:409)
	at Script1$_run_closure71.doCall(Script1.groovy:576)
	at Script1.run(Script1.groovy:467)
	at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:61)
	at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:82)
	at net.filebot.cli.ArgumentProcessor.process(ArgumentProcessor.java:109)
	at net.filebot.Main.main(Main.java:183)
Failure (°_°)
And the command line used:

Code: Select all

D:\Media>filebot -script "D:/Media/Videos/amcanidb-20150116.groovy" --output "D:
/Marcelo" --log-file "D:/Marcelo/amc.log" --action hardlink --conflict skip -non
-strict "D:/Media/Videos/Anime/Zankyou no Terror" --def excludeList="D:/Marcelo/
amc.txt" clean=n
theo2889
Posts: 2
Joined: 28 Oct 2015, 07:33

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by theo2889 »

cowmix wrote:I've been using filebot on my server at home and have added some automation features that people might find useful or rednoah might want to merge into the official script :)

Additonal features:
  • Notify Sonarr to update series disk scan (Use this with disabled rename and completed download move in sonarr)
    example usage: "sonarr=<url>:<port>/<basepath>|<token>"
  • Notify Couchpotato to update series disk scan (Use this with disabled rename in couchpotato)
    example usage: "potato=<url>:<port>/<basepath>|<token>"
  • Updated Plex to only update libraries that have changed instead of entire library,
    example usage: "plex=<url>:<port>|<token>"
  • Search video files for embedded subtitles and skip opensubtitle search if found
  • Search AniDB but use TVDB for seasons and episode listing
    (uses the amazing list mapping from https://github.com/ScudLee/anime-lists)
    (primayTitle is updated with AniDB title, n is TVDB)
  • Search AniDB but use TMDB for movie renaming
    (uses the amazing list mapping from https://github.com/ScudLee/anime-lists)
    (primayTitle is updated with AniDB title, n is TMDB)
  • Some hopefully good updates to anime detection, may be buggy since I primarily use label detection
  • Do not notify Sonarr, Plex, CouchPotato or Pushbullet if running in test mode
  • Switch to dvd order in TVDB if bluray/dvd/bdrip/dvdrip tags found


https://github.com/cowmix88/Filebot-Scripts

Features may be buggy, I recommend using rednoah's more stable default version if you don't know what your doing.
I keep getting a failed error at the end of this script. It seems to function correctly with everything except telling sonarr to update. Here is how I have it setup...

Code: Select all

filebot -script fn:C:\Users\theoo\AppData\Roaming\FileBot\amc-sonarr.groovy --conflict override -non-strict --def "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" "seriesFormat=F:/Videos/TV Shows/{n}/{s00e00} - {t}" "movieFormat=F:/Videos/Movies/{n} {[y, rating]}/{n}" excludeList=amc.txt "sonarr=localhost:8989/C:\ProgramData\NzbDrone\bin|022a4d2827c54d50802de3ac4c703021"
Here is the what I get when the script runs...

Code: Select all

>filebot -script C:\Users\theoo\AppData\Roaming\FileBot\amc-sonarr.groovy --output "F:/Videos" --log-file amc.log --action copy --conflict override -non-strict --def "ut_label=tv-sonarr" "ut_state=5" "ut_title=Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS" "ut_kind=multi" "ut_file=marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.nfo" "ut_dir=D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS" "movieFormat=F:/Videos/Movies/{n} {[y, rating]}/{n}"
Locking C:\Users\theoo\AppData\Roaming\FileBot\logs\amc.log
Parameter: ut_label = tv-sonarr
Parameter: ut_state = 5
Parameter: ut_title = Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS
Parameter: ut_kind = multi
Parameter: ut_file = marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.nfo
Parameter: ut_dir = D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS
Parameter: movieFormat = F:/Videos/Movies/{n} {[y, rating]}/{n}
Roots: [D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS]
Read archive [marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.rar] and extract to [D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS]
Skipped extracting files [D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS.mkv]
Input: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS.mkv
Exclude: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.nfo
Exclude: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.r00
Exclude: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.r01
Exclude: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.r02
Exclude: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.r03
Exclude: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.r04
Exclude: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.r05
Exclude: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.r06
Exclude: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.r07
Exclude: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.r08
Exclude: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.r09
Exclude: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.r10
Exclude: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.r11
Exclude: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.r12
Exclude: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.r13
Exclude: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.r14
Exclude: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.r15
Exclude: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.r16
Exclude: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.r17
Exclude: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.r18
Exclude: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.sfv
Exclude: D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\Sample\sample-marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers.mkv
Group: [order:airdate, tvs:marvels agents of s h i e l d] => [Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS.mkv]
Using TV Order: airdate
Rename episodes using [TheTVDB]
Auto-detected query: [Marvels Agents of S H I E L D]
Fetching episode data for [Marvel's Agents of S.H.I.E.L.D.]
Stripping invalid characters from new path: TV Shows/Marvel's Agents of S.H.I.E.L.D./Season 03/Marvel's Agents of S.H.I.E.L.D. - S03E05 - 4,722 Hours
[COPY] Rename [D:\Torrent Files\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\marvels.agents.of.s.h.i.e.l.d.s03e05.internal.720p.hdtv.x264-killers\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS\Marvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.720p.HDTV.x264-KILLERS.mkv] to [F:\Videos\TV Shows\Marvel's Agents of S.H.I.E.L.D\Season 03\Marvel's Agents of S.H.I.E.L.D. - S03E05 - 4,722 Hours.mkv]
Processed 1 files
StringIndexOutOfBoundsException: String index out of range: -1
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at java_lang_String$substring$4.call(Unknown Source)
        at Script1$_run_closure68$_closure123.doCall(Script1.groovy:413)
        at Script1$_run_closure68.doCall(Script1.groovy:411)
        at Script1$_run_closure72.doCall(Script1.groovy:636)
        at Script1.run(Script1.groovy:527)
        at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:61)
        at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:82)
        at net.filebot.cli.ArgumentProcessor.process(ArgumentProcessor.java:116)
        at net.filebot.Main.main(Main.java:168)
Failure (┬░_┬░)
Any help would be greatly appreciated! Thank you in advance.
cowmix
Power User
Posts: 30
Joined: 09 Jan 2015, 11:03

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by cowmix »

Oops I haven't checked this in a while, I've actually made some changes since I last updated so I'm not sure if that error still exists or not. I'll push up my most recent version to gist, I was working on some Anime stuff but I got api banned on AniDB (forgot to use cache function argh) so not sure if that code might be a little buggy until I get that lifted and can finish working.
theo2889
Posts: 2
Joined: 28 Oct 2015, 07:33

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by theo2889 »

No worries, I just wasn't sure if I was doing something wrong or what the deal was.
cowmix
Power User
Posts: 30
Joined: 09 Jan 2015, 11:03

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by cowmix »

Do you still get the error with the latest on gist?

A lot of this stuff is tweaked to my specific needs, but I'm happy to help with any questions.

Oh also the sonarr url instruction is just url|key you don't need the complete path to your program directory, so just localhost:8989|<key>
RXWatcher
Power User
Posts: 2
Joined: 15 Dec 2015, 18:38

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by RXWatcher »

I am also getting this error.

One of the things thats impacting my using AMC is the full plex library update. It causes any currently playing shows in plex to stutter until the library update is finished, given the amount of media I have..its a long time. I was hoping this was the fix but I cant seem to get around this error. At first I thought it was the calling of CouchPotato or Plex so I removed those and it still errors.

Code: Select all

Failed to grep IMDbID: Ted.2.2015.1080p.BluRay.x264.DTS-HD.MA.5.1-RARBG.nfo
Auto-detect movie from context: [/home/movies/Ted.2.2015.1080p.BluRay.x264.DTS-HD.MA.5.1-RARBG/Ted.2.2015.1080p.BluRay.x264.DTS-HD.MA.5.1-RARBG.mkv
]
[DUPLICATE] Rename [/home/movies/Ted.2.2015.1080p.BluRay.x264.DTS-HD.MA.5.1-RARBG/Ted.2.2015.1080p.BluRay.x264.DTS-HD.MA.5.1-RARBG.mkv] to [/shared
/plex/local-sorted/Movies/Ted 2 (2015)/Ted 2 (2015).mkv]
Processed 1 files
Fetching movie artwork for [Ted 2 (2015)] to [/shared/plex/local-sorted/Movies/Ted 2 (2015)]
Fetching /shared/plex/local-sorted/Movies/Ted 2 (2015)/poster.jpg => {category: posters, width: 2000, height: 3000, language: en, url: http://image.tmdb.org/t/p/original/A7HtCxFe7Ms8H7e7o2zawpp
buDT.jpg}
Fetching /shared/plex/local-sorted/Movies/Ted 2 (2015)/fanart.jpg => {category: backdrops, width: 2000, height: 1125, language: null, url: http://image.tmdb.org/t/p/original/nkwoiSVJLeK0NI8kTqi
oBna61bm.jpg}
Fanart not found: /shared/plex/local-sorted/Movies/Ted 2 (2015)/clearart.png / movieart
Fanart not found: /shared/plex/local-sorted/Movies/Ted 2 (2015)/logo.png / movielogo
Fetching /shared/plex/local-sorted/Movies/Ted 2 (2015)/disc.png => {type=moviedisc, id=114562, url=http://assets.fanart.tv/fanart/movies/214756/moviedisc/ted-2-55a291c1b5602.png, lang=en, likes
=3, disc=1, disc_type=bluray}
StringIndexOutOfBoundsException: String index out of range: -1
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at java_lang_String$substring$7.call(Unknown Source)
        at Script1$_run_closure72$_closure132.doCall(Script1.groovy:501)
        at Script1$_run_closure72.doCall(Script1.groovy:499)
        at Script1$_run_closure76.doCall(Script1.groovy:794)
        at Script1.run(Script1.groovy:566)
        at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:61)
        at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:82)
        at net.filebot.cli.ArgumentProcessor.process(ArgumentProcessor.java:116)
        at net.filebot.Main.main(Main.java:169)
Failure (°_°)
Any ideas?

Thanks!
yedidyak
Posts: 2
Joined: 17 Dec 2015, 09:16

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by yedidyak »

I've got the same issue :(
yedidyak
Posts: 2
Joined: 17 Dec 2015, 09:16

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by yedidyak »

Fixed it. In the amc groovy file, find the line

Code: Select all

def prefix = file.name.substring(0,file.name.indexOf('['))
and replace it with

Code: Select all

def prefix = ""
cowmix
Power User
Posts: 30
Joined: 09 Jan 2015, 11:03

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by cowmix »

yedidyak wrote:Fixed it. In the amc groovy file, find the line

Code: Select all

def prefix = file.name.substring(0,file.name.indexOf('['))
and replace it with

Code: Select all

def prefix = ""
Thanks for pointing out the spot where everyone is having issues, I recommend using this:

Code: Select all

def prefix = file.name.indexOf('[')
if (prefix > -1) {
   prefix = file.name.substring(0,prefix)
} else {
   prefix = ""
}
I've also updated github with it
cowmix
Power User
Posts: 30
Joined: 09 Jan 2015, 11:03

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by cowmix »

RXWatcher wrote:I am also getting this error.

One of the things thats impacting my using AMC is the full plex library update. It causes any currently playing shows in plex to stutter until the library update is finished, given the amount of media I have..its a long time. I was hoping this was the fix but I cant seem to get around this error. At first I thought it was the calling of CouchPotato or Plex so I removed those and it still errors.

Thanks!
I believe you can only restrict plex library updates on a per section basis, the script will attempt to only update the section the effected file is in instead of the entire library. For example only Movie library will be updated when a movie is added. I wonder if I can take it further for TV shows so only that effected show or season is refreshed, I'll look into it.
Ztrust
Posts: 69
Joined: 21 Dec 2013, 17:04

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by Ztrust »

@cowmix
will this approach make sonarr delete inferior epesodes ?
I have been looking for a way to make filebot handle everything but always ran into the problem of sonarr not removeing hdtv if better was downloaded ?
ZeroByDivide
Posts: 170
Joined: 16 Dec 2014, 01:39

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by ZeroByDivide »

no matter how many times I try I can't seem to get this to notify sonarr to refresh the libary once a tv show is downloaded completely..

This is currently the script I have setup in Qbittorrent to shoot off the script so it'll do its stuff.

Code: Select all

filebot -script C:\Users\timta\Dropbox\Public\Folders\Filebot\Groovy\amc.groovy --output "D:/Shows" --log-file amc.log --conflict auto -non-strict --filter "age < 50" --def subtitles=en deleteAfterExtract=y clean=y "ut_dir=%F" "ut_kind=multi" "ut_title=%N" "ut_label=%L" "sonarr=localhost:8989/C:\ProgramData\NzbDrone\bin|61829cf08e31439f92bc0301e5552e83"
and this is in the amc logs afterwords.. Now I do notice it says parameter: sonarr = ***** but for some reason it just doesn't seem to do anything at all, any way you can possible help me out? maybe I got my token wrong or something (It's the API in sonarr right?) or could it be something else?

Code: Select all

Parameter:
subtitles = en
Parameter: deleteAfterExtract = y
Parameter: clean = y
Parameter: ut_dir = C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS
Parameter: ut_kind = multi
Parameter: ut_title = Bitten.S03E06.720p.HDTV.x264-KILLERS
Parameter: ut_label = 
Parameter: sonarr = *****
Roots: [C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS]
Read archive [bitten.s03e06.720p.hdtv.x264-killers.rar] and extract to [C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\.scratch\bitten.s03e06.720p.hdtv.x264-killers]
Extracting files [C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\.scratch\bitten.s03e06.720p.hdtv.x264-killers\Bitten.S03E06.720p.HDTV.x264-KILLERS.mkv]
Input: C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\.scratch\bitten.s03e06.720p.hdtv.x264-killers\Bitten.S03E06.720p.HDTV.x264-KILLERS.mkv
Exclude: C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.nfo
Exclude: C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r00
Exclude: C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r01
Exclude: C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r02
Exclude: C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r03
Exclude: C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r04
Exclude: C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r05
Exclude: C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r06
Exclude: C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r07
Exclude: C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r08
Exclude: C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r09
Exclude: C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r10
Exclude: C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r11
Exclude: C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r12
Exclude: C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r13
Exclude: C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r14
Exclude: C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r15
Exclude: C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.sfv
Exclude: C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\Sample\sample-bitten.s03e06.720p.hdtv.x264-killers.mkv
Group: [order:airdate, tvs:bitten] => [Bitten.S03E06.720p.HDTV.x264-KILLERS.mkv]
Lookup: Checking for [English] embedded sub in [Bitten.S03E06.720p.HDTV.x264-KILLERS.mkv] => []
Lookup: No embedded sub found, searching for subtitles.
Get [English] subtitles for 1 files
Looking up subtitles by hash via OpenSubtitles
Matched [Bitten.S03E06.720p.HDTV.x264-KILLERS.mkv] to [Bitten.S03E06.720p.HDTV.x264-KILLERS] via hash
Fetching [Bitten.S03E06.720p.HDTV.x264-KILLERS.srt]
Export [Bitten.S03E06.720p.HDTV.x264-KILLERS.srt] as: SubRip / UTF-8
Writing [Bitten.S03E06.720p.HDTV.x264-KILLERS.srt] to [Bitten.S03E06.720p.HDTV.x264-KILLERS.eng.srt]
Using TV Order: airdate
Rename episodes using [TheTVDB]
Auto-detected query: [Bitten]
Fetching episode data for [Bitten]
Apply Filter: {age < 50}
Include [Bitten - 3x05 - Of Sonders Weight]
Include [Bitten - 3x06 - Rule of Anger]
Include [Bitten - 3x07 - On the Brink]
Include [Bitten - 3x08 - Tili Tili Bom]
Include [Bitten - 3x09 - Shock the System]
Include [Bitten - 3x10 - Truth, Changes, Everything]
Auto-detected query: [Bitten]
Fetching episode data for [Bitten]
Apply Filter: {age < 50}
Include [Bitten - 3x05 - Of Sonders Weight]
Include [Bitten - 3x06 - Rule of Anger]
Include [Bitten - 3x07 - On the Brink]
Include [Bitten - 3x08 - Tili Tili Bom]
Include [Bitten - 3x09 - Shock the System]
Include [Bitten - 3x10 - Truth, Changes, Everything]
[MOVE] Rename [C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\.scratch\bitten.s03e06.720p.hdtv.x264-killers\Bitten.S03E06.720p.HDTV.x264-KILLERS.eng.srt] to [D:\Shows\TV Shows\Bitten\Season 03\Bitten - S03E06 - Rule of Anger.eng.srt]
[MOVE] Rename [C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\.scratch\bitten.s03e06.720p.hdtv.x264-killers\Bitten.S03E06.720p.HDTV.x264-KILLERS.mkv] to [D:\Shows\TV Shows\Bitten\Season 03\Bitten - S03E06 - Rule of Anger.mkv]
Processed 2 files
Bitten - S03E01 - Family, Of Sorts.eng.srt
Bitten - S03E01 - Family, Of Sorts.mkv
Bitten - S03E02 - Our Own Blood.eng.srt
Bitten - S03E02 - Our Own Blood.mkv
Bitten - S03E03 - Right Behind You.mkv
Bitten - S03E04 - A Quiet Dog.eng.srt
Bitten - S03E04 - A Quiet Dog.mkv
Bitten - S03E05 - Of Sonders Weight.mkv
Bitten - S03E06 - Rule of Anger.eng.srt
Bitten - S03E06 - Rule of Anger.mkv
Bitten - S03E10 - Truth, Changes, Everything.mkv
Found duplicates: [D:\Shows\TV Shows\Bitten\Season 03\Bitten - S03E01 - Family, Of Sorts.mkv, D:\Shows\TV Shows\Bitten\Season 03\Bitten - S03E02 - Our Own Blood.mkv, D:\Shows\TV Shows\Bitten\Season 03\Bitten - S03E03 - Right Behind You.mkv, D:\Shows\TV Shows\Bitten\Season 03\Bitten - S03E04 - A Quiet Dog.mkv, D:\Shows\TV Shows\Bitten\Season 03\Bitten - S03E05 - Of Sonders Weight.mkv, D:\Shows\TV Shows\Bitten\Season 03\Bitten - S03E06 - Rule of Anger.mkv, D:\Shows\TV Shows\Bitten\Season 03\Bitten - S03E10 - Truth, Changes, Everything.mkv]
Sort duplicates by quality: [Bitten - S03E01 - Family, Of Sorts.mkv] => [720.6]
Sort duplicates by quality: [Bitten - S03E02 - Our Own Blood.mkv] => [720.6]
Sort duplicates by quality: [Bitten - S03E03 - Right Behind You.mkv] => [720.6]
Sort duplicates by quality: [Bitten - S03E04 - A Quiet Dog.mkv] => [720.2]
Sort duplicates by quality: [Bitten - S03E05 - Of Sonders Weight.mkv] => [720.2]
Sort duplicates by quality: [Bitten - S03E06 - Rule of Anger.mkv] => [720.6]
Sort duplicates by quality: [Bitten - S03E10 - Truth, Changes, Everything.mkv] => [1080.2]
Best quality: [file:D:\Shows\TV Shows\Bitten\Season 03\Bitten - S03E10 - Truth, Changes, Everything.mkv, sort:1080.2]
Delete archive C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.rar
Delete archive volume C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r00
Delete archive volume C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r01
Delete archive volume C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r02
Delete archive volume C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r03
Delete archive volume C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r04
Delete archive volume C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r05
Delete archive volume C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r06
Delete archive volume C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r07
Delete archive volume C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r08
Delete archive volume C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r09
Delete archive volume C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r10
Delete archive volume C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r11
Delete archive volume C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r12
Delete archive volume C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r13
Delete archive volume C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r14
Delete archive volume C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.r15
Clean clutter files and empty folders
Delete C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.nfo
Delete C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\bitten.s03e06.720p.hdtv.x264-killers.sfv
Delete C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\Sample\sample-bitten.s03e06.720p.hdtv.x264-killers.mkv
Delete C:\Users\timta\Desktop\QBT\Bitten.S03E06.720p.HDTV.x264-KILLERS\Sample
Done ヾ(@⌒ー⌒@)ノ
cowmix
Power User
Posts: 30
Joined: 09 Jan 2015, 11:03

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by cowmix »

Ztrust wrote:@cowmix
will this approach make sonarr delete inferior epesodes ?
I have been looking for a way to make filebot handle everything but always ran into the problem of sonarr not removeing hdtv if better was downloaded ?
it does delete inferior episodes based on resolution and number of audio channels. If the resolution and audio channels is the same it will keep duplicates and try to notify you to fix it (I use pushbullet personally)
ZeroByDivide wrote:no matter how many times I try I can't seem to get this to notify sonarr to refresh the libary once a tv show is downloaded completely..
try removing the path from from your url and use "sonarr=localhost:8989/|<apikey>"
Last edited by cowmix on 27 Apr 2016, 00:49, edited 2 times in total.
ZeroByDivide
Posts: 170
Joined: 16 Dec 2014, 01:39

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by ZeroByDivide »

Going to post latest error/problem here as well just incase Rednoah can help me out (have it posted on your github as well)

with the release of filebot 4.7 recently and it seems to have broken the script.. Would love to continue using your script as it's the only thing that is letting me use sonarr but I don't want to stay on outdated software either (I hate staying on outdated software) but I don't know enough about groovy to go in and fix this myself at all or I would :/ so would it be possible for you to either update the script or tell me what I need to change to get it working again. Would be greatly appreciated :)

Error below on what is happening now whenever the script executes.

Code: Select all

 startup failed:
 Script1.groovy: 647: unable to resolve class net.filebot.web.CachedXmlResource 
  @ line 647, column 13.
    						dom = (new net.filebot.web.CachedXmlResource('https://raw.githubusercontent.com/ScudLee/anime-lists/master/anime-list.xml')).getDocument()
                ^
 
 Script1.groovy: 754: unable to resolve class net.filebot.web.CachedXmlResource 
  @ line 754, column 12.
    					dom = (new net.filebot.web.CachedXmlResource('https://raw.githubusercontent.com/ScudLee/anime-lists/master/anime-list.xml')).getDocument()
               ^
 
 2 errors
 
 org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
 Script1.groovy: 647: unable to resolve class net.filebot.web.CachedXmlResource 
  @ line 647, column 13.
    						dom = (new net.filebot.web.CachedXmlResource('https://raw.githubusercontent.com/ScudLee/anime-lists/master/anime-list.xml')).getDocument()
                ^
 
 Script1.groovy: 754: unable to resolve class net.filebot.web.CachedXmlResource 
  @ line 754, column 12.
    					dom = (new net.filebot.web.CachedXmlResource('https://raw.githubusercontent.com/ScudLee/anime-lists/master/anime-list.xml')).getDocument()
               ^
 
 2 errors
 
 	at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:62)
 	at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:72)
 	at net.filebot.cli.ArgumentProcessor.runScript(ArgumentProcessor.java:114)
 	at net.filebot.cli.ArgumentProcessor.run(ArgumentProcessor.java:29)
 	at net.filebot.Main.main(Main.java:120)
 Failure (°_°)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by rednoah »

The caching API has been rewritten. Scripts that use internal old API that doesn't exist anymore break of course.

I fixed a similar issue in update-mes this week. Look at the latest commit.

However, there will probably be few more issues once you fix that one. If you don't know what you're doing, you will not be able to fix this.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by rednoah »

If you just need the sonarr / couch potato / etc extra notifications, then you can easily add that to the amc script via --def exec without modifying the script.
:idea: Please read the FAQ and How to Request Help.
ZeroByDivide
Posts: 170
Joined: 16 Dec 2014, 01:39

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by ZeroByDivide »

rednoah wrote:The caching API has been rewritten. Scripts that use internal old API that doesn't exist anymore break of course.

I fixed a similar issue in update-mes this week. Look at the latest commit.

However, there will probably be few more issues once you fix that one. If you don't know what you're doing, you will not be able to fix this.
Well darn :c yea I don't know enough about groovy to really be able to fix it without at least some help :s hopefully cow comes around soon enough and fixes it back up.
rednoah wrote:If you just need the sonarr / couch potato / etc extra notifications, then you can easily add that to the amc script via --def exec without modifying the script.
But I thought sonarr/couchpotato wasn't in the normal amc script though? since there is literally no mention of sonarr/couchpotato on the normal amc script, just plex/kodi/ and emby... so wouldn't it not be able to call out to sonarr/couchpotato?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by rednoah »

It's just http request. You can do that with curl commands. Then make a shell script and have the amc script call it with --def exec.
:idea: Please read the FAQ and How to Request Help.
porkchop999
Posts: 3
Joined: 16 Feb 2016, 06:23

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by porkchop999 »

this is the curl script I use to update sonar

curl http://192.168.2.76:8989/api/command -X POST -d "{'name':'refreshseries'}" --header "X-Api-Key:"
ZeroByDivide
Posts: 170
Joined: 16 Dec 2014, 01:39

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by ZeroByDivide »

rednoah wrote:It's just http request. You can do that with curl commands. Then make a shell script and have the amc script call it with --def exec.
porkchop999 wrote:this is the curl script I use to update sonar

curl http://192.168.2.76:8989/api/command -X POST -d "{'name':'refreshseries'}" --header "X-Api-Key:"
so then would it look something like this here?
filebot -script fn:amc --log-file amc.log --conflict override -non-strict --filter "age < 170" --def "ut_dir=%F" "ut_kind=multi" "ut_title=%N" "ut_label=%L" "seriesFormat=D:/Shows/TV Shows/{n}/season {s.pad(2)}/{n} - {s00e00} - {t}" "movieFormat=D:/Shows/Movies/{n} {[y, rating]}/{n}" "animeFormat=D:/Shows/Anime/{n}/season {s.pad(2)}/{n} - {s00e00} - {t}" deleteAfterExtract=y clean=y --def exec="curl 'http://localhost:8989/api/command' -X POST -d "{'name':'refreshseries'}" --header "X-Api-Key:(api key)"
Would that work or am I completely wrong on this? :s of course my API key where I put (api key) at.
porkchop999
Posts: 3
Joined: 16 Feb 2016, 06:23

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by porkchop999 »

--def exec="curl 'http://localhost:8989/api/command' -X POST -d "{'name':'refreshseries'}" --header "X-Api-Key:(api key)"

does " before curl need to come out?
ZeroByDivide
Posts: 170
Joined: 16 Dec 2014, 01:39

Re: Custom AMC features (AniDB Maps, Sonarr, Couchpotato, et

Post by ZeroByDivide »

porkchop999 wrote:--def exec="curl 'http://localhost:8989/api/command' -X POST -d "{'name':'refreshseries'}" --header "X-Api-Key:(api key)"

does " before curl need to come out?
Are you asking if the " before the curl needs to be deleted? :o that is a idk lol I was searching for curl stuff on the forums and came across this

Code: Select all

filebot -script fn:amc --output "D:/Jonny's Stuff" --action copy --conflict override -non-strict --log-file amc.log --def unsorted=y music=y artwork=n clean=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" --def "seriesFormat=/TVShows/{n}\{'Season '+s}\{n} - {sxe} - {t}" --def exec="curl 'http://localhost:8090/api/REMOVEFORPOSTING?cmd=show.refresh&tvdbid={info.id}'" --filter "!readLines('''D:/Jonny's Stuff/Downloads/exclude.txt''').contains(n)"


From viewtopic.php?f=4&t=3608&p=20191&hilit=curl#p20191 but it was for sickrage instead so I just took the curl part and switched it to be for sonarr instead making it look somewhat like yours, but the one above had the " in front of curl so I think that's how it goes, but I'm honestly not even sure >..< I don't even know if what I have in the post above is even correct or if I'm completely off base on how things should be. Guess I can run a test and possibly see what happens.
Post Reply