Closed ghost closed 8 months ago
@doombr1nger That's pretty cool! Thanks for finding this out and for the contribution!
You can also change the readme accordingly and add yourself to the contributors there (adding a paragraph with those). I like this to be a collaborative project! And again, thanks!
This adds basic session cookie header to all http.GET requests. The only things you need for a valid session are as follows:
I found the cookie using
curl -sS -D - https://www.pornhub.com -o ph.html
and trying every cookie in the response headers, and the only one that will get you a response other than just empty[]
when you GET /video/search_autocomplete is "ss" aka session_id. Fortunately, this is inside the HTML itself (you can check ph.html output by the command) on every page load along with the token and is super easy to get. It's inmeta[name="adsbytrafficjunkycontext"]
in thedata-info
attribute.Anyway, all this fixes search suggestions.
The tokens should last long enough that we don't need any additional logic, but if we do, it would be determining if a token expired when you do a request (in getPornhubContentData) and generating a new one.