-
Notifications
You must be signed in to change notification settings - Fork 12
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
Agent fails to download content when there is a content warning #7
Comments
Hi @sander1 I finally took a look into this and I believe I have a solution but I am running into a bit of a problem. What modified things a bit on the original lines but they can easily be changed back. The idea is if I see there is a key 'content' in the json we pass. If not then we check if there is 'verify_age' in the value for key 'location'. If so we will use urllib2Request to download it again and beautifulsoup to grab the correct information. This works well enough in standard python but it fails inside of the plugin with a certificate error. Pay no mind to the fact that I have shitty if elif statements. I will fix those up and this was mostly for testing as I was debugging stuff.
error message
I replicated how HTTP.py in the plex framework does the request. I am confused why my code gets this error. The ssl.py library in plex is exactly the same as the one on my synology server. I am thinking that Plex does something possibly that is preventing me from using urllib2 directly. Since you work for Plex it seems is there any insight you could provide? |
The problem is that even if you write code to follow the |
It isn't about following the url, the page itself has the data. You could forego useing HTTP.request entirely to get the information required as done below.
I imagine there is a reason to use HTTP.py as it is doing a lot of other stuff but in this case it doesn't return everything we could use. If you think it makes more sense to modify HTTP.py I am happy to do modifications there and send a PR but I figured this would be simpler but that damn SSL error is stumping me. Let me know what you think @sander1 |
Any thoughts on that SSL error @sander1? |
I kept running into SSL issues too, and I haven't been able to "fix" it within the Plex framework (I'm not the dev of the framework btw). For now I use a dirty workaround that does not validate the SSL certificates by adding:
Then use a function like this:
Example in the HGTV Canada URL Service. |
I assume you would not want something that is not validating certs checked in to the repo. Should we open up a issue on the framework about this? Seems like this is a valid issue. I really appreciate your help btw! |
So for a video like the following
https://www.youtube.com/watch?ajax=1&v=G0Qz-ZCwbaQ
The agent is unable to get this information. It would be nice if there was a mechanism to do this. I imagine you would need to provide a username/password though this might cause problems if a person is using two factor. I don't know if you know a better way to approach this @sander1. Is there a secure way for plex agents to store passwords? I imagine I could just make a one off account used only for requesting stuff for the metadata.
The text was updated successfully, but these errors were encountered: