Open diegobenincasa opened 1 year ago
Could you test the Pull Request I have with your xtream account and write a comment if it works for you? Instructions to test PR in case you are not aware: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally?tool=webui
@superolmo Sorry for my delayed response. No, it does not work either. I'll test with user-agent set-up inside code again and see if it works. I'll try to post a new status soon.
I found a bug where Hypnotix is unable to authenticate to Xtream API if user-agent is not sent in header request. But as I tried the URL in browser and it worked out of the box, I gave a try looking for the issue - and found it: Xtream API refuses to authenticate if User-Agent is not sent as a request header.
But I found a really easy workaround (not with time now to create a pull request).
In file
xtream.py
, methodauthenticate(self)
, just at the start of try block, add:headers = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36'}
And at the next line (where requests takes place), add a new parameterheaders=headers
.Also in the same
xtream.py
file, in method_get_request(self, URL: str, timeout: Tuple = (2,15))
, add the sameheaders
definition (as described upwards) before the try block and, just after it, in the requests call, add the new parameterheaders=headers
.That should do the trick!