0

I need something to check if openload video exist, some videos sometimes get removed by DMCA report and i just need to display myself not working links.

Just a sketch what I wanna

$result = mysqli_query($db, "SELECT videos FROM table");
while($row=mysqli_fetch_assoc($result) {

$embedUrl = $row["videos"];

//so i wanna show only not working url's
if($embedUrl == false) 
echo $embedUrl;
} 

This is example of not working link here

2
  • Use curl to fetch the URL. Openload doesn't respond with an HTTP 404 error code for pages not found. You could try inspecting the response for any strings that indicate a page not found. Dec 18, 2018 at 17:04
  • Could you give me an example I never used curl before, there is div with this value We can't find the file you are looking for...
    – Sejoo
    Dec 18, 2018 at 19:56

1 Answer 1

1

Try this. Outputs: 'Video unavailable' if a video doesn't exist.

See comments for step-by-step explanation.

<?php

// Your Openload URL
$url = 'https://openload.co/embed/UgmaOAo1wlg/Horrible.Bosses.2.2014.720p.BluRay.x264.YIFY.mp4';

// Initialize cURL library.
if (($curl = curl_init()) === FALSE)
{
        $errno = curl_errno();
        throw new RuntimeException("curl_init() ($errno): " . curl_strerror($errno));
}

// Tell cURL which URL to operate on. GET is the default method.
curl_setopt($curl, CURLOPT_URL, $url);

// Optionally specify a path to a certificate store in PEM format.
// curl_setopt($curl, CURLOPT_CAINFO, __DIR__ . '/cacert.pem');
// Given Openload URL is requested over https. Allow for some sanity checking.
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, TRUE);
// Set this to the latest SSL standard supported by PHP at the time of this answer.
curl_setopt($curl, CURLOPT_SSLVERSION, 6);

// Return response, so we can inspect its contents.
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
// Openload returns HTTP code 200 if a video wasn't found. Any code >= 400 indicates a different problem.
curl_setopt($curl, CURLOPT_FAILONERROR, TRUE);
// Allow for server-side redirects.
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE);
// Don't include header in response.
curl_setopt($curl, CURLOPT_HEADER, FALSE);

if (($response = curl_exec($curl)) === FALSE)
    throw new RuntimeException("curl_exec() failed for $url: " . curl_error($curl));

// Perform a case-insensitive search for a token that is specific to the 'video not found' page.
if (stripos($response, '<img class="image-blocked" src="/assets/img/blocked.png" alt="blocked">') !== FALSE)
    echo 'Video unavailable';
4
  • Hello @Ro Achterberg what i need to change on this script to get the play back url? is possible to get the playback url with this script? Thank You
    – Leo
    May 27, 2019 at 17:05
  • 1
    Hi Leo, please provide an Openload video so I can update my answer. May 27, 2019 at 18:56
  • Leo, just so I understand you correctly, do you want to hotlink to the actual Openload streaming server? If so, it will be a little harder than to just parse the initial HTML, because they employ some protection mechanism against this. Also, in case you're not aware, this is probably against their ToS. May 28, 2019 at 12:51
  • Please check this question: stackoverflow.com/questions/56345129/… if i get it on streamango i can do it and on openload thank you
    – Leo
    May 28, 2019 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.