Closed Arvejita closed 3 years ago
Thank you for using my API.
Ok, I have noted the bug. I will fix it today when I got back from work. Should be fixed before Oct 28 2020.
So, I have fixed this bug.
The first bug was on my side, nothing special:
The thing is that if you provide any key, like "title" you get the title and an empty object "download_urls: {}".
The second one was two bugs in one.
First bug: you use a link that has a redirection. I did not know that Pornhub use also the http and redirect it to their https.
I have a solution but it's a bit of work and I will do it tomorrow (28/10/2020
).
So instead of http://pornhub.com/view_video.php?viewkey=ph5cacd6fc1e731
use https://pornhub.com/view_video.php?viewkey=ph5cacd6fc1e731
Second bug: Apparently pornhub have made a little change in their API. They are now randomizing the place of the quality inside the link. See the differences:
Your link:
https........./720P_4000K_217429911.mp4?..........
The link of my test:
https.........../191018_1048_240P_1000K_72472822.mp4......
I have fixed the regex who was doing the parse. It should be ok now ;) I will fix the redirection tomorrow.
Ok, thank you.
Ok, I have fixed this commit with my last pr.
This should now work :
const pornhub = require('@justalk/pornhub-api');
const url = 'http://pornhub.com/view_video.php?viewkey=ph5cacd6fc1e731';
const video = await pornhub.page(url, 'download_urls');
console.log(video)
Describe the bug The 'download_urls' key on the video page function returns an error object:
"{ error: 'An error ocurred' }"
. The thing is that if you provide any key, like "title" you get the title and an empty object"download_urls: {}".
Also, if you dont provide a key it still returns an empty object"download_urls: {} "
. I also looked into the test pages in the github repo and found that the download_urls key returns undefined (Look screenshots).To Reproduce
Screenshots
Thank you for reading..