Giter Club home page Giter Club logo

joel2b / xvideos-pornhub-redtube-api Goto Github PK

View Code? Open in Web Editor NEW
118.0 11.0 35.0 164 KB

This script scrapes the HTML from different web pages to get the information from the video (XVideos, PornHub, RedTube) and you can use it in your own video player.

Home Page: https://appsdev.cyou/xv-ph-rt/

License: MIT License

PHP 95.10% JavaScript 3.50% CSS 0.10% HTML 1.30%
xvideos pornhub-api pornhub-scraper redtube scrapping-php crawler scrapper video php pornhub

xvideos-pornhub-redtube-api's Introduction

XVideos PornHub RedTube API

This script scrapes the HTML from different web pages to get the information from the video and you can use it in your own video player.

Features

  • Get video sources (MP4, HLS)
  • Get thumbnail (poster)
  • Get thumbnails for preview (VTT)
  • Add new sites / servers
  • Data caching

Installation

Copy the dir to the root of a web server running PHP 7.

Usage

Only get requests are accepted, so data can be entered directly in url

Parameter Description
site_id id of the site that wants to get the video (xvideos, pornhub, redtube)
video_id id of the video that corresponds to the site
data link to the video, with at least the domain name and video id

Example

<?php

$data = file_get_contents('https://appsdev.cyou/xv-ph-rt/api/?site_id=xvideos&video_id=59934029');

echo '<pre>';
echo json_encode(json_decode($data), JSON_PRETTY_PRINT);
echo '</pre>';

Output

{
    "hls": {
        "all": "https:\/\/cdn77-vid.xvideos-cdn.com\/OydUr0ucV-1QWXmSI8PZ2Q==,1653275126\/videos\/hls\/de\/b6\/c0\/deb6c040575ef28dee0d5a0240c4b04d-1\/hls.m3u8"
    },
    "mp4": {
        "high": "",
        "low": "https:\/\/cdn77-vid-mp4.xvideos-cdn.com\/eBuh1wuU8JQIhDfyyfbtQg==,1653275128\/videos\/3gp\/d\/e\/b\/xvideos.com_deb6c040575ef28dee0d5a0240c4b04d-1.mp4?ui=MTg1LjM3LjIzMS4xMTItL2VtYmVkZnJhbWUvNTk5MzQwMjk_cj0xNjUzMjY0"
    },
    "thumb": "https:\/\/cdn77-pic.xvideos-cdn.com\/videos\/thumbs169lll\/de\/b6\/c0\/deb6c040575ef28dee0d5a0240c4b04d-1\/deb6c040575ef28dee0d5a0240c4b04d.25.jpg",
    "thumbnails": "https:\/\/appsdev.cyou\/xv-ph-rt\/api\/vtt\/eHZpZGVvc3h4eHh4eHh4eIQuPOZKjQDosFrBVWNZOX1KtJt9dZbonjIEXI50IzTCrzqFJoAHlahbZQvC2DdXp-Fx1XhsmsiS643j1783hqaMKYgHFUVR1ph-tCBP2ByTCxE2ni-4TgPLbJJgPrhn1zkDstz7gokdykVZJHnq4Xv0BMKHt801XamPlei3llRW7v1uzFOnKJ816vAHvWwF42CXwAaYtmgOn0VyAW2T6f2zhWaYfFEmAZl0RrlQglvURO7i6RCl5hczo3lOqSt_Oi3U0_jVE_izvU6I0118vTxYFednTzqPgvKCtULWdaJ1anu2mVchMKx3RVG3EOHI-ErxgCCV8YoY4WSVrGmF25o="
}

Example online

https://appsdev.cyou/xv-ph-rt/

How to add more sites / servers

There's a file sources.json, that has the information of all the sites to which the HTML will be extracted, in this it's indicated all the data that can be extracted to the site, for example, HLS, MP4, thumbnails.

It's recommended that the sites have different IP addresses.

In case of adding your own site, add folder api-for-own-servers anywhere on your site so that data can be extracted from it.

Categorize sites

To avoid making dozens of requests and waiting for them all to complete, sites are categorized by loading speed, the first ones will be the fastest (1s, 2s), and the next ones will be slower (3s, 4s, 5s).

How it work

The data is extracted from all the sites in the first category, and if all the data is obtained, no more data is extracted, otherwise, it will continue with the next category until all the data is obtained.

Caution

By default there's a list of sites to obtain data but as they're from third parties there is a risk that they may stop working, so it's recommended that you add your own sites / servers.

xvideos-pornhub-redtube-api's People

Contributors

joel2b avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xvideos-pornhub-redtube-api's Issues

Help sir,, Update

hallo sir,, my own api for pornhub,succes,,finish,

but, have problem sir, please update sir :D

pornhub have 2 link
ex: viewkey=ph12345678abc and viewkey=12345678abc

viewkey=ph12345678abc : WORK
viewkey=12345678abc : NOT work sir

thx before sir :D

Pornhub mp4 links not reachable(Unauthorized)

Hi there,

The return values of Pornhub are not reachable, whenever i try to open one of the mp4 urls that i get back, I see:"Unauthorized
We're sorry, the request requires user authentication".

If I compare your output of the mp4 URL with mine I see the following

  • validfrom= and validto= parameters are diffrent from yours and mine
  • In my mp4 url the ip= parameter is included
  • And the hash= parameter is diffrent fro yours and mine

Here an example of the API output from your server:
https://ev.phncdn.com/videos/202108/13/392894661/1080P_8000K_392894661.mp4?validfrom=1643180690&validto=1643187890&rate=500k&burst=1400k&ipa={YOUR_SERVER_IP}&hash=77z0E0YMwyem74WXDaaZp8kgWAE%3D

and this is my output i get from the api running on my server
https://ev.phncdn.com/videos/202108/13/392894661/1080P_8000K_392894661.mp4?validfrom=1643181735&validto=1643188935&rate=500k&burst=1400k&ip={MY_SERVER_IP}&ipa={MY_SERVER_IP}&hash=nGiYZPZzM0N2MiFZjqbd2AoAiEY%3D

Any idea whats going wrong, has my server IP been blocked for the Pornhub CDN network? Or is there something else wrong? Btw, xvideos is working very good!

Kind regards,

api-your-own-servers giving 500 error

Hi there,

The api-your-own-servers script isnt working anymore, when I check the error logs, this is what I see:

<tr><td colspan="3" style="background: #ff9999"> <b>HTTP_Request2_LogicException</b>: Invalid cookie: '&lt;!doctype html&gt;
&lt;html&gt;
 &lt;head&gt;
&lt;meta charset=&quot;utf-8&quot;&gt;
 &lt;meta name' in <b>/home/server1234/public_html/api/api-for-own-servers/server.php</b> on line <b>76</b></td></tr>
<tr><td colspan="3" style="background-color: #aaaaaa; text-align: center; font-weight: bold;">Exception trace</td></tr>
<tr><td style="text-align: center; background: #cccccc; width:20px; font-weight: bold;">#</td><td style="text-align: center; background: #cccccc; font-weight: bold;">Function</td><td style="text-align: center; background: #cccccc; font-weight: bold;">Location</td></tr>
<tr><td style="text-align: center;">0</td><td>HTTP_Request2->addCookie()</td><td>/home/server1234/public_html/api/api-for-own-servers/server.php:76</td></tr>
 <tr><td style="text-align: center;">1</td><td>Server->set_cookie_bypass()</td><td>/home/server1234 in /home/server1234/public_html/api/api-for-own-servers/HTTP/Request2.php on line 558

any idea?

Blank page

I tried uploading dir to my website, but it's just a blank page

Add YouPorn and Tube8

Could you please add YouPorn and Tube8? after adding sites to the sources.json file shows a null error(((

Help

Warning: require_once(PEAR/Exception.php): failed to open stream: No such file or directory in /www/wwwroot/sv1.telorku.xyz/v/api/HTTP/Request2/Exception.php on line 24

Fatal error: require_once(): Failed opening required 'PEAR/Exception.php' (include_path='.:') in /www/wwwroot/sv1.telorku.xyz/v/api/HTTP/Request2/Exception.php on line 24

in my hosting sir

Don't get pornhub urls

Using this release I am not able to get pornhub video urls. The quality json is empty.

Mp4 HD

MP4 HD format is not working.

high is empty

hello i hope you are fine
its don't got the high url.
its empty

https://appsdev.cyou/xv-ph-rt/api/?site_id=xvideos&video_id=69701791
https://mysite.com/src/?site_id=xvideos&video_id=69701791

{"hls":{"all":"https:\/\/cdn77-vid.xvideos-cdn.com\/a6eaFEfITMQLskye-cuN-w==,1652983906\/videos_new\/hls\/58\/ac\/e7\/58ace7c6a2389d718ba32e383bc7fe5e\/hls.m3u8"},"mp4":{"high":"","low":"https:\/\/cdn77-vid-mp4.xvideos-cdn.com\/ixei7GIL5gWzr9TdZmb8Dg==,1652983907\/videos_new\/3gp\/5\/8\/a\/xvideos.com_58ace7c6a2389d718ba32e383bc7fe5e.mp4?ui=MTg1LjM3LjIzMS4xMTItL2VtYmVkZnJhbWUvNjk3MDE3OTE_cj0xNjUyOTcz"},"thumb":"https:\/\/cdn77-pic.xvideos-cdn.com\/videos_new\/thumbs169lll\/58\/ac\/e7\/58ace7c6a2389d718ba32e383bc7fe5e\/58ace7c6a2389d718ba32e383bc7fe5e.6.jpg","thumbnails":"https:\/\/appsdev.cyou\/xv-ph-rt\/api\/vtt\/eHZpZGVvc3h4eHh4eHh4eIQuPOZKjQDosFrBVWNZOX1KtJt9dZbonjIEXI50IzTCrzqFJoAHlahbZQvC2DdXp9BC04vYf6iFb9Z3AC9b_RUs-NqT1cHVmhG0z_73p4_xnRn3bwqhoslUv-Mg9LTHA3vvQ0KyFKy1MweqoT8N4J1adsqyyoQCw1BkauMeKFQUcVk-K1GeyCY7fH5ymjq4OcodSPuJzhjMQTW8Jriv6FhS5PR7_d9ElgH5MXwGUmt77_oY8WSpRCsYDJWTW9dzJbj6YL5xCEUgXlYunjM-N4fLflsKXjZn3nKJSXul1ZVSoNpyDiwuYOsApXU3YFw_Nfqw7oBF0RdhZ32cPjn1qH6C-8coP4VqtSXDVW1D6ndE"}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.