WmZilla - Webmaster and Marketplace

The Next Generation Webmaster and Trade Forum

Help with M3u8 Reverse Proxy

Horodep

New member

0

0%

Status

Offline

Posts

42

Likes

0

Rep

0

Bits

220

3

Months of Service

0%
Hello forum colleagues, I have an issue with a code that scrapes the URL of one of those video hosting websites that use m3u8 files. Despite being able to obtain the link, this link is subject to the user agent IP and the origin, or perhaps also the referer. Could you please help me understand how I can create a reverse proxy request to play the video on a JW Player?

Below is my attempt at a reverse proxy using curl:

```php
private function curl()
{
// Reverse Proxy
$this->ipClient = $_SERVER['REMOTE_ADDR'];
$this->userAgent = $_SERVER['HTTP_USER_AGENT'];
$this->origin = $_SERVER['HTTP_ORIGIN'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"X-forwarded-for: $this->ipClient",
"User-Agent: $this->userAgent",
"origin: $this->origin",
"referer: https://fembed.cc",
"sec-fetch-dest: iframe",
"sec-fetch-mode: navigate",
"sec-fetch-site: cross-site",
"sec-fetch-user: ?1"
));
}
```
 

249

6,622

6,642

Top