Giter Site home page Giter Site logo

Comments (19)

rednoah avatar rednoah commented on August 27, 2024 1

You just need to escape the argument value properly:

--def exec="curl \"http://localhost:8081/api/KEY?cmd=show.refresh&tvdbid={info.id}\""

from scripts.

rednoah avatar rednoah commented on August 27, 2024 1

FileBot will use powershell -Command instead of cmd /c starting with r4757.

from scripts.

rednoah avatar rednoah commented on August 27, 2024

Interesting request! You can easily get the series ID via xattr from the file.

Come to think of it... if xattr is working, then this will work right out-of-the-box:

--def exec="curl 'http://localhost:8081/api/APIKEY?cmd=show.refresh&tvdbid={info.id}'"

from scripts.

vember31 avatar vember31 commented on August 27, 2024

Thanks! This will complete my automation process for TV shows!!

In my shell script that's called by Deluge, I have the amc script being executed, followed now by:

filebot -script fn:xattr --def exec="curl 'http://localhost:8081/api/APIKEY?cmd=show.refresh&tvdbid={info.id}'"

I gave it a shot with a new torrent but no luck :/ for testing, I also called it straight from terminal and plugged in a defined value for a show I have instead of using {info.id} to see if it would work, but it did not. I only see 'done' and your emoji after running it at the terminal. I don't have any files being generated by xattr as I haven't used it before...does that matter here or is my command set up wrong? I'm leaning towards the latter...

As a note, when I pasted that URL into the browser with a defined tvdb ID, it successfully updated in Sickrage. In both the script and when I pasted into the browser, I was sure to add the API key in.

Appreciate your time :)

from scripts.

rednoah avatar rednoah commented on August 27, 2024

--def exec is an option for the amc script. You do not need to use the xattr script.

from scripts.

Maximillion195 avatar Maximillion195 commented on August 27, 2024

Hi rednoah,

I cant seem to get this to work;
--def exec="curl 'http://localhost:8081/api/APIKEY?cmd=show.refresh&tvdbid={info.id}'"

Is the {info.id} variable still valid? The only variable I can get to work is {folder}

Thanks!

from scripts.

vember31 avatar vember31 commented on August 27, 2024

First I'd like to apologize that I hadn't confirmed this was working. It works great. I'm using exactly the code from above (with a change to the IP and APIKEY). So the info.id variable is working. Of course make sure you have curl installed too.

exec="curl 'http://localhost:8081/api/APIKEY?cmd=show.refresh&tvdbid={info.id}'"

from scripts.

Maximillion195 avatar Maximillion195 commented on August 27, 2024

Thanks for the reply vember, So you are using the latest amc script? and does your still work if you change the action to test?

I have this exact line in my code apart from the api key is my key:
exec="curl 'http://localhost:8081/api/KEY?cmd=show.refresh&tvdbid={info.id}'"

And the output:
Execute: curl 'http://localhost:8081/api/KEY?cmd=show.refresh&tvdbid='
{"data": {}, "message": "The required parameter: 'tvdbid' was not set", "result": "error"}

from scripts.

Maximillion195 avatar Maximillion195 commented on August 27, 2024

Turns out this command gives the above error if you have the action set to test. When it is set to copy or move etc {info.id} works correctly.

from scripts.

rednoah avatar rednoah commented on August 27, 2024

{id} should be giving you the series id. Use --def exec="echo {json}" to see the raw metadata as json.

from scripts.

 avatar commented on August 27, 2024

I cannot seem to get this to work in Windows.
I am not a super experienced, but i thiink it is because of the quotes around it.
When i use this one. in cmd with double quote instead of a single it does work..
Like this.
curl "http://localhost:8081/api/KEY?cmd=show.refresh&tvdbid={info.id}"
Instead of
curl 'http://localhost:8081/api/KEY?cmd=show.refresh&tvdbid={info.id}'

But when i try to but it together with AMC, i need to write it out like Maximillion did where there are single quotes on the link, otwerwise it won't go trhough.
exec="curl 'http://localhost:8081/api/KEY?cmd=show.refresh&tvdbid={info.id}'"

from scripts.

rednoah avatar rednoah commented on August 27, 2024
  • curl is a Unix tool and won't work on Windows
  • '...' style quotes won't work on Windows

Open Windows CMD and see if you can write a command that will tell Sick* to refresh itself.

Trying to use the --def exec option without basic command-line skills is completely nonsensical and will not lead to success. ;)

from scripts.

 avatar commented on August 27, 2024

Yea i know. the commands line works fine, as i installed curl for windows.
as in it returns this.
curl "http://localhost:8081/api/KEY?cmd=show.refresh&tvdbid={info.id}"

{"data": {}, "message": "Xhas queued to be refreshed", "result": "success"}

but i am not able to use
exec="curl 'http://localhost:8081/api/KEY?cmd=show.refresh&tvdbid={info.id}'"
because of the different quotes.
The command does run, but because it runs like
'http://localhost:8081/api/KEY?cmd=show.refresh&tvdbid={info.id}'
instead of
"http://localhost:8081/api/KEY?cmd=show.refresh&tvdbid={info.id}"
it doesn't work, and i am not sure how to fix this. if possible it is possible. Or is there a easier way to get it to work on windows?

from scripts.

 avatar commented on August 27, 2024

So you can do it that way, nice to know :) Sadly it doesn't seem to fix the problem, might be because of the &, which might be understood wrong..
as in only this paremeter goes through
Parameter: exec = curl "http://localhost:8081/api/KEY?cmd=show.refresh

and ends up giving an error after the &
'tvdbid' is not recognized as an internal or external command, operable program or batch file.

It might be understood as a double command.

from scripts.

rednoah avatar rednoah commented on August 27, 2024

Well, a round of applause for CMD taking stupid to a whole new level.

Here's how it works:
http://stackoverflow.com/a/15262019/1514467

from scripts.

CurtC2 avatar CurtC2 commented on August 27, 2024

When do you think r4757 will be available?

from scripts.

rednoah avatar rednoah commented on August 27, 2024

Have you tried the latest release?

$ filebot -version
FileBot 4.7.8 (r4846)

from scripts.

CurtC2 avatar CurtC2 commented on August 27, 2024

Apologies, I was watching script commits rather than FileBot, my mistake. Thanks!

from scripts.

CurtC2 avatar CurtC2 commented on August 27, 2024

Confirmed this command format works perfectly now in QBittorrent:

exec="curl 'http://localhost:8081/api/YOURAPIKEY?cmd=show.refresh&tvdbid={info.id}'"

Thank you!

from scripts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.