Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Which version of Sonarr is supported? #1

Closed
arogl opened this issue Jan 14, 2020 · 2 comments
Closed

Which version of Sonarr is supported? #1

arogl opened this issue Jan 14, 2020 · 2 comments
Labels
bug Something isn't working fixed Issue is fixed

Comments

@arogl
Copy link
Contributor

arogl commented Jan 14, 2020

hi,

I am running sonarr 3.0.3.688

When I run the first request to try and debug why not working, it returns an encoding of 'text/html'

Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> r = requests.get('http://127.0.0.1:8989/system/status?apikey=')
>>> r.text
'<!DOCTYPE html>\r\n<html lang="en">\r\n  <head>\r\n    <meta charset="utf-8" />\r\n    <meta name="viewport" content="width=device-width, initial-scale=1.0" />\r\n    <meta name="mobile-web-app-capable" content="yes" />\r\n    <meta name="apple-mobile-web-app-capable" content="yes" />\r\n\r\n    <!-- Chrome, Opera, and Firefox OS -->\r\n    <meta name="theme-color" content="#3a3f51" />\r\n    <!-- Windows Phone -->\r\n    <meta name="msapplication-navbutton-color" content="#3a3f51" />\r\n\r\n    <meta name="description" content="Sonarr (Preview)" />\r\n\r\n    <link\r\n      rel="apple-touch-icon"\r\n      sizes="180x180"\r\n      href="/Content/Images/Icons/apple-touch-icon.png?h=AcBDqibE27yWHbMU36dViw"\r\n    />\r\n    <link\r\n      rel="icon"\r\n      type="image/png"\r\n      sizes="32x32"\r\n      href="/Content/Images/Icons/favicon-32x32.png?h=s64FHSxrh1sgZCiBBIVikQ"\r\n    />\r\n    <link\r\n      rel="icon"\r\n      type="image/png"\r\n      sizes="16x16"\r\n      href="/Content/Images/Icons/favicon-16x16.png?h=wksVbPqhKGB2B5P0O0h8IQ"\r\n    />\r\n    <link rel="manifest" href="/Content/Images/Icons/manifest.json?h=DmoSjQqByGr1aINOqvSg9w" />\r\n    <link\r\n      rel="mask-icon"\r\n      href="/Content/Images/Icons/safari-pinned-tab.svg?h=LLFuxx74TMIn3Vx2ai6a1A"\r\n      color="#00ccff"\r\n    />\r\n    <link\r\n      rel="shortcut icon"\r\n      type="image/ico"\r\n      href="/favicon.ico?h=ZX67/60OXHGhAQ+8myebHg"\r\n      data-no-hash\r\n    />\r\n    <meta\r\n      name="msapplication-config"\r\n      content="/Content/Images/Icons/browserconfig.xml"\r\n    />\r\n\r\n    <link rel="stylesheet" type="text/css" href="/Content/Fonts/fonts.css?h=mBv1x1/yHnvphLclzeQIBA">\r\n    <link rel="stylesheet" type="text/css" href="/Content/styles.css?h=Rq/FVI3WakxRPshJ9Ov/Ng">\r\n\r\n    <title>Sonarr (Preview)</title>\r\n\r\n    <!--\r\n      The super basic styling for .root  will live here,\r\n      saves fighting with CSS Modules for ~10 lines\r\n    -->\r\n    <style>\r\n      .root {\r\n        overflow: hidden;\r\n        height: 100%; /* needed for proper layout */\r\n      }\r\n\r\n
 @media only screen and (max-width: 768px) {\r\n        .root {\r\n          display: flex;\r\n          flex-direction: column;\r\n          min-height: 100%;\r\n          height: auto;\r\n        }\r\n      }\r\n    </style>\r\n  </head>\r\n\r\n  <body>\r\n    <div id="portal-root"></div>\r\n    <div id="root" class="root"></div>\r\n  </body>\r\n\r\n  <script src="/initialize.js"></script>\r\n  <script src="/polyfills.js?h=89IBv/Tz0gLBcIaOutX0tA"></script>\r\n  <script src="/vendors~index.js?h=p2hkHfIUNhNgh2+MCq4D7g"></script>\r\n  <script src="/index.js?h=piqqUB3xvOfiTkYmc97Fyg"></script>\r\n</html>\r\n'
>>> print(r.url)
http://127.0.0.1:8989/system/status?apikey=
>>> r.encoding
'ISO-8859-1'
>>> r.headers['content-type']
'text/html'
>>>

I had a look here https://github.com/Sonarr/Sonarr/wiki/API and it says that a JSON response is returned.

Any help appreciated.

Thanks.

@arogl
Copy link
Contributor Author

arogl commented Jan 14, 2020

I found a fix in newshows/helpers.py I changed line 39, 85 and 286 to add to the start of the endpont variable

   /api

I also edited newshows/views.py to update the sonarr urls to add /api to the start.

@faulander
Copy link
Owner

you are perfectly right. Easier would have been to add the /api to the SONARR_URL Environment. I will add a fix to the URL Issue by checking the correct format and appending /api if needed.

@faulander faulander added the bug Something isn't working label Jan 14, 2020
faulander pushed a commit that referenced this issue Jan 14, 2020
@faulander faulander added the fixed Issue is fixed label Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed Issue is fixed
Projects
None yet
Development

No branches or pull requests

2 participants