tgorgdotcom / locast2plex

A very simple script to connect locast to Plex's live tv/dvr feature.
MIT License
234 stars 43 forks source link

Error in function get_ip_location #152

Open kelson6 opened 3 years ago

kelson6 commented 3 years ago

New user here with a problem I'm hoping to get help on. Plex Server and locast2plex will be running on the same PC (my media server). I'm running Win-10 v2004; freshly installed Python v3.9.0; freshly downloaded locast2plex v0.6.

My config.ini: [main] uuid = xzsstylp plex_accessible_ip = 127.0.0.1 locast_username = xxxxxxx locast_password = zzzzzzz

I'm trying to run locast2plex from the CLI. When I execute 'python main.py' from the install directory, here is what I get.

C:\locast2plex>python main.py Initiating Locast2Plex v0.6.2 Opening and Verifying Configuration File. C:\locast2plex\config\config.ini Loading Configuration File: C:\locast2plex\config\config.ini Tuner count set to 3 Server is set to run on 127.0.0.1:6077 UUID set to: xzsstylp... Getting user location... Getting location via IP Address. Got external IP 100.xx.yyy.zzz. / I hid the actual IP address / Error in function get_ip_location: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1122) Could not acertain location. Exiting...

So apparently there is a problem with a location certificate verification that causes the program to exit. My ISP is Verizon. Any help out there to get this running?

tgorgdotcom commented 3 years ago

Hmmm. That's strange. Looks like it's running into issues when accessing the Locast service. I personally test with Python 3.8 on Windows 10 and I don't run into issues like that. Are you able to access the Locast site and stream video on the same computer?

deathbybandaid commented 3 years ago

Could also set location in config to see if that helps

kelson6 commented 3 years ago

Hmmm. That's strange. Looks like it's running into issues when accessing the Locast service. I personally test with Python 3.8 on Windows 10 and I don't run into issues like that. Are you able to access the Locast site and stream video on the same computer?

Thank you for replying. Yes, using Firefox I can log into locast and watch video -- I just did it to make sure. The location service is enabled in Firefox. It auto detects my location at the locast home screen. Also, in Win-10 Privacy section, I have the location services enabled for all apps. Is there any other possible setting in Win-10 that would effect this?

kelson6 commented 3 years ago

Could also set location in config to see if that helps

Thank you. That would be a good thing to try. What entry would I add to config.ini.

deathbybandaid commented 3 years ago

http://api.locastnet.org/api/watch/dma/ip

Seems to provide the location data just fine in a GET from my browser, I'll have to try from python tomorrow.

@tgorgdotcom I think some of l2p issues would be easily fixed if you implemenr a shared requests.session which would keep some session cookies between requests.

kelson6 commented 3 years ago

I think I hit the wrong button by mistake and closed this thread. Any way to reacitvate it?

deathbybandaid commented 3 years ago

override_zipcode

Or

override_latitude and override_longitude

kelson6 commented 3 years ago

override_zipcode

Or

override_latitude and override_longitude

Thank you but that didn't work either.

kelson6 commented 3 years ago

Gentlemen, thank you for your suggestions but I've determined the problem is with something with the Win-10 pro installation of my Media Server. I have multiple computers here so I installed python 3.9.1 and locast2plex on one of my laptops. Using the simple config.ini I listed in my initial post (changing the IP address to the address of the laptop), locast2plex started right up without issue. No problem with the location certificate.

Now comes the unsavory task of trying to find the Win-10 configuration problem. I hate Windows, which is why I use Linux most of the time. If anyone has any thoughts on what in Win-10 could be the source of this, I'm all ears.

-k