pionxzh / Pornhub.js

Powerful PornHub API for Node.js
MIT License
90 stars 19 forks source link

How to list videos and data from models based country #114

Closed bobwatcherx closed 4 months ago

bobwatcherx commented 4 months ago

if i send text country . then find and list videos based by country

example

let mymodel = model.FindByCountry("india")

then list all videos per page from country india

give me example code

bobwatcherx commented 4 months ago

And Channel Country

bobwatcherx commented 4 months ago

why i using pornhub.js in client frontend like svelte or react not work because i want no use node js backend . frontend only

Screenshot 2024-04-27 122652

code load.js


 import { PornHub } from 'pornhub.js'
  import {HttpsProxyAgent } from 'https-proxy-agent'

const proxy = 'https://123.30.154.171:7777'
const httpsAgent = new HttpsProxyAgent(proxy)
let res = null
const pornhub = new PornHub()
pornhub.setAgent(httpsAgent)

export async function loadporn(){
  const result = await pornhub.searchVideo('jav')
console.log(result.data) // first video
return result.data
}

app.svelte

<script>
  import {onMount} from 'svelte'
  import {loadporn} from './func/load.js'
onMount(async()=>{
  res = await loadporn()
})
</script>

{JSON.stringify(res)}
pionxzh commented 4 months ago

This library can only be used on Node.js server side.

pionxzh commented 4 months ago

You can use pornhub.videoList({ order:'Hottest', country: 'India' }) to get the video list in a specific country.