Skip to content

Instantly share code, notes, and snippets.

@OkoyaUsman
Created September 29, 2022 21:49
Show Gist options
  • Select an option

  • Save OkoyaUsman/4e9a9cce3f0e5a254fbddbc9dbbc8e70 to your computer and use it in GitHub Desktop.

Select an option

Save OkoyaUsman/4e9a9cce3f0e5a254fbddbc9dbbc8e70 to your computer and use it in GitHub Desktop.

Revisions

  1. OkoyaUsman created this gist Sep 29, 2022.
    25 changes: 25 additions & 0 deletions streamvideo.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    <?php
    $url = "";
    $useragent = "";
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_VERBOSE, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 222222);
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_NOBODY, false);
    curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
    curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_HEADERFUNCTION, function($curl, $header){
    header($header);
    return strlen($header);
    });
    curl_setopt($ch, CURLOPT_WRITEFUNCTION, function($curl, $body){
    echo $body;
    return strlen($body);
    });
    $response = curl_exec($ch);
    curl_close($ch);
    exit;
    ?>