pionxzh / Pornhub.js

Powerful PornHub API for Node.js
MIT License
91 stars 19 forks source link

Get Random Video Function #62

Closed iced-queen closed 1 year ago

iced-queen commented 1 year ago

Hey there, I love this library (as you can probably tell since this isn't my first suggestion xD), and I think it'd be a cool-to-have feature if there was a randomVideo function that would obviously return a random video. 😄 Not just one of the first few "Most Viewed" ones as an example, but completely random. This could also work with Pstars and Models (randomPornstar & randomModel). These functions could also take tags as well (optional) that'd return a random video/pstar/model with these tags, but if no tags are provided, just a completely random video/pstar/model.

I don't even know if this is possible and/or if you wanna make it, but worth a try. 😊

pionxzh commented 1 year ago

Thanks for the suggestion, and I totally understand the use case of this. However, the role of this library is to serve as an unofficial API layer for PornHub, which means my goal is to provide functionalities that can be done on the official website. Therefore, in this case, since there isn't a built-in "random" feature on PornHub, you can achieve a similar outcome by getting a list of videos (with random parameters from things like pre-defined list of keywords) and randomly selecting one from the list.

Few things I have checked:

iced-queen commented 1 year ago

With a quick google search, I found a URL looking like this: https://www.pornhub.com/random (just FYI; if you just click on the link from here, it just redirects you to the main page of PH. If you try to copy the URL and paste it in the search bar where URLs are, it redirects you to a random video.) When I clicked on it, it redirected me onto a completely random video (I think), so I do actually think it is possible :))

Although, I do not know if this allow configs.

Shoutout to "Katie" from this random reddit post 😂

pionxzh commented 1 year ago

Good. Then we can have a randomVideo() 😄

iced-queen commented 1 year ago

Great! I'm trying to figure out if it provides optional tags & if there's an endpoint like this for Pstars/Models as well, so they can all be in the same release if they exist. 😄

iced-queen commented 1 year ago

Also I have a quick question. Does the library support the endpoints "/recommended" and "/video?o=ht" (hottest world wide)?

pionxzh commented 1 year ago

/recommended is not being supported as it's a personalized page, and I didn't find any useful use case for this page. /video?o=? is not being supported, but I think this is a valid use case, feel free to open another feature request!

iced-queen commented 1 year ago

Do you have an (approx) ETA on the next release which contains the current "issues"/suggestions?