-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
plugins.filmon: fix/update #4335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Apart from the HTTPStream concerns, the diff is looking good.
I can't verify the plugin though, because I'm getting SSL/TLS errors, even when setting --http-no-ssl-verify
.
[cli][info] Found matching plugin filmon for URL https://www.filmon.com/tv/zdf
error: Unable to open URL: https://www.filmon.com/tv/zdf (HTTPSConnectionPool(host='www.filmon.com', port=443): Max retries exceeded with url: /tv/zdf (Caused by SSLError(SSLError(1, '[SSL: WRONG_SIGNATURE_TYPE] wrong signature type (_ssl.c:997)'))))
As you've already said in the gitter/matrix channel, the CI didn't start for some reason. You'll have to push to your branch again to re-trigger it.
As I mentioned in the last paragraph of #4334 (comment), the problem is regarding the minimum TLS version required in Open SSL's default configuration on newer distributions.
|
A custom OpenSSL config with Python 3.10 on Arch Linux won't work. Apparently Python 3.10 hardcodes the list of allowed TLS ciphers with its default build arguments (which other distros / systems might be using as well): A workaround is adding a different adapter for https requests for that specific plugin: "Transport Adapters" for specific hosts: from requests import adapters
import ssl
class TLSAdapter(adapters.HTTPAdapter):
def init_poolmanager(self, *args, **kwargs):
ctx = ssl.create_default_context()
ctx.set_ciphers("DEFAULT:@SECLEVEL=1")
return super().init_poolmanager(
*args,
**kwargs,
ssl_context=ctx
)
adapter = TLSAdapter()
self.session.http.mount("https://filmon.com", adapter)
self.session.http.mount("https://www.filmon.com", adapter) |
That works nicely, thank you. Note, I also needed to add |
Hmm, looks like it might need to be conditional for non-Windows systems? Should I import Edit: I'm trying it anyway... if it's the wrong solution it can be changed. Edit: Actually, that probably is the wrong solution. I didn't look carefully enough before, but I see this is only a problem on the Windows build with Python 3.6; builds > 3.6 are OK. https://github.com/streamlink/streamlink/runs/5129918618?check_suite_focus=true#step:9:255 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it might need to be conditional for non-Windows systems?
No. This is a Python 3.10 thing and the new default of the standard library's ssl
module.
From your branch in my W10 VM:
$ streamlink -l debug 'https://filmon.com/tv/zdf'
[cli][debug] OS: Windows 10
[cli][debug] Python: 3.10.2
[cli][debug] Streamlink: 1.3.1+795.ga9e51c7
[cli][debug] Requests(2.27.1), Socks(1.7.1), Websocket(1.2.3)
[cli][debug] Arguments:
[cli][debug] url=https://filmon.com/tv/zdf
[cli][debug] --loglevel=debug
[cli][debug] --ffmpeg-ffmpeg=C:\Program Files (x86)\Streamlink\ffmpeg\ffmpeg.exe
[cli][info] Found matching plugin filmon for URL https://filmon.com/tv/zdf
error: Unable to open URL: https://filmon.com/tv/zdf (HTTPSConnectionPool(host='filmon.com', port=443): Max retries exceeded with url: /tv/zdf (Caused by SSLError(SSLError(1, '[SSL: WRONG_SIGNATURE_TYPE] wrong signature type (_ssl.c:997)'))))
- use alternative/current sources for live and VOD stream info - update schemas - update URL regex - update tests - add support for mp4 VOD sources - add note to docs regarding mp4 VODs - use TLSSecLevel1Adapter()
- use alternative/current sources for live and VOD stream info - update schemas - update URL regex - update tests - add support for .mp4 VOD sources - add note to docs regarding mp4 VODs - add note to docs regarding mp4 VODs - use TLSSecLevel1Adapter()
closes #4332