d8ahazard / FlexTV.bundle

Cast media, fetch stats...do more with less. :D
50 stars 9 forks source link

Unable to find devices #1

Closed mist0706 closed 5 years ago

mist0706 commented 5 years ago

Hi,

Am trying to find my chromescasts but the plugin can't find anything

Running Flex TV - 1.1.106

Dec 16, 2018 13:05:38.764 [0x7f36ee7ff700] DEBUG - Request came in with unrecognized domain / IP 'mango.xxxxxx.lol' in header Host; treating as non-local Dec 16, 2018 13:05:38.765 [0x7f36ee7ff700] DEBUG - Auth: authenticated user 1 as xxxxx Dec 16, 2018 13:05:38.765 [0x7f36ef7ff700] DEBUG - Request: [10.7.2.10:45110 (Allowed Network)] GET /chromecast/rescan (12 live) GZIP Signed-in Token (xxxxx) Dec 16, 2018 13:05:38.766 [0x7f36ef7ff700] DEBUG - Plug-in com.plexapp.plugins.FlexTV has been used 27 times. Dec 16, 2018 13:05:38.766 [0x7f36ef7ff700] DEBUG - [com.plexapp.plugins.FlexTV] Sending command over HTTP (GET): /chromecast/rescan Dec 16, 2018 13:05:38.766 [0x7f36ef7ff700] DEBUG - HTTP requesting GET http://127.0.0.1:37241/chromecast/rescan Dec 16, 2018 13:05:38.778 [0x7f36ef7ff700] DEBUG - HTTP 304 response from GET http://127.0.0.1:37241/chromecast/rescan Dec 16, 2018 13:05:38.778 [0x7f36ef7ff700] DEBUG - [com.plexapp.plugins.FlexTV] HTTP reply status 304, with 0 bytes of content. Dec 16, 2018 13:05:38.778 [0x7f36ee7ff700] DEBUG - Completed: [10.7.2.10:45110] 304 GET /chromecast/rescan (12 live) GZIP 13ms 332 bytes (pipelined: 1)

Running plex version: plex 17680 0.9 0.7 1128728 61480 ? Sl 13:02 0:02 _ Plex Plug-in [com.plexapp.plugins.FlexTV] /usr/lib/plexmediaserver/Resources/Plug-ins-9d51fdfaa/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.14.0.5470-9d51fdfaa /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/FlexTV.bundle

On Ubuntu 18.04.1 LTS \n \l

EDIT: Installed the plugin from WebTools and now it does find the device, however phlex tv is not detecting the devices....

mist0706 commented 5 years ago

Seems i've narrowed it down a little bit. Looking at the plugin logs i see the following:

2019-01-04 09:27:14,955 (7feb47fff700) : DEBUG (init:1263) - Gonna connect to http://10.7.2.10:32400/clients?X-Plex-Token=xxxxxxxxx 2019-01-04 09:27:14,955 (7feb47fff700) : DEBUG (networking:166) - Requesting 'http://10.7.2.10:32400/clients?X-Plex-Token=xxxxxxxxxx' 2019-01-04 09:27:14,957 (7feb47fff700) : CRITICAL (runtime:889) - Exception (most recent call last): File "/usr/lib/plexmediaserver/Resources/Plug-ins-9d51fdfaa/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/runtime.py", line 843, in handle_request result = f(*d) File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/FlexTV.bundle/Contents/Code/init.py", line 287, in Clients casts = fetch_devices() File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/FlexTV.bundle/Contents/Code/init.py", line 1265, in fetch_devices req.load() File "/usr/lib/plexmediaserver/Resources/Plug-ins-9d51fdfaa/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 181, in load f = self._opener.open(req, timeout=self._timeout) File "/usr/lib/plexmediaserver/Resources/Plug-ins-9d51fdfaa/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py", line 438, in open response = self._open(req, data) File "/usr/lib/plexmediaserver/Resources/Plug-ins-9d51fdfaa/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py", line 456, in _open '_open', req) File "/usr/lib/plexmediaserver/Resources/Plug-ins-9d51fdfaa/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py", line 416, in _call_chain result = func(args) File "/usr/lib/plexmediaserver/Resources/Plug-ins-9d51fdfaa/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py", line 1217, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib/plexmediaserver/Resources/Plug-ins-9d51fdfaa/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py", line 1192, in do_open raise URLError(err) URLError: <urlopen error [Errno 111] Connection refused>

The problem is that the IP specified is actually my reverse proxy and hence, nothing is happening.

Is it possible to specify that ip manually? Oh and also it's using http, which should be https when speaking to my reverse proxy...

mist0706 commented 5 years ago

So i changed the line 1253 in init.py to just url = "localhost" to avoid it fetching Network.Address which is the wrong ip in my case (i assume due to it trying to resolve its own hostname ending up with the reverse proxy ip?) Now it seems to be working

mist0706 commented 5 years ago

I gave up and stopped using a reverse proxy for the Plex server. It now plays music and movies but not shows. Will open another issue on the other project.