-
Notifications
You must be signed in to change notification settings - Fork 17
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
Issue with the randomVideo function #68
Comments
Just go the issue where it'd return the homepage again. {
id: 'https://www.pornhub.com/',
title: 'Free Porn Videos & Sex Movies - Porno, XXX, Porn Tube | Pornhub',
views: 0,
vote: { up: 0, down: 0, total: 0, rating: NaN },
premium: false,
thumb: '',
videos: [],
provider: null,
tags: [],
pornstars: [],
categories: [],
duration: 0,
durationFormatted: '00:00'
} |
Thanks for reporting. I will look into it. |
Btw, I think there is something blocking us to get the correct content. Our CI testing sometimes will fail for unknown reasons. |
|
For the issue of getting homepage from |
It seems to be a bug on PH's end. I just tried the |
Also I just tried: let res = await pornhub.randomVideo()
if (res.id === 'https://www.pornhub.com/') return;
console.log(res)
let info = await pornhub.video(res.id)
console.log(info)
return Those two returns the exact same and neither has a {
id: 'ph61e099ebaefbe',
title: '18 yr old gets backshots ',
views: 0,
vote: { up: 0, down: 0, total: 0, rating: NaN },
premium: false,
thumb: '',
videos: [],
provider: null,
tags: [
'ebony',
'girl-loses-virginity',
'ebony-backshots',
'homemade',
'real-couple-homemade',
'amateur-college',
'anal'
],
pornstars: [],
categories: [
'60FPS',
'Amateur',
'College-(18+)',
'Ebony',
'Female-Orgasm',
'Reality',
'Small-Tits',
'Teen-(18+)',
'Verified-Amateurs'
],
duration: 12,
durationFormatted: '00:12'
}
{
id: 'ph61e099ebaefbe',
title: '18 yr old gets backshots ',
views: 0,
vote: { up: 0, down: 0, total: 0, rating: NaN },
premium: false,
thumb: '',
videos: [],
provider: null,
tags: [
'ebony',
'girl-loses-virginity',
'ebony-backshots',
'homemade',
'real-couple-homemade',
'amateur-college',
'anal'
],
pornstars: [],
categories: [
'60FPS',
'Amateur',
'College-(18+)',
'Ebony',
'Female-Orgasm',
'Reality',
'Small-Tits',
'Teen-(18+)',
'Verified-Amateurs'
],
duration: 12,
durationFormatted: '00:12'
}
Plus the let url = 'https://www.pornhub.com/view_video.php?viewkey=' + res.id with some of the functions :D |
|
For the issue of empty views and votes, this is the output I get from ph61e099ebaefbe. I suspect there is a regional difference in the DOM structure. Btw, you can notice that there is a small diff on title. {
id: 'ph61e099ebaefbe',
url: 'https://www.pornhub.com/view_video.php?viewkey=ph61e099ebaefbe',
title: '18 Yr old Gets Backshots',
views: 3000,
vote: { up: 8, down: 1, total: 9, rating: 0.89 },
premium: false,
thumb: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
preview: 'https://di.phncdn.com/videos/202201/13/401270691/original/(m=eaAaGwObaaamqv)(mh=u1n8G4v4Uj8UTXSs)7.jpg',
videos: [],
categories: [
'60FPS',
'Amateur',
'College-(18+)',
'Ebony',
'Female-Orgasm',
'Reality',
'Small-Tits',
'Teen-(18+)',
'Verified-Amateurs'
],
duration: 12,
durationFormatted: '00:12'
} |
And for the redirection strategy, I would say handling this in the library is not ideal. Maybe we should detect this kind of URL mismatch and throw a Custom Error? |
released in v1.6.0 |
Hi @chocobearxo , do you 100% see the empty |
Dude, this random video is so unstable. I got like 2/5 chances to get the main page. 🤣 |
Sorry can you update me a bit where we're at? 😂
Yes! |
This issue contains many minor items, and most of them have been fixed. |
This has been fixed, haven't it? |
I don't know, did you still get 0 |
I just tried to log the result from {
id: 'ph61b09f51588ec',
url: 'https://www.pornhub.com/view_video.php?viewkey=ph61b09f51588ec',
title: 'Big Ass Latina is Fucked by her Stepbrother after the Gym. she Rides him and Takes all the Cum',
views: 7800000,
vote: { up: 20000, down: 3000, total: 23000, rating: 0.87 },
premium: false,
thumb: 'https://ei.phncdn.com/videos/202112/08/399331681/original/(m=eaf8Ggaaaa)(mh=x3pHVpB3KOGFFwpr)8.jpg',
preview: 'https://ei.phncdn.com/videos/202112/08/399331681/original/(m=eaAaGwObaaaa)(mh=vHcc0xLJsGnbrhm3)8.jpg',
videos: [],
provider: { username: 'lunaalessandra', url: '/model/lunaalessandra' },
tags: [
'step-brother', 'big-ass',
'big-tits', 'ebony',
'cum-on-tits', 'hot-latin',
'hot-step-sister', 'real-amateur',
'sloppy-blowjob', 'sex-after-gym',
'riding-dick', 'doggystyle-pov',
'horny-stepsister', 'big-boobes-babe',
'tight-pussy', 'sexo-duro'
],
pornstars: [],
categories: [
'Big-Ass',
'Big-Tits',
'Blowjob',
'Exclusive',
'HD-Porn',
'Hardcore',
'Latina',
'POV',
'Step-Fantasy',
'Verified-Amateurs',
'Verified-Couples'
],
duration: 1568,
durationFormatted: '26:08',
uploadDate: 2021-12-08T14:08:21.000Z
} So I'd assume it's fixed, yes. :) By the way a reminder that you'd add formatted views (#78) 😄 |
I know, I know 🛩️ |
Hey there,
I just tried out the
randomVideo
function and it doesn't really seem to return the same data as a video from for examplesearchVideo
.For example; the result's
preview
doesn't exist, instead there'sthumb
which returns something rather useless. At least, I have no idea how to convert it to an image url.thumb: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
Another thing, the
views
aren't formatted like videos fromsearchVideo
either. Those will return e.g. "1.2M", but therandomVideo
function will return a whole number. Maybe also return a formatted version, otherwise I have no issue with using:That's just a matter of wanting my code to look clean. :)
I also had an encounter where the
randomVideo
function didn't even return a video, but instead the normal PH homepage xDThe text was updated successfully, but these errors were encountered: