Skip to content
WJunction - Webmaster Forum

[PHP] AllDebrid.com link grab

Status
Not open for further replies.
Hello,

This is a script that grab download link from http://www.alldebrid.com.

Requirement:

1. Premium account on alldebrid.
2. CURL enable on server.

You have to add "cookie.txt" file on same folder where you put this script. After that change the file permission into "777".


PHP:
<form method="post" action="">
<input type="text" name="url">
<input type="submit" value="Submit">

<?php
if($_POST['url'])
{
$url=$_POST['url'];


$user = ''; // your username
$pass = ''; // your password

$cookie='cookie.txt';

$login='http://www.alldebrid.com/register/?action=login&returnpage=';
  $ch = curl_init($login);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_HEADER, 1);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  curl_setopt($ch, CURLOPT_REFERER, 'http://google.com/');
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
  curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1');
        curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
        curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
  $page = curl_exec($ch);


$postfields = "login_login=".$user."&login_password=".$pass;
//echo " <br> $postfields";
$fslogin = "http://www.alldebrid.com/register/?action=login&returnpage=http://www.alldebrid.com/service/";









  $ch = curl_init($fslogin);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_HEADER, 1);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  curl_setopt($ch, CURLOPT_REFERER, 'http://google.com/');
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
  
  curl_setopt($ch, CURLOPT_POST, 1);  
  curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); 
  curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1');
        curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
        curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);




  $page3 = curl_exec($ch);



$postfields2 = "";
$loginee= "http://www.alldebrid.com/service.php?link=".$url;



  $ch = curl_init($loginee);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_HEADER, 1);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  curl_setopt($ch, CURLOPT_REFERER, 'http://google.com/');
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
  
  curl_setopt($ch, CURLOPT_POST, 1);  
  curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields2); 
  curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1');
        curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
        curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);




  $page4 = curl_exec($ch);




    if(preg_match('/(http:\/\/.+alldebrid[^\s]+)/', $page4, $link)){


        preg_match("%>(.*?)</a>%U", $data, $name);
        $URL = trim($link[1]);
        $downlz = substr($URL, 0, -1);
        $filename = substr(strrchr($downlz, '/'), 1);


    }






echo $downlz;


//By : NeVieL47 2011

}
?>


If it works, give me your feedback :)

Thanks.
 

1 comment

Hello, I could not make this script work on my site. it works only for 2 days in hors free user account. and the premium does not work. you know why?
 
Status
Not open for further replies.

About the author

N
Banned · Joined
39
Messages
0
Reactions
6
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom