Comments (18)
@chocobearxo I need this
view-source:https://www.pornhub.com/video/search?search=ass
from pornhub.js.
@chocobearxo Can you verify this with 1.7.4?
Well I've tested it a lot now and the only function that still seems to have issues is randomVideo()
but like stated in another issue regarding that, that's an issue on Pornhub's end, not the library, so in short; yeah I pretty much think 1.7.4
fixed the issues. ๐
For others, this can be easily fixed with a while
loop if you wanna use that.
let res = await pornhub.randomVideo()
while (res.id === 'https://www.pornhub.com/') {
res = await pornhub.randomVideo()
}
// Continue whatever you're doing
from pornhub.js.
Seems this is the same issue as #71, and it works on my side.
I suspect you got a different DOM because of IP (Europe?) or AB Testing.
Can you paste the HTML you get on the search page here or send it to my email? So that I can analyze it.
from pornhub.js.
Seems this is the same issue as #71, and it works on my side. I suspect you got a different DOM because of IP (Europe?) or AB Testing.
Can you paste the HTML you get on the search page here or send it to my email? So that I can analyze it.
What do you mean the HTML I get?
{
data: [],
paging: { current: NaN, maxPage: NaN, isEnd: true },
counting: { from: 0, to: 0, total: 0 }
}
Is all it returns. :)
from pornhub.js.
Oh, do you mean you want me to go to https://www.pornhub.com/
and send you the HTML in "inspect"?
from pornhub.js.
If so; pornhub.zip
from pornhub.js.
view-source_https___www.pornhub.com_video_search_search=ass.zip
from pornhub.js.
I suspect your ph instance got a shadow ban or something. The HTML you gave me is correct. But I think the content you get when you call .searchVideo
might be empty or some warning text.
from pornhub.js.
I suspect your ph instance got a shadow ban or something. The HTML you gave me is correct. But I think the content you get when you call
.searchVideo
might be empty or some warning text.
So? ๐ Is it an issue in the library or?
from pornhub.js.
I'm still figuring out what it can be. I will improve the logging and error detection in the library so that you can monitor what happened.
from pornhub.js.
So it worked before, but not anymore recently? What is the current status?
from pornhub.js.
Guys, maybe I don't understand something, but you just ignore cookies inside buildRequest function. In the end request is always send with empty headers. I just had a problem that all requests return empty results because of age verification.
buildRequest<U extends Record<string, any>, T>(method: 'get' | 'post' | 'post-form', url: string, data?: U): Promise<T> {
const headers: HeadersInit = {}
const opts: RequestInit = { method, headers }
if (method === 'post') {
headers['Content-Type'] = 'application/json'
opts.body = JSON.stringify(data)
}
if (method === 'post-form') {
// headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8'
opts.method = 'post'
if (data) opts.body = this.buildParams<U>(data)
}
return this.fetch(url, opts)
.then(res => this.toJson(res) as T)
.catch(err => Promise.reject(err))
}
As soon as I added locally smth like this:
const headers = { cookie: Object.entries(this.getCookies()).map(pair =>
${pair[0]}=${pair[1]}).join('; ')};
Everything started to work fine
from pornhub.js.
Man ๐ญ You are right. I can't believe this has been wrong for so long.
from pornhub.js.
This request module is like shit ๐ I will reimplement it sometime.
from pornhub.js.
@DummyYummy @chocobearxo v1.7.1 released.
Let me know if it works.
from pornhub.js.
@DummyYummy @chocobearxo v1.7.1 released. Let me know if it works.
Seems like searchVideo()
works, but video()
still throws an error that I mentioned in #80
from pornhub.js.
@chocobearxo Can you verify this with 1.7.4?
from pornhub.js.
So now you can easily focus on the other issues/suggestions whenever you've got time for that. ๐
from pornhub.js.
Related Issues (20)
- align `views` format in `video` and `searchVideo`
- Got 403 Forbidden with `video` HOT 61
- Got 403 Forbidden with `recommendedVideos` HOT 1
- `randomVideo()` returns false information HOT 2
- Feature request: `gif(url)` for GIF page HOT 2
- can you return a m3u8 link on const video = await pornhub.video(url)? HOT 1
- The `recommendedVideos` function always returns empty result HOT 34
- Non-ASCII Characters for search queries are not supported
- Feature Request: Video Previews (.webm)
- ๆฏไปไน่ฎฉไฝ ๆณๅฐ่ฆๅ่ฟไธช้กน็ฎ๏ผ HOT 2
- Is there an option for random videos from pornhub HOT 1
- How to use this package without vpn HOT 1
- How come only models and not pornstars has a `mostRecentVideos` property? HOT 1
- `<pornstar>.mostRecentVideos` returns empty array if no recent UPLOADED videos, but with recent TAGGED videos. HOT 2
- how to convert Embed Url Pornhub to hls m3u8 play HOT 1
- How to list videos and data from models based country HOT 4
- All videos are returning 404 HOT 4
- Video sources returns empty array HOT 3
- v 1.12.2 not yet available in npm HOT 1
- Invalid json response body HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pornhub.js.