I wrote this code for someone quickly, Its not pretty but it doesn't need to be.
I will put it here in case it helps anyone.
URL format to put in box
output
I will put it here in case it helps anyone.
URL format to put in box
Code:
http://www.primewire*****watch-2790123-Ember-online-free
output
PHP:
<?php
echo'<form method="post" action="">URL <input type="text" name="site_url" > <input type="submit" value="GET"/></form><br/><br/>';
if(!empty($_POST) && filter_var($_POST['site_url'], FILTER_VALIDATE_URL) == true)
{
$content = file_get_contents(trim($_POST['site_url']));
if(preg_match('/tt([0-9]{5,10})/', $content, $m) && preg_match('/title="Watch (.*) online">/', $content, $t))
{
echo $t[1]."<br/>";
echo "http://www.imdb.com/title/tt".$m[1]."/<br/><br/>";
$dom = new DOMDocument();
$internalErrors = libxml_use_internal_errors(true);
$dom->loadHTML($content);
$divs = $dom->getElementsByTagName("span");
// Add words here that are contained in URLs you dont want shown
$ignore = array("qertewrt","amazonaw","1172934");
foreach($divs as $div)
{
$cl = $div->getAttribute("class");
if ($cl == "movie_version_link")
{
$hrefs = $div->getElementsByTagName("a");
foreach ($hrefs as $href)
$p = parse_url($href->getAttribute("href"));
$s = explode('&', $p['query']);
$ff = base64_decode(str_replace("url=", "", $s[1]));
if (strlen(str_replace($ignore, '', $ff)) == strlen($ff))
echo '<a href="'.$ff.'" target="_blank">'.$ff.'</a><br/>';
}
}
}
}
?>
Last edited: