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

Unable to access Lidarr (http / https mismatch?) #34

Open
gardiol opened this issue Sep 18, 2024 · 5 comments
Open

Unable to access Lidarr (http / https mismatch?) #34

gardiol opened this issue Sep 18, 2024 · 5 comments
Labels
bug Something isn't working feature New feature or request

Comments

@gardiol
Copy link

gardiol commented Sep 18, 2024

Yeah, i am using it, and it shows? Sorry to be such a PIA.

I am trying the "generate/artist_top_tracks/all/" API endpoint, and it seems it cannot connect to Lidarr because of an HTTP / HTTPS.

This is my docker-compose:

      - LIDARR_ENABLED=1
      - LIDARR_IP=xxx.mydomain.com
      - LIDARR_PORT=443
      - LIDARR_USE_SSL=1
      - LIDARR_BASE_API_PATH=/lidarr
      - LIDARR_TOKEN=xxx

(the LIDARR_USE_SSL=1 i found looking in the source code)

But it seems it's not working:

2024-09-18 10:20:35 ERROR    <class 'pyarr.exceptions.PyarrBadRequest'> subsonic_helper.py 153                                                                                               
Traceback (most recent call last):                                                                                                                                                           
  File "/home/user/spotisub/./spotisub/helpers/subsonic_helper.py", line 153, in write_playlist                                                                                              
    is_monitored = lidarr_helper.is_artist_monitored(artist_name_spotify)                                                                                                                    
  File "/home/user/spotisub/./spotisub/helpers/lidarr_helper.py", line 29, in is_artist_monitored                                                                                            
    artists_list = lidarr_client.get_artist()                                                                                                                                                
  File "/home/user/.local/lib/python3.10/site-packages/pyarr/lidarr.py", line 116, in get_artist                                                                                             
    return self._get(                                                                                                                                                                        
  File "/home/user/.local/lib/python3.10/site-packages/pyarr/request_handler.py", line 91, in _get                                                                                           
    response = _process_response(res)                                                                                                                                                        
  File "/home/user/.local/lib/python3.10/site-packages/pyarr/request_handler.py", line 233, in _process_response                                                                             
    raise PyarrBadRequest(f"Bad Request, possibly a bug. {str(res.content)}")                                                                                                                
pyarr.exceptions.PyarrBadRequest: Bad Request, possibly a bug. b'<html>\r\n<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>\r\n<body>\r\n<center><h1>400 Bad Req
uest</h1></center>\r\n<center>The plain HTTP request was sent to HTTPS port</center>\r\n<hr><center>nginx/1.26.2</center>\r\n</body>\r\n</html>\r\n'

It seems a mismatch in LidarrAPI?
I can see you append "https" correctly, but it seems the library still open an HTTP connection

@blastbeng
Copy link
Owner

Yeah, i am using it, and it shows? Sorry to be such a PIA.

I am trying the "generate/artist_top_tracks/all/" API endpoint, and it seems it cannot connect to Lidarr because of an HTTP / HTTPS.

This is my docker-compose:

      - LIDARR_ENABLED=1
      - LIDARR_IP=xxx.mydomain.com
      - LIDARR_PORT=443
      - LIDARR_USE_SSL=1
      - LIDARR_BASE_API_PATH=/lidarr
      - LIDARR_TOKEN=xxx

(the LIDARR_USE_SSL=1 i found looking in the source code)

But it seems it's not working:

2024-09-18 10:20:35 ERROR    <class 'pyarr.exceptions.PyarrBadRequest'> subsonic_helper.py 153                                                                                               
Traceback (most recent call last):                                                                                                                                                           
  File "/home/user/spotisub/./spotisub/helpers/subsonic_helper.py", line 153, in write_playlist                                                                                              
    is_monitored = lidarr_helper.is_artist_monitored(artist_name_spotify)                                                                                                                    
  File "/home/user/spotisub/./spotisub/helpers/lidarr_helper.py", line 29, in is_artist_monitored                                                                                            
    artists_list = lidarr_client.get_artist()                                                                                                                                                
  File "/home/user/.local/lib/python3.10/site-packages/pyarr/lidarr.py", line 116, in get_artist                                                                                             
    return self._get(                                                                                                                                                                        
  File "/home/user/.local/lib/python3.10/site-packages/pyarr/request_handler.py", line 91, in _get                                                                                           
    response = _process_response(res)                                                                                                                                                        
  File "/home/user/.local/lib/python3.10/site-packages/pyarr/request_handler.py", line 233, in _process_response                                                                             
    raise PyarrBadRequest(f"Bad Request, possibly a bug. {str(res.content)}")                                                                                                                
pyarr.exceptions.PyarrBadRequest: Bad Request, possibly a bug. b'<html>\r\n<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>\r\n<body>\r\n<center><h1>400 Bad Req
uest</h1></center>\r\n<center>The plain HTTP request was sent to HTTPS port</center>\r\n<hr><center>nginx/1.26.2</center>\r\n</body>\r\n</html>\r\n'

It seems a mismatch in LidarrAPI? I can see you append "https" correctly, but it seems the library still open an HTTP connection

I haven't tested lidarr using https
I am using https://github.com/totaldebug/pyarr to connect to Lidarr, not sure if it supports HTTPS tho

Reading their docs I haven't found anything about https or ssl, guess i am gonna try to open an issue on their github

@blastbeng
Copy link
Owner

I have opened an issue on their github:

totaldebug/pyarr#178

@gardiol
Copy link
Author

gardiol commented Sep 18, 2024

when i have time i will expose lidarr on http internally, i hope they will shed some light.

@gardiol
Copy link
Author

gardiol commented Sep 18, 2024

Update: i exposed the lidarr API directly on port 8686 on HTTP locally and it works, it seems it's really HTTPS not being supported by PyArr... hope they add support! Meanwhile, let's keep this open for future reference maybe?

@blastbeng
Copy link
Owner

Update: i exposed the lidarr API directly on port 8686 on HTTP locally and it works, it seems it's really HTTPS not being supported by PyArr... hope they add support! Meanwhile, let's keep this open for future reference maybe?

Let's just keep this issue open and wait an answer from the PyArr team, if they say that https isn't supported I'll just close this as "WON'T DO"

@blastbeng blastbeng added bug Something isn't working feature New feature or request labels Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants