Cregennan / ph-toolkit

A little 🧰 toolkit for pornhub artisans

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fetching video with different resolution

symmetricalbyte opened this issue · comments

i used the code below

<?php
include_once 'vendor/autoload.php';
use Cregennan\PornhubToolkit\Toolkit as Toolkit;
$viewkey = "ph630b998fc0675";
$data = json_decode(Toolkit::GetMediaData($viewkey));
echo Toolkit::GetMediaData("ph630b998fc0675");
?>

and i got this output

[{"defaultQuality":true,"format":"mp4","videoUrl":"https:\/\/ee.phncdn.com\/videos\/202208\/28\/414553391\/480P_2000K_414553391.mp4?validfrom=1678380633&validto=1678387833&rate=500k&burst=1400k&ip=127.0.0.1&ipa=127.0.0.0&hash=5ejW8XmIrJsRK%2BkiVHuRUQXGuQI%3D","quality":"480"}]

its a 480p video where a 1080p version is also available
now how do i fetch a video with different resolution ?

As I remember, only the first link in dom is being parsed. Thanks, I'll add other links too

I know it's my skills cuz I don't know how to print out stuff in php. I searched for it but it seems like they are only for strings.