Hellowlol / bw_plex

binge watching for plex
MIT License
368 stars 23 forks source link

Error when using #97

Closed SevereOverfl0w closed 5 years ago

SevereOverfl0w commented 5 years ago

Stacktrace is:

2019-07-17 20:56:06,825 :: bw_plex :: INFO :: plex.py:1021 :: Connectiong to Chrome
2019-07-17 20:56:06,826 :: bw_plex :: ERROR :: plex.py:85 :: There was an exception in client_action
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/requests/models.py", line 379, in prepare_url
    scheme, auth, host, port, path, query, fragment = parse_url(url)
  File "/usr/local/lib/python3.6/dist-packages/urllib3/util/url.py", line 234, in parse_url
    raise LocationParseError(url)
urllib3.exceptions.LocationParseError: Failed to parse: http://::ffff:192.168.0.67:32400/resources

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/bw_plex/bw_plex/plex.py", line 80, in inner
    return func(*args)
  File "/app/bw_plex/bw_plex/plex.py", line 1022, in client_action
    correct_client.connect()
  File "/usr/local/lib/python3.6/dist-packages/plexapi/client.py", line 91, in connect
    data = self.query(self.key, timeout=timeout)
  File "/usr/local/lib/python3.6/dist-packages/plexapi/client.py", line 160, in query
    response = method(url, headers=headers, timeout=timeout, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/requests/sessions.py", line 546, in get
    return self.request('GET', url, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/requests/sessions.py", line 519, in request
    prep = self.prepare_request(req)
  File "/usr/local/lib/python3.6/dist-packages/requests/sessions.py", line 462, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/usr/local/lib/python3.6/dist-packages/requests/models.py", line 313, in prepare
    self.prepare_url(url, params)
  File "/usr/local/lib/python3.6/dist-packages/requests/models.py", line 381, in prepare_url
    raise InvalidURL(*e.args)
requests.exceptions.InvalidURL: Failed to parse: http://::ffff:192.168.0.67:32400/resources

Something to note is that 192.168.0.67 is the IP of the client, not the server.

Hellowlol commented 5 years ago

I know very little about ip adresses, but that ip dont seem to be valid. It seems to mix ipv6 and ipv4. have you enabled support for ipv6 on your plex media server?

SevereOverfl0w commented 5 years ago

It isn't valid. ipv6 support was enabled, so I have disabled it. I'm still getting the same issue though.

I don't understand why it's attempting to connect to that particular IP & port, as plex doesn't run on 192.168.0.67, that's where I'm watching the show from.

Hellowlol commented 5 years ago

I never expected the URL to be invalid, but ill catch the error and proxy the request using the server later.

SevereOverfl0w commented 5 years ago

Where does this address come from? Does plex provide it?

Thu Jul 18 12:01:28 GMT+01:00 2019 Hellowlol notifications@github.com:

I never expected the URL to be invalid, but ill catch the error and proxy the request using the server later.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub [https://github.com/Hellowlol/bw_plex/issues/97?email_source=notifications&email_token=ABO2DWT6GMJSE3VWNRSNFOTQABEQPA5CNFSM4IEUBAB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2ID5AA#issuecomment-512769664] , or mute the thread [https://github.com/notifications/unsubscribe-auth/ABO2DWVOHG2UMLYBFBKGVO3QABEQPANCNFSM4IEUBABQ] . [https://github.com/notifications/beacon/ABO2DWSFVYKI74BAET2DIJDQABEQPA5CNFSM4IEUBAB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2ID5AA.gif]

Hellowlol commented 5 years ago

yes

SevereOverfl0w commented 5 years ago

I was experiencing this on firefox/chrome browsers fwiw.

Hellowlol commented 5 years ago

The info i use comes from http://ip:port/clients btw. The latest commit should catch the invalid url exception.

SevereOverfl0w commented 5 years ago

I'll take a look at that wheeling and see what information it sends out.

It seems odd to me that you're connecting to the client on 32400 though, that's just a web browser. There must be something amiss.

Hellowlol commented 5 years ago

It’s the pretty common, the clients seems to be using different ports on clients iOS fix (at least on my iPhone)is 32500 I don’t think the port is wrong.

Hellowlol commented 5 years ago

Closing this as i dont think there is anymore i can do to fix this. Let me know if any issues should arise.