jrudio / shart

Command your Radarr and Sonarr applications via Discord
21 stars 4 forks source link

issue setting show folder or quality #5

Closed jgshier closed 6 years ago

jgshier commented 6 years ago

I can setup a movie folder and quality but if I try setting the show, I get back unknown media type: show should be one of movie|show. Also search does not seem to work, i am getting a 404 not found

jgshier commented 6 years ago

Oh I am also using docker.

jrudio commented 6 years ago

When you are searching, are you searching for a movie? Because, I just fixed search movie endpoint to reflect the latest radarr version. (I was on an older version)

The command to setup the root folders and qualities should follow this:

sonarr:

shart set-quality show 4 shart set-folder show 2

radarr

shart set-quality movie 5 shart set-folder movie 1

jgshier commented 6 years ago

Example: I am using docker on ubuntu my /tv is my sonarr path, /movie is my radarr path

shart set-folder show 1 ShartBOTBOT-Today at 5:12 PM unknown media type: show should be one of movie|show shart set-folder show /tv/ ShartBOTBOT-Today at 5:12 PM unknown media type: show should be one of movie|show shart set-folder movie 1 ShartBOTBOT-Today at 5:14 PM fetch radarr root folders failed: 404 Not Found shart set-folder movie /movie ShartBOTBOT-Today at 5:14 PM successfully set root folder to /movie

It sets radarr's path. if I use /movie

Doing a search

shart search movie sicario ShartBOTBOT-Today at 5:15 PM search failed: 404 Not Found

Maybe I am not pulling the correct version?

I am using Radarr v0.2.0.1120

is there any easy way to debug in the docker container?

On Mon, Jul 23, 2018 at 4:39 PM Justin Rudio notifications@github.com wrote:

When you are searching, are you searching for a movie? Because, I just fixed search movie endpoint to reflect the latest radarr version. (I was on an older version)

The command to setup the root folders and qualities should follow this:

sonarr:

shart set-quality show 4 shart set-folder show 2

radarr

shart set-quality movie 5 shart set-folder movie 1

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jrudio/shart/issues/5#issuecomment-407233977, or mute the thread https://github.com/notifications/unsubscribe-auth/AAuJSJSjwTer6l-OEqN1hUbnNj5YXY3pks5uJl6ngaJpZM4VaTlw .

-- Mahalo, Jon Shier

jrudio commented 6 years ago

That first one is a weird issue. It doesn't seem to be parsing the commands correctly. (?)

I just updated shart an hour ago to fix the radarr search on this commit aa7c4cb9e4a1a04f5bfdaa284a0d5fe5f4c55a14 and pushed that update to the docker image

if you run docker run --rm jrudio/shart -version it should show the version fd9058b-dirty which is the latest commit

If you are still getting those issues can you run shart with the -verbose flag?

and then if you can, use docker logs <shart-container-id> to see if there's anything logged.

jgshier commented 6 years ago

So I was not on fd9058b-dirty, I redid my pull. Now my adding the defaults works for shows... Search is also working, but adding fails. I get a 200 in discord, but then get this.

docker logs c4f773c5bc7b bot is listening... shart shart search movie the matrix shart add shart add movie 603 shart set-folder show /tv shart set-folder movie /movie shart set-quality movie 7 shart set-quality show 3 shart add movie 603 failed to add movie: 200 OK shart search show the big bang shart add show 80379 failed to add show: 200 OK

On Mon, Jul 23, 2018 at 6:02 PM Justin Rudio notifications@github.com wrote:

That first one is a weird issue. It doesn't seem to be parsing the commands correctly. (?)

I just updated shart an hour ago to fix the radarr search on this commit aa7c4cb https://github.com/jrudio/shart/commit/aa7c4cb9e4a1a04f5bfdaa284a0d5fe5f4c55a14 and pushed that update to the docker image

if you run docker run --rm jrudio/shart -version it should show the version fd9058b-dirty which is the latest commit

If you are still getting those issues can you run shart with the -verbose flag?

and then if you can, use docker logs to see if there's anything logged.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jrudio/shart/issues/5#issuecomment-407246484, or mute the thread https://github.com/notifications/unsubscribe-auth/AAuJSJxLmjwR7g9sNSBzNfnezM9uh-qYks5uJnI5gaJpZM4VaTlw .

-- Mahalo, Jon Shier

jrudio commented 6 years ago

Are those getting added to sonarr and radarr even though it says failed?

The failed messages are triggered because shart expects a 201 status code not 200.

I'm not sure how to replicate it. It's working on my end 😞 . Maybe I can create an option (when -verbose is on) to output the response body when adding a show/movie, so we can see why we are getting a 200 code.

jgshier commented 6 years ago

I did check both, and they were not added. I would guess the url and api key is correct because search is working?

Mahalo, Jon Sent from my iPhone

On Jul 24, 2018, at 12:16 AM, Justin Rudio notifications@github.com wrote:

Are those getting added to sonarr and radarr even though it says failed?

The failed messages are triggered because shart expects a 201 status code not 200.

I'm not sure how to replicate it. It's working on my end 😞 . Maybe I can create an option (when -verbose is on) to output the response body when adding a show/movie, so we can see why we are getting a 200 code.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

