-
Notifications
You must be signed in to change notification settings - Fork 19
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
The recommendedVideos
function always returns empty result
#92
Comments
Can you provide a reproduction code? I just tested and it works ok. Did you see any error messages? |
I'm on the latest version by the way. await pornhub.recommendedVideos(countryObj).then(res => {
console.log(res)
result = res.data[Object.keys(res.data)[Math.floor(Math.random() * Object.keys(res.data).length)]]
})
I don't see any error messages. |
|
recommendedVideos
function always returns { data: [], paging: { current: 1, maxPage: 1, isEnd: true } }
recommendedVideos
function always returns empty result
Log from startup:
Log when using the function:
And this gave an empty result. |
It's very weird that you received so many deleted cookies. |
Only |
Can you try to call |
That still doesn't work. Using the same instance. My server is located in Ireland so that's where the calls are coming from (I guess) |
Ohh, it's the Hottest section that does. Is there a function for this already or? |
const result = await pornhub.videoList({
order: 'Hottest',
country: 'Ireland',
}) |
Can the |
Check this Country interce "key", it's the same country list extracted out from PH. Pornhub.js/src/types/Country.ts Lines 1 to 44 in a6506b4
|
So is that a "Yes" or? 😅 Like can it take both the "Key" and the "Value" or do I HAVE to pass the "Key" strings? |
Only "key", for example, |
Back to the issue, I will need to know what page you were seeing when you got the empty result. I guess it might be the age restriction page... But not sure how to give you a way to provide that information. Let me try VPN tmr. |
I mean, the other functions work. I'm able to search for videos and get information about the video afterwards, just not |
Also a little side-note, on PH's site, the random video url seems to be while (res.id === 'https://www.pornhub.com/') {
res = await pornhub.randomVideo()
} But would be better if it never happened, right? 😄 |
nice finding, it will check tonight. |
PH is down... but ye seems both url can go to the random page. I will update it to |
OK. I might found the root cause. PH has a JS Protection gate to stop crawler and downloader. They won't accept your requests unless you have a correct reference: ytdl-org/youtube-dl#5930 Actions:
|
I might be wrong because you can access other pages without a problem, idk 😄 |
Yeah, it's just the recommended page. Bit weird. Although do you think it'd be possible to make a download feature to download videos? |
no, but you can try to download from the m3u8 link. See #90 |
Do you have an update on this issue? 🙂 |
I was so busy this week :( |
Check #97 and try dump the page to see what's wrong. |
A little confused what you want me to do? 😄 |
My bad. Can you try to start the application with this constructor? You shall see all the page responses in _dump folder. const pornhub = new PornHub({ dumpPage: false }); |
Hey again, After updating and adding that, I don't see a _dump folder? But I do still get the empty result. |
Update, changed |
lol my bad. should be const pornhub = new PornHub({ dumpPage: true }); |
Yeah I figured 😄 Sent the result above |
Based on the response, you actually received an empty recommendation list... Then this should be related to pornhub's robot detection. I have no way to fix the issue based on these limited information. |
You can try VPN or ip pool to get around it. |
For some reason, with or without passing a country, it always returns nothing. (
{ data: [], paging: { current: 1, maxPage: 1, isEnd: true } }
).I'm guessing PH made some changes, cause it used to work. I think this started occuring like 1-2 weeks ago, not too sure.
The text was updated successfully, but these errors were encountered: