Page 2 of 2

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

Posted: 14 May 2016, 04:17
by porkchop999
I set it up as a separate shell script then run

--def exec=/pathto/Sonarrrefresh.sh

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

Posted: 14 May 2016, 04:49
by ZeroByDivide
porkchop999 wrote:I set it up as a separate shell script then run

--def exec=/pathto/Sonarrrefresh.sh
Welp I tried that had to change the shell script though to a bat since I'm on windows and honestly don't feel like going through and downloading more than I need to to get this stuff working and well it didn't even work... :/
Run script [fn:amc] at [Fri May 13 23:46:17 CDT 2016]
Parameter: ut_dir = C:\Users\timta\Desktop\QBT\The.100.S03E15.720p.HDTV.2CH.x265.HEVC-PSA.mkv
Parameter: ut_kind = multi
Parameter: ut_title = The.100.S03E15.720p.HDTV.2CH.x265.HEVC-PSA.mkv
Parameter: ut_label =
Parameter: seriesFormat = D:/Shows/TV Shows/{n}/season {s.pad(2)}/{n} - {s00e00} - {t}
Parameter: movieFormat = D:/Shows/Movies/{n} {[y, rating]}/{n}
Parameter: animeFormat = D:/Shows/Anime/{n}/season {s.pad(2)}/{n} - {s00e00} - {t}
Parameter: deleteAfterExtract = y
Parameter: clean = y
Parameter: exec = C:\Users\timta\Dropbox\Public\Folders\Filebot\Groovy\Sonarrrefresh.bat
Input: C:\Users\timta\Desktop\QBT\The.100.S03E15.720p.HDTV.2CH.x265.HEVC-PSA.mkv
Group: [tvs:the 100] => [The.100.S03E15.720p.HDTV.2CH.x265.HEVC-PSA.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [The 100]
Fetching episode data for [The 100]
Fetching episode data for [The 100 Scariest Movie Moments]
Fetching episode data for [The 100 Lives of Black Jack Savage]
Apply Filter: {age < 170}
Include [The 100 - 3x01 - Wanheda (1)]
Include [The 100 - 3x02 - Wanheda (2)]
Include [The 100 - 3x03 - Ye Who Enter Here]
Include [The 100 - 3x04 - Watch the Thrones]
Include [The 100 - 3x05 - Hakeldama]
Include [The 100 - 3x06 - Bitter Harvest]
Include [The 100 - 3x07 - Thirteen]
Include [The 100 - 3x08 - Terms and Conditions]
Include [The 100 - 3x09 - Stealing Fire]
Include [The 100 - 3x10 - Fallen]
Include [The 100 - 3x11 - Nevermore]
Include [The 100 - 3x12 - Demons]
Include [The 100 - 3x13 - Join or Die]
Include [The 100 - 3x14 - Red Sky at Morning]
Include [The 100 - 3x15 - Perverse Instantiation (1)]
[MOVE] Rename [C:\Users\timta\Desktop\QBT\The.100.S03E15.720p.HDTV.2CH.x265.HEVC-PSA.mkv] to [D:\Shows\TV Shows\The 100\season 03\The 100 - S03E15 - Perverse Instantiation (1).mkv]
Processed 1 files
Execute: C:\Users\timta\Dropbox\Public\Folders\Filebot\Groovy\Sonarrrefresh.bat
Done ヾ(@⌒ー⌒@)ノ
Says it executed the bat file but when I go to sonarr nothing has changed and it still shows me missing the episode.

this is what I have in sonarrrefresh.bat

Code: Select all

curl http://localhost:8989/api/command -X POST -d "{'name':'refreshseries'}" --header "X-Api-Key:(api key)"
my API key is where it says (api key)


-----------------------------------------

This is what happens when I run

Code: Select all

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)"
instead

Code: Select all

