[PHP] Filesonic Premium Link Generator/Downloader

Status
Not open for further replies.

Lifetalk

Active Member
4,392
2008
2,120
530
_Vick was trying to extort $5/copy outta poor kids in the CB for this script so I figured I'd post it here real quick. lol. Anyway, good for people who might need it.

PHP:
<?php

//Basic API based link generator for Filesonic
//Uses FGC, so doesn't require a curl function, lol

$username = "FILESONICUSERNAME"; //or email lol
$password = "FILESONICPASSWORD"; //just password

$link = "http://www.filesonic.com/file/1234/file.ext"; //does not work, just a sample
$id = explode("/", $link);
$id = trim($id[4]);

$apicall = "http://api.filesonic.com/link?method=getDownloadLink&u=$username&p=$password&ids=$id&format=json";

$page = file_get_contents($apicall);
$page = json_decode($page, TRUE);

$genLink = trim($page['FSApi_Link']['getDownloadLink']['response']['links'][$id]['url']);
if(!$genLink)
{
  exit('false');
}

$headers = get_headers($genLink, true);

echo 'Link: ' . $genLink . "\n";
echo 'Filename: ' . $page['FSApi_Link']['getDownloadLink']['response']['links'][$id]['filename'] . "\n";
echo 'Size: ' . $headers['Content-Length'];

?>

Outputs filename, file link, and size.
 
12 comments
How would this be a Premium Link Generator? :s
The download link from api is restricted to the api from which it has been generated.

Btw, can't believe that people can even try to sell this type of code. :O
 
You mean restricted to the IP? Yes, correct. But this can still help. Put this script on a server, and use wget on the same server to download the links. It CAN be of help in SOME situations.
 
_Vick was trying to extort $5/copy outta poor kids in the CB for this script so I figured I'd post it here real quick. lol. Anyway, good for people who might need it.

I asked Vick_ to code me link grabber by filename and he sent me same code what you share here. Cost me 15 $.

But just want to say good work LT, good script.
 
This code will output the filename associated with the link, too.

Generating a link on the basis of filename is unreliable, because I can append any filename to any link; the file itself is not necessarily going to be the one you want.
 
Status
Not open for further replies.
Back
Top