Skip to content
WJunction - Webmaster Forum

PHP - Getting premium link on UPTOBOX

Status
Not open for further replies.
Hi, i'm coding a script for checking premium links on UPTOBOX.
(I tray too for UPLOADING and DEPOSITFILES and I have the same problems).

The code :

PHP:
<?php
session_start();

$cookie='';

$c = curl_init() ;
curl_setopt($c, CURLOPT_URL, "http://uptobox.com/ruke1v5m2xr3");
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_HEADER, 1);
curl_setopt($c,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 6.0; fr; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10'); 
curl_setopt($c, CURLOPT_REFERER,"http://www.uptobox.com");
curl_setopt($c, CURLOPT_COOKIE,$cookie);
$page_c = curl_exec($c);

// To see the premium link on the headers
$pos1=strpos($page_c,'Location: ')+10;
$page_c=substr($page_c,$pos1);
$pos2=strpos($page_c,'Transfer');
$liendeb=trim(substr($page_c,0,$pos2));

//echo $liendeb;
For the moment, everything's right, I can see the premium link.

Now, if I do :
PHP:
header("Location: ".$liendeb);
I'm redirected on an error page in UPTOBOX website

If I do :
PHP:
header("Content-disposition: attachment; filename=Film de fou.avi");
header("Accept-Ranges: bytes"); 
header("Content-Type: application/force-download"); 
header("Content-Transfer-Encoding: binary\n");
header("Content-Length: 1489649524"); 
header("Pragma: no-cache"); 
header("Keep-Alive: timeout=15, max=100"); 
header("Expires: 0"); 
readfile($liendeb);
It's downloading the debrid file, OK, but "readfile()" use my bandwith :(

And if I do

PHP:
$c = curl_init() ;
curl_setopt($c, CURLOPT_URL, $liendeb);
curl_setopt($c, CURLOPT_HTTPHEADER, array("Accept-Ranges: bytes", "Content-Length: 1489649524", "Content-Disposition: attachment", "Content-Type: application/octet-stream", "Content-Transfer-Encoding: binary", "Keep-Alive: timeout=15, max=100", "Connection: Keep-Alive"));
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 6.0; fr; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10'); 
curl_setopt($c, CURLOPT_COOKIE,'$cookie);
$page_c = curl_exec($c);
echo $page_c;
I have a 400 Bad Request

If somebody know how to do, it will be very nice.
 

1 comment

Okay wait, I'm still thinking what you're trying to do!

Store the cookie in a file after you login -> So that it can be used later
Do a simple curl with the cookie file -> To get the Premium link
Download the file using curl, the premium link and cookie file :)

What's with all those redirects? -_- [meh]
 
Status
Not open for further replies.

About the author

S
New Member · Joined
1
Messages
0
Reactions
1
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