nisargshh / dlive-video-embed Goto Github PK
View Code? Open in Web Editor NEWDLive LiveStream Embed for Multi Rare Drop
DLive LiveStream Embed for Multi Rare Drop
dlive video embed can use and work ?
i just stumbled across this embed and was wondering if you can help out with some info on how to use this?
i have changed up a few parts of the code but even with the m3u8 it wont play on video.js or any other player i have found
<?php
error_reporting(E_ERROR | E_PARSE);
$displayname = 'VinylRecords';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://cors-anywhere.herokuapp.com/https://graphigo.prd.dlive.tv/");
curl_setopt($ch, CURLOPT_POST, 1);
$headers = [
'Content-Type: application/json',
'origin: https://dlive.tv',
'Access-Control-Request-Method: GET',
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); // Do not send to screen
$obj1->operationName = "LivestreamPageRefetch";
$obj1->variables->displayname = $displayname;
$obj1->variables->add = false;
$obj1->variables->isLoggedIn = false;
$obj1->extensions->persistedQuery->version = 1;
$obj1->extensions->persistedQuery->sha256Hash = "5fb08d9011ad28aa96b193636a70252a85ec044f7a6c715e3d59c19ebab56e24";
$post_data = json_encode($obj1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
$apiResponse = curl_exec($ch);
if (curl_errno($ch)) {
$error_msg = curl_error($ch);
echo " the error is:" . $error_msg."<br><br>";
}
curl_close($ch);
$jsonArrayResponse = json_decode($apiResponse);
$username = $jsonArrayResponse->data->userByDisplayName->username;
//All video urls
$ch1 = curl_init();
curl_setopt($ch1, CURLOPT_URL,"https://live.prd.dlive.tv/hls/live/" . $username . ".m3u8");
curl_setopt($ch1,CURLOPT_RETURNTRANSFER,1);
$apiResponse = curl_exec($ch1);
curl_close($ch1);
preg_match_all('/(?P<tag>#EXTINF:-1)|(?:(?P<prop_key>[-a-z]+)=\"(?P<prop_val>[^"]+)")|(?<something>,[^\r\n]+)|(?<url>http[^\s]+)/', $apiResponse, $match );
$count = count( $match[0] );
$result = [];
$index = -1;
for( $i =0; $i < $count; $i++ ){
$item = $match[0][$i];
if( !empty($match['tag'][$i])){
//is a tag increment the result index
++$index;
}elseif( !empty($match['prop_key'][$i])){
//is a prop - split item
$result[$index][$match['prop_key'][$i]] = $match['prop_val'][$i];
}elseif( !empty($match['something'][$i])){
//is a prop - split item
$result[$index]['something'] = $item;
}elseif( !empty($match['url'][$i])){
$result[$index]['url'] = $item ;
}
}
// $video_url= $result[$index]['url'];
?>
do you still have this working in some way? seems it is being caused from a cors
if you look above i changed the header with the curl request it was missing 'Access-Control-Request-Method: GET',
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.