JustalK / PORNHUB-API

A powerful and complete scrapper for the very famous pornhub.com. This javascript module for node give you the possibility, through an API with many options, to scrap any information out of a page or the search page.
MIT License
130 stars 29 forks source link

When I Try To Get A Model Information I get "no data" #45

Closed Aiotex closed 3 years ago

Aiotex commented 3 years ago

Hello Justalk,

I want to get the data of a model using this command:

async function searchStar() { const model = await pornhub.model('mia khalifa', ['title', 'description', 'rank_model']); console.log(model.title); console.log(model.description); console.log(model.rank_model); }

but I get this: No Data No Data 0

I also have another problem: when I console.log the page (const page = await pornhub.page(url, ['title', 'pornstars', 'download_urls', 'thumbnail_url']); console.log(page);) sometimes I will get this error: { error: 'An error occured' }

JustalK commented 3 years ago

Hello Aiotex, Thank for using my API,

So I have looked into your problem. First, this one :

const model = await pornhub.model('mia khalifa', ['title', 'description', 'rank_model']);
console.log(model.title);
console.log(model.description);
console.log(model.rank_model);
}

I did not pay attention that pornstar was a special kind of model, I made a new parameter for them (I have to let you now, it's not perfect because I have to filter the field like bio for pornstar. It's different from a simple model).

So try that :

const model = await pornhub.model('mia khalifa', ['title', 'description', 'rank_model'], 'pornstar');
console.log(model.title);
console.log(model.description);
console.log(model.rank_model);

For the second bug, I made an update. PornHub is far from being the best website, so some of their links are buggy. By example : https://www.pornhub.com/video/get_media?s=eyJrIjoiNWFlNTAwMGYzMDlhNjlkODJlNmRmNTdkYWU1ZTA3MTY4Nzc4MjMyZCIsInQiOjE2MTQyNjIzOTV9&v=2006034279&e=0

;)