Closed jbalcorn closed 2 years ago
I think this was already solved by someone else, take a look here
And yes you are correct, TSDB uses cloudflare SSL redirect for all pages now. This was a recent change. It also support CORS as well.
Yeah, I was able to get the code to work by changing to using a urllib2.urlopen with a SSL context. I'll take a look at that other fork
The HTTP object being sent says it's a HTTPKit object, but that doesn't match what google gives me. Where is the documentation on that HTTP object and where it comes from?
I was not able to get it to authenticate, even with the changes in https://github.com/mmmmmtasty/SportScanner/issues/23 . So I've created an http proxy from http to https on my local server (apache) and changed a code in init.py to:
url = url.replace(' ', '%20')
url = url.replace('https://www.thesportsdb.com', 'http://localdomain.com')
for i in range(len(posters_to_dl)):
poster_url = posters_to_dl[i].replace('https://www.thesportsdb.com', 'http://localdomain.com')
for i in range(len(banners_to_dl)):
banner_url = banners_to_dl[i].replace('https://www.thesportsdb.com', 'http://localdomain.com')
for i in range(len(fanart_to_dl)):
fanart_url = fanart_to_dl[i].replace('https://www.thesportsdb.com', 'http://localdomain.com')
----------apache config-----------
ProxyRequests Off
<Proxy *> Order deny,allow Allow from all
SSLProxyEngine on ProxyPass /api https://www.thesportsdb.com/api ProxyPassReverse /api https://www.thesportsdb.com/api
ProxyPass /images https://www.thesportsdb.com/images ProxyPassReverse /images https://www.thesportsdb.com/images
------------done------------
I was not able to work around it other way, my knowledge on programming is very limited so maybe there is a better way. anyhow- now it works. One note- I use apache 2.4 and with lower version the proxy config may differ.
I'm getting SSL errors trying to use the SportScanner. it appears that thesportsdb.com is behind Cloudflare and it redirects to HTTPS. It requires SNI. I've tried updating my python but I think the problem is simply that we need to call the URL with SNI.
I'm a rank beginner at python, but I'd be happy to help if anyone can point me in the right direction. I'm assuming the HTTP object in the init.py comes from Plex, but I haven't been able to figure out what class it is and how to modify the call to include the server name.
Any ideas?