Results 1 to 10 of 74
Hybrid View
-
27th Aug 2011, 03:39 PM #1OPMemberWebsite's:
tehMoviez.com 0Senes.com GeekFaceGames.comCurlAxel - PHP file download accelerator
hey, i thought many people will like that.
I just wanted to help, so this PHP class may help some people who need it.
it's not a script, neither a software, it's a class used by developers to be integrated in their scripts.
How about cookies, proxies and other curl option??
well, everybody know curl_setopt_array(), you need to create an array, put all your configs there and pass it to the class using
setCurlOpts(). But keep in mind, these settings will be overwritten:
- CURLOPT_RETURNTRANSFER
- CURLOPT_FOLLOWLOCATION
- CURLOPT_BINARYTRANSFER
- CURLOPT_FRESH_CONNECT
- CURLOPT_CONNECTTIMEOUT
- CURLOPT_FILE
- CURLOPT_RANGE
Included Functins
this is a list of function made in the class
- activeLog() - true or false - to desactivate activate log - log file is created in tempdir
- setUrl() - sets the url to download
- setParts() - number of connection (parts) to be created
- setCookies() - set the cookies string to be passed with the curl request
- setTempDir() - must be absolute parth, if not found, it will be created
- setProgressCallback() - enable progressbars
- setDownloadDir() - must be absolute parth, if not found, it will be created
- setCurlOpts() - this is the function allowing you to set your cookies, proxies and other option as an array of curl options.
- getFileSize() - you may use it to get the file size of a url
- isMT() - check if the given url supports multithreaded connection
- download() - the most important function lol
- slow_download() - force CurlAxel to download file using 1 connection
- fast_download() - force CurlAxel to download file using multiple connection
Version
curent version is 0.5 30/10/11
still have lots of work to do, but i need your feedback!
Example how to use it
It's pretty simple!
PHP Code:$fileurl = "++ url here ++";
$curlaxel = new CurlAxel;
$curlaxel->setUrl($fileurl);
$curlaxel->activeLog(true);
$curlaxel->download();
Want to see progressbars?
It's pretty simple! (see test.php also)
PHP Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script src="js/jquery.js"></script>
<script src="js/jquery.progressbar.min.js"></script>
</head>
<body>
<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
include 'CurlAxel.php';
//$fileurl = "http://cachefly.cachefly.net/100mb.test";
$fileurl = "http://93.190.137.8/1000mb.bin";
echo "downloading $fileurl <br>";
$curlaxel = new CurlAxel;
$curlaxel->setUrl($fileurl);
$curlaxel->setProgressCallback();
$curlaxel->setBufferSize(32*1024*1024);
$curlaxel->activeLog(true);
$curlaxel->download();
Code:<head> <script src="js/jquery.js"></script> <script src="js/jquery.progressbar.min.js"></script> </head>
I'd like to see people using this and providing feedback, if you see an error just activate the log and make a reply here, or contact me directly.
pleas keep it away from commercial use.
Special thanks to CuraHack who motivated me and gave me a great development environment
changelog
version 0.5 30/10/11
- improved link checking method
- added 100% working detailed progress bar (see docs for more infos)
- some code cleanup
version 0.2 16/10/11
- added support for various server responses
- fixed filesize issue when requested server doesn't allow download accelerating
- added support for cookies (passed as string)
- added support for standard curl progress callback functon
version 0.1 29/08/11
- small bug fixes
- added GNU GPL 3 licence
version 0.1b beta 27/08/11
- added optional buffersize to merge files. can be set though setBufferSize (in bytes).the default buffersize is 64Mb
version 0.1a beta 27/08/11
- updated useragent choice as Robin H requested. now mozilla is the default user agent, but can be changed using user curl options array
jokerhacker Reviewed by jokerhacker on . CurlAxel - PHP file download accelerator http://i28.lulzimg.com/e5b0e69371.png hey, i thought many people will like that. I just wanted to help, so this PHP class may help some people who need it. it's not a script, neither a software, it's a class used by developers to be integrated in their scripts. How about cookies, proxies and other curl option?? well, everybody know curl_setopt_array(), you need to create an array, put all your configs there and pass it to the class using setCurlOpts(). But keep in mind, these settings Rating: 5JokerHacker Blog
JokerHacker PHP coding Service // back again!
CurlAxel PHP Download Accelerator
hardly remembering the milk :p
-
27th Aug 2011, 04:37 PM #2MemberWebsite's:
epicimagehost.comNoticed the useragent is just mozilla..
so why not let people decide which useragent they want to set?
And add error handling.
Anyway, nice piece of code.
That's one of the things I can delete of my 'I wanna code this:' list
edit:
This worry's me:
PHP Code:<?php
...
$contents = fread($bh[$i], filesize($partpath));
...
?>
Not sure how PHP would handle it tho, just a guess.
Fix would be to do a while loop and only concatenate x mbyte at once?
But once again, very very useful class.
-
27th Aug 2011, 04:59 PM #3OPMemberWebsite's:
tehMoviez.com 0Senes.com GeekFaceGames.comupdated useragent choice as Robin H requested. now mozilla is the default user agent, but can be changed using user curl options array
version 0.1a beta 27/08/11
http://www.mediafire.com/?vlaxavia2xdocs4JokerHacker Blog
JokerHacker PHP coding Service // back again!
CurlAxel PHP Download Accelerator
hardly remembering the milk :p
-
27th Aug 2011, 05:01 PM #4MemberWebsite's:
epicimagehost.comNice to see you're willing to work on it
And be sure to check out the concatenate issue.
You'll want to have something like this:
PHP Code:<?php
...
$finalpath = $this->downdir . $this->filename;
$i = 0;
while(file_exists($finalpath)){
$finalpath = $this->downdir . substr($this->filename,0,-4) . $i . substr($this->filename,-4);
$i++;
}
$final = fopen($finalpath, "a");
$chunksize = 5 * 1024 * 1024; // 5MB, I have no idea what a decent amount would be
for ($i = 0; $i < sizeof($this->splits); $i++) {
$partpath = $this->tempdir . $this->partnames[$i];
fseek($bh[$i], 0, SEEK_SET);
while(!FEOF($bh[$i])){
$contents = fread($bh[$i], $chunksize);
fwrite($final,$contents);
flush();
fflush();
}
fclose($bh[$i]);
unlink($partpath);
}
fclose($final);
...
?>
I also assume there is a 3 char extension, which you will need to verify first. ( might also been wrongfully done, I always fuckup with substr)
I didn't test it myself.
-
27th Aug 2011, 06:11 PM #5OPMemberWebsite's:
tehMoviez.com 0Senes.com GeekFaceGames.comadded optional buffersize to merge files. can be set though setBufferSize (in bytes).
the default buffersize is 64Mb
0.1b beta 27/08/11
http://www.mediafire.com/?5jhhdhftwgz3yr1
Thank you Robin HJokerHacker Blog
JokerHacker PHP coding Service // back again!
CurlAxel PHP Download Accelerator
hardly remembering the milk :p
-
27th Aug 2011, 06:24 PM #6You can call me G
Great work JokerHacker
My Langotiya Yaars (Chaddi buddies): JmZ, humour, Chutad, Esotorisk, l0calhost, Daniel, Mind Freak?, TLK, Amz
-
27th Aug 2011, 06:37 PM #7OPMemberWebsite's:
tehMoviez.com 0Senes.com GeekFaceGames.comthanks gunda316, i'm glad to hear that from a Respected Developer
i'm fighting to get it under my username lolJokerHacker Blog
JokerHacker PHP coding Service // back again!
CurlAxel PHP Download Accelerator
hardly remembering the milk :p
-
28th Aug 2011, 01:12 AM #8MemberWebsite's:
0Scenes.comthis guy is really brilliant !!!!
-
28th Aug 2011, 01:21 AM #9BannedWebsite's:
CuraShare.Net CuraShare.Me CuraShare.InfoDouble that, I really appreciate your work. +REP
Is it possible to integrate your script/code with Rapidleech?
http://www.besthostingforums.com/showthread.php?t=99087
Thank you!
-
28th Aug 2011, 01:42 AM #10OPMemberWebsite's:
tehMoviez.com 0Senes.com GeekFaceGames.comyou can integrate it in any script you want
@Avix, thanks br0JokerHacker Blog
JokerHacker PHP coding Service // back again!
CurlAxel PHP Download Accelerator
hardly remembering the milk :p
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
download file???
By q295516594 in forum Webmasters, Money MakingReplies: 0Last Post: 3rd Oct 2011, 03:10 PM -
Download Accelerator with Rapidleech
By CuraHack in forum Web Development AreaReplies: 10Last Post: 28th Aug 2011, 03:53 PM -
Why it's not download the file?
By ChaoscripT in forum Web Application/Script SupportReplies: 6Last Post: 13th Aug 2011, 04:03 PM -
Which File host will count download with jdownloader or download manager?
By vonomono in forum File Host DiscussionReplies: 8Last Post: 11th Dec 2010, 12:52 AM
themaCreator - create posts from...
Version 3.45 released. Open older version (or...