trakt / script.trakt

Trakt.tv movie and TV show scrobbler for Kodi
GNU General Public License v2.0
318 stars 149 forks source link

Improve proxy URL configuration (fallback if no scheme is mentionned) #551

Closed henry-nicolas closed 3 years ago

henry-nicolas commented 3 years ago

In case the proxy URL scheme is not mentionned in KODI settings, default to http:// scheme for http proxies.

Closes #550

henry-nicolas commented 3 years ago

For the reference, see below how inputstreamhelper handles it: https://github.com/emilsvennesson/script.module.inputstreamhelper/blob/139b96914cc77ec19a32cc06e3db3708b3e4e4fc/lib/inputstreamhelper/kodiutils.py#L270

Basically the scheme is set following network.httpproxytype (where there is no https option) with a default to 'http://' scheme. Reading the code of inputstreamhelper also shows that {server} is not expected to contain {scheme}, else the proxy address will contain two time the scheme.

henry-nicolas commented 3 years ago

If you prefer - I can also rewrite the PR to re-use the same logic as inputstreamhelper. The benefit would be to add support for schemes like socks.

That would mean rewriting the checkAndConfigureProxy function.