jgshier commented 6 years ago

So my sonarr and radarr have base url. I am guessing that could be my issue, but haven't had a chance to test. Does your requests use the referrer? I am seeing in the referrer, it does not have the base url, but in the original request it does.

X-ApplicationVersion: 2.0.0.5228 Location: /sonarr/api/series/lookup?apikey=myapikey&term=tvdb%3A80379 Cache-Control: no-cache, no-store, must-revalidate Pragma: no-cache Expires: 0 Access-Control-Allow-Origin: * Content-Encoding: gzip Content-Type: text/html Server: Mono-HTTPAPI/1.0 Date: Tue, 24 Jul 2018 16:40:06 GMT Content-Length: 0 Keep-Alive: timeout=15,max=100

/sonarr/api/series/lookup?apikey=myapikey&term=tvdb%3A80379 HTTP/1.1 Host: 172.16.200.10:8989 User-Agent: Go-http-client/1.1 Referer: http://172.16.200.10:8989/api/series/lookup?apikey=myapikey&term=tvdb%3A80379 Accept-Encoding: gzip

/v1/tvdb/shows/en/80379 HTTP/1.1

/v1/tvdb/shows/en/80379 HTTP/1.1 User-Agent: Sonarr/2.0.0.5228 (ubuntu 16.04) Connection: close Host: skyhook.sonarr.tv Accept-Encoding: gzip

200 OK /api/series HTTP/1.1 Host: 172.16.200.10:8989 User-Agent: Go-http-client/1.1 Content-Length: 3837 Content-Type: application/json X-Api-Key: 055af4704763485da861a44d6ec32aec Accept-Encoding: gzip

303 See Other X-ApplicationVersion: 2.0.0.5228 Location: /sonarr/api/series Cache-Control: no-cache, no-store, must-revalidate Pragma: no-cache Expires: 0 Access-Control-Allow-Origin: * Content-Encoding: gzip Content-Type: text/html Server: Mono-HTTPAPI/1.0 Date: Tue, 24 Jul 2018 16:40:06 GMT Content-Length: 0 Keep-Alive: timeout=15,max=98

/sonarr/api/series HTTP/1.1 Host: 172.16.200.10:8989 User-Agent: Go-http-client/1.1 Content-Type: application/json Referer: http://172.16.200.10:8989/api/series X-Api-Key: 055af4704763485da861a44d6ec32aec Accept-Encoding: gzip

200 OK X-ApplicationVersion: 2.0.0.5228 Cache-Control: no-cache, no-store, must-revalidate Pragma: no-cache Expires: 0 Access-Control-Allow-Origin: * Content-Encoding: gzip Content-Type: application/json; charset=utf-8 Server: Mono-HTTPAPI/1.0 Date: Tue, 24 Jul 2018 16:40:07 GMT Transfer-Encoding: chunked Keep-Alive: timeout=15,max=97

jgshier commented 6 years ago

Sonarr Debug logs show on the post its getting a 303. Any easy way to fix?

18-7-24 09:36:46.0|Debug|Api|[GET] /api/queue?sort_by=timeleft&order=asc: 200.OK (5 ms) 18-7-24 09:37:08.3|Debug|Api|[GET] /api/series/lookup?apikey=(removed)&term=tvdb%3A80379: 303.SeeOther (0 ms) 18-7-24 09:37:08.3|Debug|Api|[GET] /api/series/lookup?apikey=(removed)&term=tvdb%3A80379: 200.OK (55 ms) 18-7-24 09:37:08.4|Debug|Api|[POST] /api/series: 303.SeeOther (0 ms) 18-7-24 09:37:08.6|Debug|Api|[GET] /api/series: 200.OK (202 ms)

jgshier commented 6 years ago

Did a test, and yes it works if I remove the baseURL from sonarr, but I am using a reverse proxy so I have to have the baseURL. is there something I can tweak in the clients so it will use what is configured? I have them setup as, -sonarr-url http://172.16.200.10:8989/sonarr and -radarr-url http://172.16.200.12:7878/radarr

it the post for adding its only using http://172.16.200.12:7878/

jrudio commented 6 years ago

I would like to reproduce your environment so I can test against it. Is everything under Docker: Radarr, sonarr, and shart? Which reverse proxy are you using?

Hopefilly, I can push a fix later tonight.

jgshier commented 6 years ago

All all in docker, using nginx

On Wed, Jul 25, 2018 at 11:26 AM Justin Rudio notifications@github.com wrote:

I would like to reproduce your environment so I can test against it. Is everything under Docker: Radarr, sonarr, and shart? Which reverse proxy are you using?

Hopefilly, I can push a fix later tonight.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jrudio/shart/issues/5#issuecomment-407850888, or mute the thread https://github.com/notifications/unsubscribe-auth/AAuJSAu9iE7yz0FrqOm4mWUQW4-yZuwKks5uKLhsgaJpZM4VaTlw .

-- Mahalo, Jon Shier

jrudio commented 6 years ago

Pushed version 614737e-dirty to docker to hopefully fix this

👍