DLFile - 2022/11/12 - beta.15

Post your working scripts, libraries and tools.
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

DLFile - 2022/11/12 - beta.15

Post by TheArkive » 16 Feb 2022, 16:28

AHK v1 version is here.

DLFile is a class for downloading a file. It's meant to be a simple replacement for the Download command with the following improvements:
  • Get live stats: file size, bytes downloaded, Bps, file name, percent complete, and a few more things.
  • Specify a callback func to get and display the live stats.
  • The ability to abort the download by setting obj.cancel := true
  • File downloads as file.ext.temp, and is renamed to specified file.ext on completion.
  • Optionally delete a partial download by setting obj.del_on_cancel := true before calling Obj.Start()
  • Supports resume.
  • Supports batch downloading.

To-Do List:
  • Find a way to make destination locations of batch downloads more flexible.
==================================================
Updates
==================================================

:arrow: Download on GitHub

==================================================

I could use some help with testing the resume feature. I'll be trying to test this of course, but several different servers / downloads need to be tested to make sure at least the basic expected implementation has been covered.
Last edited by TheArkive on 12 Nov 2022, 04:54, edited 11 times in total.

User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: DLFile - 2022/02/17 - beta.3

Post by TheArkive » 17 Feb 2022, 13:53

2022/02/17
  • Resume now works (for the example) - there may be other servers/implementations that need to be addressed.
  • Removed some unneeded bits of code.
  • Updated usage docs.
  • Added methods obj.CheckPartial(), obj.CheckLength().

User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: DLFile - 2022/02/25 - beta.3

Post by TheArkive » 25 Feb 2022, 04:33

2022/02/25
  • Improved example to show how to Cancel/Resume within the GUI.
  • Added del_on_cancel param so this can be set on obj creation.

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: DLFile - 2022/02/25 - beta.3

Post by BoBo » 25 Feb 2022, 04:59

I'm assuming that this is an amazing tool :thumbup: Well, while I've 'reviewed' the code I've realized it's for AHK 2.x :shock:) so testing has to wait a few days :shh:
Nevertheless, are you OK adding two lines to it that IMHO would support your fellow users in the long run? :shifty:

Code: Select all

; https://github.com/TheArkive/DLFile_ahk2
; https://www.autohotkey.com/boards/viewtopic.php?f=83&p=447903#p447903


Thx and keep up your good work. Much appreciated.

Bo 8-)

User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: DLFile - 2022/02/25 - beta.3

Post by TheArkive » 25 Feb 2022, 06:21

BoBo wrote:
25 Feb 2022, 04:59
I'm assuming that this is an amazing tool :thumbup: Well, while I've 'reviewed' the code I've realized it's for AHK 2.x :shock:) so testing has to wait a few days :shh:
Nevertheless, are you OK adding two lines to it that IMHO would support your fellow users in the long run? :shifty:

Code: Select all

; https://github.com/TheArkive/DLFile_ahk2
; https://www.autohotkey.com/boards/viewtopic.php?f=83&p=447903#p447903


Thx and keep up your good work. Much appreciated.

Bo 8-)

Thanks for the cudos 👍. I will update that indeed.

I'll also consider a v1 version.

EDIT: @BoBo commented links added
Last edited by TheArkive on 25 Feb 2022, 07:02, edited 1 time in total.

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: DLFile - 2022/02/25 - beta.3

Post by BoBo » 25 Feb 2022, 06:57

EDIT: @BoBo commented links added
That's good news :thumbup:

[OT]I've always thought about a "downgrader" that validates a script and lists a line# and command that isn't compatible/replaceable with a predecessors command set!?
Kinda #Warn's OutDebug? Well, I've no idea if that's feasible? Thx for listening :silent: [/OT]

User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: DLFile - 2022/02/25 - beta.3

Post by TheArkive » 25 Feb 2022, 07:18

BoBo wrote:
25 Feb 2022, 06:57
[OT]I've always thought about a "downgrader" that validates a script and lists a line# and command that isn't compatible/replaceable with a predecessors command set!?
Kinda #Warn's OutDebug? Well, I've no idea if that's feasible? Thx for listening :silent: [/OT]

I've always wondered what it would take to code something like that. I guess if the initial setup for such a script included a folder of different versions of AutoHotkey.exe then a script could be run with /Validate /StdErrOut to collect errors, but that would likely stop at the first fatal error, and not continue on.

Other than that I envision a big ugly json file with all the command/func/syntax info for each AHK version, which sounds tedious.

One of my other projects ("scintilla complete (almost)") will eventually be a full fledged IDE. I'll use this as an experiment to see how far I can break down the AHK language to catch little things like that, and other likely or common errors. No time frame yet on that project though. But part of it actually includes an entire separate script for constructing such a json file via GUI to organize the process of inputting all the data, and to be well organized and comprehensive. That part is a big work-in-progress, but I'm happy with the foundation.

I keep going back and forth on my decision to drop all that and just use VSCode with all it's fancy extensions, or actually going on with this crazy ambitious project.

User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: DLFile - 2022/02/25 - beta.3

Post by TheArkive » 27 Feb 2022, 14:23

2022/02/27
  • now supports batch downloading (an array of URLs)
  • still supports a single download (url param is a single URL string)
  • updated docs
  • commented out CheckPartial() method for now

User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: DLFile - 2022/02/25 - beta.3

Post by TheArkive » 27 Feb 2022, 23:09

2022/02/28
  • fixed batch download logic to behave as expected

LandonJones
Posts: 2
Joined: 05 Jul 2022, 05:12

Re: DLFile - 2022/02/27 - beta.3

Post by LandonJones » 05 Jul 2022, 05:16

Thanks :)

User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: DLFile - 2022/02/27 - beta.3

Post by TheArkive » 05 Jul 2022, 12:09

@LandonJones

Your first post is a thanks to me? I'm honored :D :thumbup:

Glad you found it useful.

LandonJones
Posts: 2
Joined: 05 Jul 2022, 05:12

Re: DLFile - 2022/02/27 - beta.3

Post by LandonJones » 27 Jul 2022, 02:33

Your most welcome. hehehe

User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: DLFile - 2022/09/07 - beta.8

Post by TheArkive » 07 Sep 2022, 13:53

2022/09/07
  • dest param can now be file or folder when downloading a single file
  • initialized some properties for better error handling in weird situations
  • optimized the Start() and StartDL() methods, removed redundant code
  • updated docs

Post Reply

Return to “Scripts and Functions (v2)”