Run script [fn:amc] at [Fri May 13 23:56:40 CDT 2016]
Parameter: ut_dir = C:\Users\timta\Desktop\QBT\The.100.S03E15.720p.HDTV.2CH.x265.HEVC-PSA.mkv
Parameter: ut_kind = multi
Parameter: ut_title = The.100.S03E15.720p.HDTV.2CH.x265.HEVC-PSA.mkv
Parameter: ut_label = 
Parameter: seriesFormat = D:/Shows/TV Shows/{n}/season {s.pad(2)}/{n} - {s00e00} - {t}
Parameter: movieFormat = D:/Shows/Movies/{n} {[y, rating]}/{n}
Parameter: animeFormat = D:/Shows/Anime/{n}/season {s.pad(2)}/{n} - {s00e00} - {t}
Parameter: deleteAfterExtract = y
Parameter: clean = y
Parameter: exec = curl http://localhost:8989/api/command -X POST -d {'name':'refreshseries'} --header X-Api-Key:(api key)
Input: C:\Users\timta\Desktop\QBT\The.100.S03E15.720p.HDTV.2CH.x265.HEVC-PSA.mkv
Group: [tvs:the 100] => [The.100.S03E15.720p.HDTV.2CH.x265.HEVC-PSA.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [The 100]
Fetching episode data for [The 100]
Fetching episode data for [The 100 Scariest Movie Moments]
Fetching episode data for [The 100 Lives of Black Jack Savage]
Apply Filter: {age < 170}
Include [The 100 - 3x01 - Wanheda (1)]
Include [The 100 - 3x02 - Wanheda (2)]
Include [The 100 - 3x03 - Ye Who Enter Here]
Include [The 100 - 3x04 - Watch the Thrones]
Include [The 100 - 3x05 - Hakeldama]
Include [The 100 - 3x06 - Bitter Harvest]
Include [The 100 - 3x07 - Thirteen]
Include [The 100 - 3x08 - Terms and Conditions]
Include [The 100 - 3x09 - Stealing Fire]
Include [The 100 - 3x10 - Fallen]
Include [The 100 - 3x11 - Nevermore]
Include [The 100 - 3x12 - Demons]
Include [The 100 - 3x13 - Join or Die]
Include [The 100 - 3x14 - Red Sky at Morning]
Include [The 100 - 3x15 - Perverse Instantiation (1)]
[MOVE] Rename [C:\Users\timta\Desktop\QBT\The.100.S03E15.720p.HDTV.2CH.x265.HEVC-PSA.mkv] to [D:\Shows\TV Shows\The 100\season 03\The 100 - S03E15 - Perverse Instantiation (1).mkv]
Processed 1 files
ScriptException: SyntaxError: expecting EOF, found ':'
Execute: null
NullPointerException: java.lang.NullPointerException
java.lang.NullPointerException
	at net.filebot.cli.ScriptShellBaseClass.execute(ScriptShellBaseClass.java:271)
	at Script1$_run_closure74.doCall(Script1.groovy:455)
	at Script1.run(Script1.groovy:453)
	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 (°_°)
So I honestly don't even know :/ the first one doesn't seem to give any error or indication on what could be the problem and the second one throws up an error but I dunno what to do to fix it.. >.< its seeing

Code: Select all

{'name':'refreshseries'}
that wrong or something I am not even sure.

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

Posted: 14 May 2016, 17:37
by ZeroByDivide
So I'm getting closer I think but I still haven't gotten it figured out yet :/

new script -

Code: Select all

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.replaceTrailingBrackets()} - {s00e00} - {t.replaceAll(/[!?.]+$/).replaceAll(/[\`´‘’ʻ]/, /"'/") .lowerTrail().replacePart(', Part $1')}" "movieFormat=D:/Shows/Movies/{n} {[y]}/{n.replaceTrailingBrackets() replaceAll(/[!?.]+$/).replaceAll(/[\`´‘’ʻ]/, /"'/") lowerTrail()} [{y}]" "animeFormat=D:/Shows/Anime/{n}/season {s.pad(2)}/{n.replaceTrailingBrackets()} - {s00e00} - {t.replaceAll(/[!?.]+$/).replaceAll(/[\`´‘’ʻ]/, /"'/") .lowerTrail().replacePart(', Part $1')}" deleteAfterExtract=y clean=y --def exec="curl http://localhost:8989/api/command -X POST -d "{/'name':/'refreshseries'}" --header "X-Api-Key:(api key)"
what I get from running tests -

Code: Select all

Run script [fn:amc] at [Sat May 14 12:16:15 CDT 2016]
Parameter: ut_dir = C:\Users\timta\Desktop\QBT\The.Flash.2014.S02E21.The.Runaway.Dinosaur.720p.WEB-DL.2CH.x265.HEVC-PSA.mkv
Parameter: ut_kind = multi
Parameter: ut_title = The.Flash.2014.S02E21.The.Runaway.Dinosaur.720p.WEB-DL.2CH.x265.HEVC-PSA.mkv
Parameter: ut_label = 
Parameter: seriesFormat = D:/Shows/TV Shows/{n}/season {s.pad(2)}/{n.replaceTrailingBrackets()} - {s00e00} - {t.replaceAll(/[!?.]+$/).replaceAll(/[\`´‘’?]/, /'/) .lowerTrail().replacePart(', Part $1')}
Parameter: movieFormat = D:/Shows/Movies/{n} {[y]}/{n.replaceTrailingBrackets() replaceAll(/[!?.]+$/).replaceAll(/[\`´‘’?]/, /'/) lowerTrail()} [{y}]
Parameter: animeFormat = D:/Shows/Anime/{n}/season {s.pad(2)}/{n.replaceTrailingBrackets()} - {s00e00} - {t.replaceAll(/[!?.]+$/).replaceAll(/[\`´‘’?]/, /'/) .lowerTrail().replacePart(', Part $1')}
Parameter: deleteAfterExtract = y
Parameter: clean = y
Parameter: exec = curl http://localhost:8989/api/command/ -X POST -d {/'name':/'refreshseries'} --header X-Api-Key:(api key)
Input: C:\Users\timta\Desktop\QBT\The.Flash.2014.S02E21.The.Runaway.Dinosaur.720p.WEB-DL.2CH.x265.HEVC-PSA.mkv
Group: [tvs:the flash 2014] => [The.Flash.2014.S02E21.The.Runaway.Dinosaur.720p.WEB-DL.2CH.x265.HEVC-PSA.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [The Flash 2014]
Fetching episode data for [The Flash (2014)]
Apply Filter: {age < 170}
Include [The Flash (2014) - 2x08 - Legends of Today (1)]
Include [The Flash (2014) - 2x09 - Running to Stand Still]
Include [The Flash (2014) - 2x10 - Potential Energy]
Include [The Flash (2014) - 2x11 - The Reverse-Flash Returns]
Include [The Flash (2014) - 2x12 - Fast Lane]
Include [The Flash (2014) - 2x13 - Welcome to Earth-2]
Include [The Flash (2014) - 2x14 - Escape from Earth-2]
Include [The Flash (2014) - 2x15 - King Shark]
Include [The Flash (2014) - 2x16 - Trajectory]
Include [The Flash (2014) - 2x17 - Flash Back]
Include [The Flash (2014) - 2x18 - Versus Zoom]
Include [The Flash (2014) - 2x19 - Back to Normal]
Include [The Flash (2014) - 2x20 - Rupture]
Include [The Flash (2014) - 2x21 - The Runaway Dinosaur]
Include [The Flash (2014) - 0xSpecial 1 - The Chronicles Of Cisco: Entry 0419 - Part 1]
Include [The Flash (2014) - 0xSpecial 2 - The Chronicles Of Cisco: Entry 0419 - Part 2]
Include [The Flash (2014) - 0xSpecial 3 - The Chronicles Of Cisco: Entry 0419 - Part 3]
Include [The Flash (2014) - 0xSpecial 4 - The Chronicles Of Cisco: Entry 0419 - Part 4]
[MOVE] Rename [C:\Users\timta\Desktop\QBT\The.Flash.2014.S02E21.The.Runaway.Dinosaur.720p.WEB-DL.2CH.x265.HEVC-PSA.mkv] to [D:\Shows\TV Shows\The Flash (2014)\season 02\The Flash - S02E21 - The Runaway Dinosaur.mkv]
Processed 1 files
Execute: curl http://localhost:8989/api/command/ -X POST -d --header X-Api-Key:(api key)
Done ヾ(@⌒ー⌒@)ノ
Thing is it still doesn't send a refresh to sonarr at all... and it seems to have deleted the "{/'name':/'refreshseries'}" part of the execute (which is why it didn't send the refresh) so I think I messed up on that part.

I don't know anymore I used to be so good at figuring out issues like this and having them fixed within minutes... :( this sucks I can't update filebot because none of this is working but I have to update filebot its just how I am I hate hate hate staying on outdated stuff so much..


Someone please help :/

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

Posted: 14 May 2016, 17:58
by rednoah
You need to figure out how to update sonarr from CMD first. I doubt that curl works in CMD.

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

Posted: 14 May 2016, 18:56
by ZeroByDivide
rednoah wrote:You need to figure out how to update sonarr from CMD first. I doubt that curl works in CMD.

So I found out you can initiate a refresh through powershell when I went to sonarrs wiki page, with this code

Code: Select all

$url = "http://localhost:8989/api/command"
$json = "{ ""name"": ""downloadedepisodesscan"" }"

Write-Host "Publishing update $version ($branch) to: $url"
Invoke-RestMethod -Uri $url -Method Post -Body $json -Headers @{"X-Api-Key"="YOUR_API_KEY_GOES_HERE"}
though executing powershell alone through the -def exec thing just makes it pop up in notepad instead of actually running anything so I made a bat file with

Code: Select all

powershell.exe -ExecutionPolicy Bypass -Command "C:\Users\timta\Dropbox\Public\Folders\Filebot\Groovy\Sonarrrefresh.ps1"
and had my script execute it

Code: Select all

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.replaceTrailingBrackets()} - {s00e00} - {t.replaceAll(/[!?.]+$/).replaceAll(/[\`´‘’ʻ]/, /"'/") .lowerTrail().replacePart(', Part $1')}" "movieFormat=D:/Shows/Movies/{n} {[y]}/{n.replaceTrailingBrackets() replaceAll(/[!?.]+$/).replaceAll(/[\`´‘’ʻ]/, /"'/") lowerTrail()} [{y}]" "animeFormat=D:/Shows/Anime/{n}/season {s.pad(2)}/{n.replaceTrailingBrackets()} - {s00e00} - {t.replaceAll(/[!?.]+$/).replaceAll(/[\`´‘’ʻ]/, /"'/") .lowerTrail().replacePart(', Part $1')}" deleteAfterExtract=y clean=y --def exec="C:\Users\timta\Dropbox\Public\Folders\Filebot\Groovy\callpowershell.bat"
but yet it still doesn't seem to do anything at all..

Running the powershell stuff through powershell alone without changing anything other than the api key part brings me to this

Code: Select all

PS C:\Users\timta\Dropbox\Public\Folders\Filebot\Groovy> $url = "http://localhost:8989/api/command"
$json = "{ ""name"": ""downloadedepisodesscan"" }"

Write-Host "Publishing update $version ($branch) to: $url"
Invoke-RestMethod -Uri $url -Method Post -Body $json -Headers @{"X-Api-Key"="6e7bff2e25e24317924907b16e6b7eee"}
Publishing update  () to: http://localhost:8989/api/command


name                : DownloadedEpisodesScan
body                : @{sendUpdatesToClient=False; sendUpdates=False; updateScheduledTask=True; completionMessage=Completed; name=DownloadedEpisodesScan; trigger=manual}
priority            : normal
status              : queued
queued              : 0001-01-01T00:00:00Z
trigger             : manual
state               : queued
manual              : True
startedOn           : 0001-01-01T00:00:00Z
sendUpdatesToClient : False
updateScheduledTask : True
id                  : 58310
so it seems to be working somewhat (idk what to really change in the powershell to make sure its working 100% though...) but I can't get it to refresh the series still when after download even though it says it executed the bat file...

Code: Select all

Parameter: ut_dir = C:\Users\timta\Desktop\QBT\The.Flash.2014.S02E21.720p.WEB-DL.DD5.1.H.264-VietHD.mkv
Parameter: ut_kind = multi
Parameter: ut_title = The.Flash.2014.S02E21.720p.WEB-DL.DD5.1.H.264-VietHD.mkv
Parameter: ut_label = tv-sonarr
Parameter: seriesFormat = D:/Shows/TV Shows/{n}/season {s.pad(2)}/{n.replaceTrailingBrackets()} - {s00e00} - {t.replaceAll(/[!?.]+$/).replaceAll(/[\`´‘’?]/, /'/) .lowerTrail().replacePart(', Part $1')}
Parameter: movieFormat = D:/Shows/Movies/{n} {[y]}/{n.replaceTrailingBrackets() replaceAll(/[!?.]+$/).replaceAll(/[\`´‘’?]/, /'/) lowerTrail()} [{y}]
Parameter: animeFormat = D:/Shows/Anime/{n}/season {s.pad(2)}/{n.replaceTrailingBrackets()} - {s00e00} - {t.replaceAll(/[!?.]+$/).replaceAll(/[\`´‘’?]/, /'/) .lowerTrail().replacePart(', Part $1')}
Parameter: deleteAfterExtract = y
Parameter: clean = y
Parameter: exec = C:\Users\timta\Dropbox\Public\Folders\Filebot\Groovy\callpowershell.bat
Roots: [C:\Users\timta\Desktop\QBT\The.Flash.2014.S02E21.720p.WEB-DL.DD5.1.H.264-VietHD.mkv]
Input: C:\Users\timta\Desktop\QBT\The.Flash.2014.S02E21.720p.WEB-DL.DD5.1.H.264-VietHD.mkv
Group: [order:airdate, tvs:the flash 2014] => [The.Flash.2014.S02E21.720p.WEB-DL.DD5.1.H.264-VietHD.mkv]
Using TV Order: airdate
Rename episodes using [TheTVDB]
Auto-detected query: [The Flash 2014]
Fetching episode data for [The Flash (2014)]
Apply Filter: {age < 170}
Include [The Flash (2014) - 2x08 - Legends of Today (1)]
Include [The Flash (2014) - 2x09 - Running to Stand Still]
Include [The Flash (2014) - 2x10 - Potential Energy]
Include [The Flash (2014) - 2x11 - The Reverse-Flash Returns]
Include [The Flash (2014) - 2x12 - Fast Lane]
Include [The Flash (2014) - 2x13 - Welcome to Earth-2]
Include [The Flash (2014) - 2x14 - Escape from Earth-2]
Include [The Flash (2014) - 2x15 - King Shark]
Include [The Flash (2014) - 2x16 - Trajectory]
Include [The Flash (2014) - 2x17 - Flash Back]
Include [The Flash (2014) - 2x18 - Versus Zoom]
Include [The Flash (2014) - 2x19 - Back to Normal]
Include [The Flash (2014) - 2x20 - Rupture]
Include [The Flash (2014) - 2x21 - The Runaway Dinosaur]
Include [The Flash (2014) - 0xSpecial 1 - The Chronicles Of Cisco: Entry 0419 - Part 1]
Include [The Flash (2014) - 0xSpecial 2 - The Chronicles Of Cisco: Entry 0419 - Part 2]
Include [The Flash (2014) - 0xSpecial 3 - The Chronicles Of Cisco: Entry 0419 - Part 3]
Include [The Flash (2014) - 0xSpecial 4 - The Chronicles Of Cisco: Entry 0419 - Part 4]
[MOVE] Rename [C:\Users\timta\Desktop\QBT\The.Flash.2014.S02E21.720p.WEB-DL.DD5.1.H.264-VietHD.mkv] to [D:\Shows\TV Shows\The Flash (2014)\season 02\The Flash - S02E21 - The Runaway Dinosaur.mkv]
Processed 1 files
The Flash - S02E21 - The Runaway Dinosaur.mkv
Execute: C:\Users\timta\Dropbox\Public\Folders\Filebot\Groovy\callpowershell.bat
Done ヾ(@⌒ー⌒@)ノ

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

Posted: 15 May 2016, 02:44
by rednoah
Try adding cmd /c before your bat script.

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

Posted: 15 May 2016, 06:31
by ZeroByDivide
rednoah wrote:Try adding cmd /c before your bat script.
running

Code: Select all

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.replaceTrailingBrackets()} - {s00e00} - {t.replaceAll(/[!?.]+$/).replaceAll(/[\`´‘’ʻ]/, /"'/") .lowerTrail().replacePart(', Part $1')}" "movieFormat=D:/Shows/Movies/{n} {[y]}/{n.replaceTrailingBrackets() replaceAll(/[!?.]+$/).replaceAll(/[\`´‘’ʻ]/, /"'/") lowerTrail()} [{y}]" "animeFormat=D:/Shows/Anime/{n}/season {s.pad(2)}/{n.replaceTrailingBrackets()} - {s00e00} - {t.replaceAll(/[!?.]+$/).replaceAll(/[\`´‘’ʻ]/, /"'/") .lowerTrail().replacePart(', Part $1')}" deleteAfterExtract=y clean=y --def exec="cmd /c C:\Users\timta\Dropbox\Public\Folders\Filebot\Groovy\callpowershell.bat"
produced

Code: Select all

Run script [fn:amc] at [Sun May 15 01:13:17 CDT 2016]
Parameter: ut_dir = C:\Users\timta\Desktop\QBT\The.Flash.2014.S02E21.720p.WEB-DL.DD5.1.H.264-VietHD.mkv
Parameter: ut_kind = multi
Parameter: ut_title = The.Flash.2014.S02E21.720p.WEB-DL.DD5.1.H.264-VietHD.mkv
Parameter: ut_label = tv-sonarr
Parameter: seriesFormat = D:/Shows/TV Shows/{n}/season {s.pad(2)}/{n.replaceTrailingBrackets()} - {s00e00} - {t.replaceAll(/[!?.]+$/).replaceAll(/[\`´‘’?]/, /'/) .lowerTrail().replacePart(', Part $1')}
Parameter: movieFormat = D:/Shows/Movies/{n} {[y]}/{n.replaceTrailingBrackets() replaceAll(/[!?.]+$/).replaceAll(/[\`´‘’?]/, /'/) lowerTrail()} [{y}]
Parameter: animeFormat = D:/Shows/Anime/{n}/season {s.pad(2)}/{n.replaceTrailingBrackets()} - {s00e00} - {t.replaceAll(/[!?.]+$/).replaceAll(/[\`´‘’?]/, /'/) .lowerTrail().replacePart(', Part $1')}
Parameter: deleteAfterExtract = y
Parameter: clean = y
Parameter: exec = cmd /c C:\Users\timta\Dropbox\Public\Folders\Filebot\Groovy\callpowershell.bat
Input: C:\Users\timta\Desktop\QBT\The.Flash.2014.S02E21.720p.WEB-DL.DD5.1.H.264-VietHD.mkv
Group: [tvs:the flash 2014] => [The.Flash.2014.S02E21.720p.WEB-DL.DD5.1.H.264-VietHD.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [The Flash 2014]
Fetching episode data for [The Flash (2014)]
Apply Filter: {age < 170}
Include [The Flash (2014) - 2x08 - Legends of Today (1)]
Include [The Flash (2014) - 2x09 - Running to Stand Still]
Include [The Flash (2014) - 2x10 - Potential Energy]
Include [The Flash (2014) - 2x11 - The Reverse-Flash Returns]
Include [The Flash (2014) - 2x12 - Fast Lane]
Include [The Flash (2014) - 2x13 - Welcome to Earth-2]
Include [The Flash (2014) - 2x14 - Escape from Earth-2]
Include [The Flash (2014) - 2x15 - King Shark]
Include [The Flash (2014) - 2x16 - Trajectory]
Include [The Flash (2014) - 2x17 - Flash Back]
Include [The Flash (2014) - 2x18 - Versus Zoom]
Include [The Flash (2014) - 2x19 - Back to Normal]
Include [The Flash (2014) - 2x20 - Rupture]
Include [The Flash (2014) - 2x21 - The Runaway Dinosaur]
Include [The Flash (2014) - 0xSpecial 1 - The Chronicles Of Cisco: Entry 0419 - Part 1]
Include [The Flash (2014) - 0xSpecial 2 - The Chronicles Of Cisco: Entry 0419 - Part 2]
Include [The Flash (2014) - 0xSpecial 3 - The Chronicles Of Cisco: Entry 0419 - Part 3]
Include [The Flash (2014) - 0xSpecial 4 - The Chronicles Of Cisco: Entry 0419 - Part 4]
[MOVE] Rename [C:\Users\timta\Desktop\QBT\The.Flash.2014.S02E21.720p.WEB-DL.DD5.1.H.264-VietHD.mkv] to [D:\Shows\TV Shows\The Flash (2014)\season 02\The Flash - S02E21 - The Runaway Dinosaur.mkv]
Processed 1 files
Execute: cmd /c C:\Users\timta\Dropbox\Public\Folders\Filebot\Groovy\callpowershell.bat
Done ヾ(@⌒ー⌒@)ノ
Still executed the bat file which should execute the powershell script (i've run the bat file by itself before and it executes the powershell just fine so I know the bat file works) yet still it didn't refresh the series on sonarr.

Moving the first " so it looks like --def exec=cmd /c "C:\Users\timta\Dropbox\Public\Folders\Filebot\Groovy\callpowershell.bat" produces just errors and the amc script doesn't completely run.

deleting the "" so its like --def exec=cmd /c C:\Users\timta\Dropbox\Public\Folders\Filebot\Groovy\callpowershell.bat does the same and produces an error and amc script doesn't completely run.

so I have to stick to --def exec="cmd /c C:\Users\timta\Dropbox\Public\Folders\Filebot\Groovy\callpowershell.bat" but yet it still doesn't work...

I'm so at a loss on getting this to work -.- and its getting really really aggravating... it feels like I have to stay on filebot 4.6.1 even though it makes me want to just kill my computer and toss it out a window because I don't want to stay on 4.6.1 and want to update to 4.7 :(

--------------------------------------------------------------------------------------------------------

Well once again I am getting closer again it seems...

I searched a bit more for commands for sonarr and found a commands page on there wiki and two of them was RefreshSeries and RescanSeries, and they actually refresh and rescan when initiated through powershell with

Code: Select all

$url = "http://localhost:8989/api/command"
$json = "{ ""name"": ""RescanSeries"" }"

Write-Host "Publishing update $version ($branch) to: $url"
Invoke-RestMethod -Uri $url -Method Post -Body $json -Headers @{"X-Api-Key"="6e7bff2e25e24317924907b16e6b7eee"}
or

Code: Select all

$url = "http://localhost:8989/api/command"
$json = "{ ""name"": ""RefreshSeries"" }"

Write-Host "Publishing update $version ($branch) to: $url"
Invoke-RestMethod -Uri $url -Method Post -Body $json -Headers @{"X-Api-Key"="6e7bff2e25e24317924907b16e6b7eee"}
so I at least got that part figured out for the most part, the thing is though is that I don't need/want it to refresh/rescan every single show/series I have on sonarr I only need it to refresh/rescan the series that I have downloaded the episode for..

To do this I can run the parameter

Code: Select all

Parameters

Optional:

seriesId (int) - if not set all series will be refreshed and scanned
But I don't know where to put it at exactly in the powershell script, I tried putting it after the refresh/rescanseries thing in """" but it throws errors.. but I am at least getting a bit closer to being able to update filebot and keep sonarr..

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

Posted: 15 May 2016, 15:15
by ZeroByDivide
Have posted the above bit in various other sites so hopefully someone can help me out from either here or one of the various other places... At least I hope.. :/ since I am so close to finally being done with this crap.

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

Posted: 15 May 2016, 17:13
by rednoah
Try something simple and see if it works:

Code: Select all

--def exec=notepad
This should start notepad.

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

Posted: 15 May 2016, 17:29
by ZeroByDivide
rednoah wrote:Try something simple and see if it works:

Code: Select all

--def exec=notepad
This should start notepad.
I already have it refreshing series/rescanning series now since I finally found out what the issue was, main thing now is getting it to only refresh/rescan the series that is downloaded instead of every single series I have on sonarr but I have to figure out how to get

Code: Select all

seriesId (int)
included in

Code: Select all

$url = "http://localhost:8989/api/command"
$json = "{ ""name"": ""RescanSeries"" }"

Write-Host "Publishing update $version ($branch) to: $url"
Invoke-RestMethod -Uri $url -Method Post -Body $json -Headers @{"X-Api-Key"="(api key)"}
without it throwing random errors...

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

Posted: 16 May 2016, 14:27
by ZeroByDivide
meh forget about helping, I dropped all this in hopes that the cowmix comes along and updates it so it works on the latest version of filebot. I am just to tired and annoyed to deal with trying to figure this crap out anymore.

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

Posted: 19 May 2016, 21:53
by cowmix
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.
Hey rednoah,

What has changed with the caching api? Is there a new class I should look for that replaced CachedXmlResource?

Thanks!

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

Posted: 20 May 2016, 05:25
by rednoah
e.g. text

Code: Select all

def page = 'update.xml'
def text = Cache.getCache('my_text_store', CacheType.Persistent).text(page) { 
	new URL('http://app.filebot.net/'+it)
}.expire(Cache.ONE_MONTH).get()

println text

e.g. xml

Code: Select all

def key = 'update.xml'
def dom = Cache.getCache('my_xml_store', CacheType.Persistent).xml(key) { 
	new URL('http://app.filebot.net/'+it)
}.expire(Cache.ONE_MONTH).get()

print dom.documentElement

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

Posted: 01 Jun 2016, 02:49
by cowmix
Pushed a fix to github, sorry for the delay.

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

Posted: 01 Jun 2016, 07:02
by ZeroByDivide
cowmix wrote:Pushed a fix to github, sorry for the delay.
Sadly the fix that you pushed didn't work at all.. it still throws up errors :c

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

Posted: 26 Aug 2016, 19:38
by redbull666
This was the missing key to finally get the full chain operating properly:

- Sonarr for download
- Filebot for unpack, copy and subtitles.
- Sonarr for keeping track of episodes

As quotes are a bloody mess, I just create a new script "sonarr_refresh.sh" in the Filebot folder with the following:

#!/bin/sh
/usr/bin/curl http://HOSTNAME_HERE:8989/api/command -X POST -d "{'name':'refreshseries'}" --header "X-Api-Key:API_KEY_HERE"

Then in your Filebot line:

--def exec="/path/to/filebot/sonarr_refresh.sh"

Works!