Skip to content

Instantly share code, notes, and snippets.

@xputerax
Created May 14, 2019 14:36
Show Gist options
  • Select an option

  • Save xputerax/65f003136ba691cbd02f7f62bc8ded08 to your computer and use it in GitHub Desktop.

Select an option

Save xputerax/65f003136ba691cbd02f7f62bc8ded08 to your computer and use it in GitHub Desktop.

Revisions

  1. xputerax created this gist May 14, 2019.
    133 changes: 133 additions & 0 deletions mynakal.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,133 @@
    <?php
    /**
    * MyNakal Link Generator
    *
    * Feed it a (MyNakal) video link, and it will give out
    * the direct video link (.mp4, .3gp, etc)
    * This script was written in 2014 and it most likely does not work anymore
    * This script is uploaded here for academic purposes
    * No harm was intended during the writing of this script
    * Use it at your own risk
    *
    * Copyleft 2014-2019 Aiman Daniel
    */
    set_time_limit(0);
    ?>
    <html>

    <head>
    <meta name="viewport" content="width=device-width, user-scalable=no">
    <title>MyNakal Link Generator ~fap</title>
    <style type="text/css">
    body {
    text-align: center;
    font-family: Arial, Calibri;
    }

    h1 {
    font-family: calibri;
    font-weight: bold;
    color: #f00;
    text-shadow: 0px 0px 1px #000;
    }

    input[type="text"],
    input[type="submit"] {
    width: 50%;
    padding: 3px;
    border: 1px solid #f00;
    border-radius: 2px;
    text-align: center;
    }

    a {
    text-decoration: none;
    }

    img.pvw {
    box-shadow: 0px 0px 1px #000;
    }

    .any {
    color: #555;
    }

    .depan {
    color: #000;
    }

    .belakang {
    color: #444;
    }

    .belakang:hover {
    color: #333;
    }
    </style>
    </head>

    <body>

    <h1>MyNakal Download Link Generator</h1>

    <img src="http://gomotors.net/photos/3d/96/fap_a1713.jpg" width="300" height="300" title="~fap" /></img>

    <br />

    <form method="post">
    <input type="text" name="postURL" placeholder="Video URL"><br />
    <input type="submit" name="submit" value="HUEHUEHUE">
    </form>

    <?php
    if (isset($_POST['submit'])) {

    echo " <hr color=\"#f00\" size=\"3\" />\r\n";

    //http://www.mynakal.com/media/player/config.php?vkey=
    //http://www.mynakal.com/video/1771/boleh-ler
    if (empty($_POST['postURL']) || $_POST['postURL'] == "") {
    die(" <span class=\"any\">Empty URL</span>\r\n </body>");
    } else {

    if (substr(trim($_POST['postURL']), intval(strlen(trim($_POST['postURL'])) - 1), intval(strlen(trim($_POST['postURL'])))) != "/") {
    $_POST['postURL'] .= "/";
    }

    preg_match("/http:\/\/www.mynakal.com\/video\/(.*)\/(.*)\//", trim($_POST['postURL']), $match) ;

    $video = array(
    "URL" => $match[0],
    "ID" => $match[1],
    "TITLE" => str_replace("-", " ", $match[2]),
    );

    $url = "http://www.mynakal.com/media/player/config.php?vkey=";
    $loadXML = @simplexml_load_file($url . $video['ID']) or die("Invalid URL");

    $video['THUMBNAIL'] = $loadXML->video->image;
    $video['DLURL'] = $loadXML->video->src;
    $video['RELATED'] = $loadXML->video->related;

    $video['EXP'] = explode("/", $video['DLURL']);
    $video['EXP1'] = explode(".", $video['EXP'][7]);
    $video['FORMAT'] = $video['EXP1'][1];
    }
    ?>
    <span class="depan">URL</span>: <span class="belakang"><a href="<?= $video['URL']; ?>" title="<?= $video['TITLE']; ?>"><?= $video['URL']; ?></a></span> <br />
    <span class="depan">ID</span>: <span class="belakang"><?= $video['ID']; ?></span> <br />
    <span class="depan">TITLE</span>: <span class="belakang"><?= $video['TITLE']; ?></span> <br />

    <br />

    <span class="depan">PREVIEW</span>: <br />
    <span class="depan"><a href="<?= $video['THUMBNAIL']; ?>" title="<?= $video['TITLE']; ?>"><img src="<?= $video['THUMBNAIL']; ?>" title="<?= $video['TITLE']; ?>" class="pvw" /></img></a></span> <br />
    <br />
    <span class="any">&minus;&nbsp;<a href="<?= $video['DLURL']; ?>" title="<?= $video['TITLE']; ?>"><?= $video['FORMAT']; ?></a>&nbsp;&minus;</span>
    <?php
    }
    ?>

    </body>

    </html>