nice work brother
good job brother
4shared soap api based grabber with search by extension !
Collapse
X
-
thats why serious users get irritated.. coz they (newbies) ask for even DOTSOriginally posted by just_m3. View PostI wroted this script as much easier to understand as i could ,
as i posted before this require soap client installed on server side .
This should be easy to read through even for a newbie.
anyways, coding-talk always rocks
n you too man @ just_m3
Leave a comment:
-
thank this script work bro..Originally posted by just_m3. View PostPHP Code:<?php
######################
## forged on gowap.ro#
######################
require_once'config.php';
require_once'functions.php';
$formeruri='http://www.4shared.com/mp3/'.$_GET['id'].'/'.$_GET['mod'].'.html';
# get direct download link
$client = new SoapClient("http://api.4shared.com/servlet/services/DesktopApp?wsdl");
$dlid = $client->getDirectLink(LOGIN,PASSWORD,$formeruri);
$id = $client->decodeLink(LOGIN,PASSWORD,$formeruri);
$info = $client->getFileInfo(LOGIN,PASSWORD,$id);
$regx=array('|\[(.*?)]|i','|\((.*?)\)|i','|www(.*?)$|i');
$nume_fisier=preg_replace($regx,'',utf8_format($info->name));
/// check if 302 and switch $url to header location
/// otherwise use $dlid former url got from api
$head = array_change_key_case(get_headers($dlid, TRUE));
/// switch here
if(!empty($head['location'])){$dlid=$head['location'];}
## if the $url is file location we force to get 200 ok
## the $url location from header must also return 200 ok
$status=get_headers($dlid);
echo $status[0]." ";
if($status[0]=="HTTP/1.1 200 OK") {
echo' <a href="'.htmlspecialchars($dlid).'">'.$nume_fisier.' ['.format_bytes($info->size).'] </a><br/>';
}
/*
## we use else statement if header is not 200 ok
## this works if they modify the header other than 302 or 200
## it will work fine but you will not be able to stop the user
## for beeing redirected if the file doesn't exist anymore .
## uncomment if you want to use it !
else {
echo' <a href="'.htmlspecialchars($dlid).'">'.$nume_fisier.' ['.format_bytes($info->size).'] </a><br/>';
}
*/
## comment this line if you want to use the upper one !
else {
echo"<h1>This file is not available !</h1>";
}
?>
Leave a comment:
-
I wroted this script as much easier to understand as i could ,
as i posted before this require soap client installed on server side .
This should be easy to read through even for a newbie.
Leave a comment:
-
Have you tried:Originally posted by belginfish View Postany idea why changing the code from
toCode:echo' <a href="'.htmlspecialchars($dlid).'">'.$nume_fisier.' ['.format_bytes($info->size).'] </a><br/>';
doesn't work? It redirects to 4shared saying the url is invalidCode:header("Location: ".htmlspecialchars($dlid));
PHP Code:header("Location: ".$dlid);
Leave a comment:
-
any idea why changing the code from
toCode:echo' <a href="'.htmlspecialchars($dlid).'">'.$nume_fisier.' ['.format_bytes($info->size).'] </a><br/>';
doesn't work? It redirects to 4shared saying the url is invalidCode:header("Location: ".htmlspecialchars($dlid));
Leave a comment:
-
PHP Code:<?php
######################
## forged on gowap.ro#
######################
require_once'config.php';
require_once'functions.php';
$formeruri='http://www.4shared.com/mp3/'.$_GET['id'].'/'.$_GET['mod'].'.html';
# get direct download link
$client = new SoapClient("http://api.4shared.com/servlet/services/DesktopApp?wsdl");
$dlid = $client->getDirectLink(LOGIN,PASSWORD,$formeruri);
$id = $client->decodeLink(LOGIN,PASSWORD,$formeruri);
$info = $client->getFileInfo(LOGIN,PASSWORD,$id);
$regx=array('|\[(.*?)]|i','|\((.*?)\)|i','|www(.*?)$|i');
$nume_fisier=preg_replace($regx,'',utf8_format($info->name));
/// check if 302 and switch $url to header location
/// otherwise use $dlid former url got from api
$head = array_change_key_case(get_headers($dlid, TRUE));
/// switch here
if(!empty($head['location'])){$dlid=$head['location'];}
## if the $url is file location we force to get 200 ok
## the $url location from header must also return 200 ok
$status=get_headers($dlid);
echo $status[0]." ";
if($status[0]=="HTTP/1.1 200 OK") {
echo' <a href="'.htmlspecialchars($dlid).'">'.$nume_fisier.' ['.format_bytes($info->size).'] </a><br/>';
}
/*
## we use else statement if header is not 200 ok
## this works if they modify the header other than 302 or 200
## it will work fine but you will not be able to stop the user
## for beeing redirected if the file doesn't exist anymore .
## uncomment if you want to use it !
else {
echo' <a href="'.htmlspecialchars($dlid).'">'.$nume_fisier.' ['.format_bytes($info->size).'] </a><br/>';
}
*/
## comment this line if you want to use the upper one !
else {
echo"<h1>This file is not available !</h1>";
}
?>Attached Files
Leave a comment:
-
-
To solve this problem just change this line in the file "4shared.php"Originally posted by charith7788 View Postbro when i click the next button in the bottom of the search result page, it comes with 2nd page with type of mp3 as default, check it out
For this line:PHP Code:if($page>1)
{ $ppage = $page-1;
echo "<a href=\"4shared.php?page=".$ppage."&query=".htmlspecialchars($_GET['query'])."\">« Prev</a> | ";
}
//if the number of files can't be divided by 10 (pages)
//add 1 to show the rest of items available
if ($toate % 10 !== 0) {$total=$total_pages+1;}
//if the number of files can be divided by 10 (pages)
else{$total = $total_pages;}
if($page<$total)
{
$addpage = $page+1;
echo "<a href=\"4shared.php?page=".$addpage."&query=".htmlspecialchars($_GET['query'])."\">Next »</a>";
}
echo "<form action=\"4shared.php\" method=\"get\">";
echo "<input type=\"hidden\" name=\"query\" value=\"".htmlspecialchars($_GET['query'])."\" size=\"2\"/>";
echo "<input type=\"text\" name=\"page\" value=\"".$page."\" size=\"2\"/>";
echo "<b>/".$total."</b> <input type=\"submit\" value=\"GO!\"/></form>";
}
PHP Code:if($page>1)
{$ppage = $page-1;
echo "<a href=\"4shared.php?query=".htmlspecialchars($_GET['query'])."&type=".$type."&page=".$ppage."\">« Prev</a> | ";
}
//if the number of files can't be divided by 10 (pages)
//add 1 to show the rest of items available
if ($toate % 10 !== 0) {$total=$total_pages+1;}
//if the number of files can be divided by 10 (pages)
else{$total = $total_pages;}
if($page<$total)
{
$addpage = $page+1;
echo "<a href=\"4shared.php?query=".htmlspecialchars($_GET['query'])."&type=".$type."&page=".$addpage."\">Next »</a>";
}
echo "<form action=\"4shared.php\" method=\"get\">";
echo "<input type=\"hidden\" name=\"query\" value=\"".htmlspecialchars($_GET['query'])."\" size=\"2\"/>";
echo "<input type=\"text\" name=\"page\" value=\"".$page."\" size=\"2\"/>";
echo "<b>/".$total."</b> <input type=\"submit\" value=\"GO!\"/></form>";
}
Leave a comment:
-
bro when i click the next button in the bottom of the search result page, it comes with 2nd page with type of mp3 as default, check it outOriginally posted by The Fox View PostHi all! I made some changes to work with any extension so I want to share with all of you!
[DEMO]: http://multiwap.zz.mu/4shared.php
[NOTE]: Please enter the details of your 4shared account in the file: "config.php" for this to work!
Leave a comment:
-
Did not quite understand, could you explain better?Originally posted by brentg View PostGreat stuff, working fine my side.
PS. How can we remove the default searches on the 4shared.php so that it only shows the search field.
Thanks
Added after 3 minutes:
You're welcome bro... It is a pleasure for me to share!Originally posted by charith7788 View Postgood job, its very important to 4shared mobile downloaders.
Last edited by Freddynic159; 30.03.13, 15:38.
Leave a comment:
-
good job, its very important to 4shared mobile downloaders.Originally posted by The Fox View PostHi all! I made some changes to work with any extension so I want to share with all of you!
[DEMO]: http://multiwap.zz.mu/4shared.php
[NOTE]: Please enter the details of your 4shared account in the file: "config.php" for this to work!
Leave a comment:

Leave a comment: