A request to phade. (Using limited download managers)

User avatar
kmv
Joined: Mon Mar 03, 2003 8:31 am
Location: Another day, another city
Org Profile

Post by kmv » Sat May 24, 2003 3:56 pm

Cool script.

Just thought I'd point out that...
$filename="$DOCUMENT_ROOT/.../$file";
...should be secured.

In general you should never pass a file name to a download script you should look it up, but if really have to pass it then it should always be path checked, syntax checked, etc. etc.

User avatar
Phade
Site Admin
Joined: Fri Oct 20, 2000 10:49 pm
Location: Little cabin in the woods...
Org Profile

Post by Phade » Sat May 24, 2003 9:22 pm

Hey,

Yeah, the script takes the video ID and then figures out where in the system it lives (hint: they don't live in a web-accessable area ;-) ).

Phade.

gypsy
Joined: Wed Feb 20, 2002 2:13 pm
Location: South Africa
Contact:
Org Profile

Post by gypsy » Sun May 25, 2003 8:44 am

Well. If the script doesn't work can a new script bee written.

This one should allow uisers to use download managers but it must make a not of the users i.p. If there is more thatn one of the same i.p. connected to the file server the connection must be terminated.

I've seen this script enable in some sites and I think it's very nice. Allowing the user to resume files but not using up all the bandwidth.

gypsy
Joined: Wed Feb 20, 2002 2:13 pm
Location: South Africa
Contact:
Org Profile

Post by gypsy » Wed Jun 04, 2003 3:16 pm

Phade - Could you possibly send this out a newsletter. I'm sure SOMEWHERE between the 73000 members you have ther's bound to be somebody out there with a solution. They could be directed to this topic to take the discussion further.

I'm sure I'm not the only person wiht this problem.

User avatar
kmv
Joined: Mon Mar 03, 2003 8:31 am
Location: Another day, another city
Org Profile

Post by kmv » Wed Jun 04, 2003 3:53 pm

No no, he is with it.

With the exception of the filename problem I pointed out the script is fine, and in his post Phade indicated he understood my concern, knew how to correct it, AND the code he already uses on the site does it the correct way.

In other words it is a simple matter of customising the existing scripts. I rather suspect that the hold up is the amount of time Phade hasn't got.

User avatar
Daio Kaji
Joined: Thu Dec 12, 2002 8:29 am
Location: ..wat goes here now?¿
Org Profile

Post by Daio Kaji » Fri Jun 13, 2003 12:29 am

well this all sounds sweeeet, i also have dial-up (56k, but that's not much better anyways) the non-resume thing is a big problem for me too, especially since most of the best amv's on the site are larger files, it would definately help to not have to worry about getting disconnected

i also have XP and use Getright, but for me, it's been a blessing, i like using it to manage dls, but i haven't had any problems with it since i've gotten it, and i've dled a lot of vids and programs. i also never use more than one connection since it doesn't help me either, one connection or four, the total is basically the same, about 4-5 kb/sk, i think this only works to dl faster when websites place limits on bandwidth per I.P. and that limit is usually higher than dial-up can even access, so when this is ready, a newsletter is not necessary, simply an update placed on the main member page would suffice
If you're reading this, you've gone too far...PREPARE FOR RETRIBUTION!!
Don't judge an AMV by it's anime.. u nooB ;D
Image

User avatar
Giton
Joined: Wed Jun 13, 2001 6:46 pm
Location: Freising, Germany
Org Profile

Post by Giton » Fri Jun 13, 2003 5:33 am

As Phade pointed out, you could try to use Mozilla in the meanwhile.
It's integrated dl manager is very good and you should be able to resume the video without a problem.
If you loose connection to the server or the internet, then first login at dot.org before resuming your dl to be sure it works properly.

User avatar
Phade
Site Admin
Joined: Fri Oct 20, 2000 10:49 pm
Location: Little cabin in the woods...
Org Profile

Post by Phade » Sat Aug 02, 2003 10:03 pm

Hey,

[post rises from the dead...]

I have added the "resume" code, but I have no way to test it since I really don't want to install a download manager. Give it a try and see if it works. The code is set to allow resuming a download after 60 seconds of the previous attempt to download. This means that if you try to resume the download within 60 seconds of your last attempt, you will get an error message instead of the vid.

Let me know how it goes. Good luck and have fun!! ^_^

Phade.

User avatar
Dan42
Joined: Fri Jun 22, 2001 8:19 pm
Contact:
Org Profile

Post by Dan42 » Sat Aug 02, 2003 11:05 pm

Now now Phade, not even testing your code beyond compiling was never exactly a good idea in the programmer's book. :-P Installing a download manager just for the duration of the test can't be *that* bad.

Here's what happened when I tested with Download Accelerator Plus (v5.3), with Acceleration mode set to "normal speed" so it wouldn't open multiple connections.

When I click on LOCAL, I get to the download page where the file starts downloading automatically. Since I want to use DAP, I hit cancel and I drag the link into the DAP window. Since it's been less than one minute, DAP fails to download the file. Wait one minute, hit LOCAL again, this time I am told that
You have already downloaded this video on Aug 2, 2003
If need to re-download it, click here
which is of course false since I didn't complete the download (hell, I didn't even start it). Download completion should be easy to detect; you should only raise the "complete" flag after the whole file has been sent (after the fread loop or the readfile). So again I drag the link into the DAP window. DAP pops a status message with "Cannot retrieve file info". At this point, when I tested my example script with DAP, it was telling me "Testing complete", so right here we have a problem. One of the interesting things about DAP is that it get the file headers and then waits for the user to click "start download". This means that even if I had the "Testing complete" status message, I'd have to wait another 60 seconds before being able to hit the Start Download button. So I wait another minute just to be sure, I hit download, and then it downloads a zero-byte file named 10538 (id of the video).

The 60 second limit is only there to prevent download managers from opening multiple concurrent connection right? Suggestion: use register_shutdown_function to call a function if the user clicks cancel, a function that would reset the time to zero so that the user can restart downloading immediately.
Dan42
Encyclopedist & PHP/SQL guy @ Anime News Network
Webmaster @ Dan42's Jin-Roh Lair & Chiyoko, Millennium Actress

User avatar
Phade
Site Admin
Joined: Fri Oct 20, 2000 10:49 pm
Location: Little cabin in the woods...
Org Profile

Post by Phade » Sat Aug 02, 2003 11:36 pm

Hey,
Dan42 wrote:Download completion should be easy to detect; you should only raise the "complete" flag after the whole file has been sent (after the fread loop or the readfile).
This exactly how the system works. A flag is set at the end of the script saying that the download is completed. This flag should only be set if the script has handed out the entire file.

I did test the script by downloading a vid the normal way and then downloading another using the Mozilla download manager, pausing the download for 30 mins, and then resuming. Both downloads were successful.

The issue you have encountered must be something specific to DAP or something that Mozilla manager corrects for. Does DAP have a FAQ for setting up a server script to work with DAP?

Having the restart happen immediatly after a cancel is exactly the thing I am trying to avoid. register_shutdown_function will run every time the script ends and thus will only run on completion, which does not help solve the problem. The problem is detecting the time between the last attempted download and the current one.
Dan42 wrote:Since I want to use DAP, I hit cancel and I drag the link into the DAP window.
Did you drag the link to the page that you are viewing that starts the download or the link to the video itself? The message "You have already downloaded this video" appears in the page script but not in the script for the video download itself. (my guess is that you tried it on the wrong link)

The only possible printed errors for the file download script are:

* ERROR: File does not exist.
* ERROR: Video is not available for download.
* ERROR: You are attempting to download this video too soon after your last download attempt.
* ERROR: Link information currupted.
* ERROR: You do not have permissions to download local videos.

Phade.

Locked

Return to “Site Help & Feedback”