TheSaint

Downloads Dropbox

6 posts in this topic

#1 ·  Posted (edited)

Some of you might find this little program I whipped up yesterday, to be useful. I had a need and it was filled.

It is pretty basic and I admit was pretty much slapped together speedily and then fine tuned some time later, and could certainly do with more improving, if you care to do so.

Thanks to Jefrey for his 'parse.au3' for the PHP elements. Source found here. I also used my Dropbox code, found here.

DropboxGUI.png

Gutenberg Project page I used for the screenshot - http://www.gutenberg.org/ebooks/1965

One of their links looks like - http://www.gutenberg.org/ebooks/1965.epub.images?session_id=5932cd1d25afee6150a958323abd8a32d68249a7

V1.3 DropboxGUI_1-3.png

Basically, the Download Dropbox program aims to simplify and speed up downloading of files, with Batch and easy sub-folder creation.

Everything in the program is done by either Drag & Drop or clicking a button. Window floats on top of others, naturally.

1. Drag a folder to the Destination input field to set the destination path.
2. Highlight some text, then drag that text to the drop zone (top edit field), to create the first sub-folder (if you want one). Click the SUB FOLDER button to assign it.
3. Do the same for the next sub-folder (if you want one or instead of the other sub folder). Click the TITLE button to assign it.
4. Select and drag a link (URL) to the drop zone. Click the ADD button to have it added to the Download list (last field).
5. Repeat for more files, that you wish to send to the same destination.
6. Click the DOWNLOAD button to have them start downloading.

If size of each download can be determined, you will see the Progress bar working.

All the buttons & List have a CTRL key feature, some also have a SHIFT key one. See the Program Information dialog for details.

Drop zone and other inputs, can also be typed or pasted into.

Some settings are saved to INI file and recalled on subsequent executions or the click of a button with CTRL held down.

NOTE - I particularly like the Text Drag ability, as that simplifies things when doing lots of sub-folders. No browsing required.

ADVICE - Clicking an entry in the list field, will momentarily display its full link text in the drop zone. Entries on the List are not sorted, so they appear in the order added. Obviously I wanted the program to take up as least desktop space as feasible, so that means truncated list entries etc.

WARNING - Before doing a bunch of links from a site, where the links are not straight forward, do a test run of one. Especially as there is currently no STOP button.

Downloads Dropbox v1.2.zip  (includes au3 & exe) See above for required 'parse.au3' file.

Downloads Dropbox v1.3.zip

IMPROVEMENTS & LIMITATIONS

I have tailored certain elements for Gutenberg Project downloads and another site or two, so things will not work out-of-the-box for all possible download sites. That means you will have to tweak the code for some sites. Straight forward download links (no tricky php) seem to work fine. In particular, while what you might want to get downloads fine, it may be missing the file extension and not have the desired name.

Sometimes, if you drag & drop an image onto the drop zone, the image will display there, and you cannot grab its URL. In those cases, I just right click the original image, grab its URL and paste that into the drop zone. You can clear the displayed image (and any other entry in the drop zone) by holding down CTRL while clicking the DOWNLOAD button.

At this stage, you can only batch download files that you want, to the same destination. I am considering adding a multiple destination ability.

Need to add a STOP button.

P.S. This is my first second full program with the latest AutoIt. :lol:

Edited by TheSaint
3 people like this

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites



#2 ·  Posted

38 minutes ago, TheSaint said:

P.S. This is my first full program with the latest AutoIt. :lol:

Congratulations! :thumbsup:


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I have added some extra comments in the IMPROVEMENTS & LIMITATIONS section of the first post, in bold.

I have also added a WARNING in red before that.

I have been thinking of various improvements, and one of those would be to report when no file extension is found in the download file name, perhaps offering a chance to add it, maybe even an input for alternate or preferred file name.

It would also be good to have the URL parsed on addition, and the determined file name displayed in an input field, which could then be edited. That would of course mean storing things in an INI (etc) file, for recall during downloading. This all feeds into the idea of supporting multiple destinations too.

I am guessing, that the PHP in some download links could be parsed in a similar way to how my browser (Firefox) must do it, to get the true resulting file name. As things stand, the 'parse.au3' include file doesn't do it all, and I have had to tailor code to some specific sites, and and as I come across others, make amendments for them too, no doubt. So it would be good if we could avoid that last, like most downloaders do

Edited by TheSaint

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Updated to v1.3 (see first post).

I had an issue where drag & drop of a folder did not replace the destination folder text.

So I coded a fix and while at it made several other improvements for drag & drop, download failure, etc. I then also decided to add a SIZE in Mb's element.

Not looked at adding the other improvements yet, as listed above, but I guess they will eventually come.

P.S. Some elements of code were indeed slapdash, so I've re-written & relocated some bits to be up to my usual better standard.

Edited by TheSaint

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites

#5 ·  Posted

Added the forgotten new screenshot for v1.3 to first post. Only slight, but important differences. :D


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites

#6 ·  Posted

Quote

I am guessing, that the PHP in some download links could be parsed in a similar way to how my browser (Firefox) must do it, to get the true resulting file name. As things stand, the 'parse.au3' include file doesn't do it all, and I have had to tailor code to some specific sites, and and as I come across others, make amendments for them too, no doubt. So it would be good if we could avoid that last, like most downloaders do

Actually when servers are sending files to be downloaded, they send these headers:

Content-Type: [file mime type]
Content-Disposition: attachment;filename=[true filename with extension]

As parse.au3 lib is just a URL parser to be used with other HTTP libraries, and these headers cannot be taken without actually requesting the page, I don't  think we should add this feature to parse.au3. But by parsing HTTP headers (if you're using thirdy-parties' HTTP libraries, perhaps it's needed to hack it a little), it's possible to get the real filename for the download :) 


My stuff

Spoiler

My UDFs  _AuThread multithreading emulation for AutoIt · _ExtInputBox an inputbox with multiple inputs and more features · forceUTF8 fix strings encoding without knowing its original charset · JSONgen JSON generator · _TCPServer UDF multi-client and multi-task (run on background) event-based TCP server easy to do · _TCPClient_UDF multi-server and multi-task (runs on background) event-based TCP client easy to do · ParseURL and ParseStr functions ported from PHP · _CmdLine UDF easily parse command line parameters, keys or flags · AutoPHP Create documents (bills, incomes) from HTML by sending variables/arrays from AutoIt to PHP · (Un)Serialize Convert arrays and data into a storable string (PHP compatible) · RTTL Plays and exports to MP3 Nokia-format monophonic ringtones (for very old cellphones) · I18n library Simple and easy to use localization library · Scripting.Dictionary OOP and OOP-like approach · Buffer/stack limit arrays to N items by removing the last one once the limit is reached · NGBioAPI UDF to work with Nitgen fingerprint readers · Serial/Licensing system require license key based on unique machine ID from your users · HTTP a simple WinHTTP library that allows GET, POST and file uploads · Thread true AutoIt threads (under-dev) Classes _WKHtmlToX uses wkhtmlto* to convert HTML files and webpages into PDF or images (jpg, bmp, gif, png...) Snippets _Word_DocFindReplaceByLongText replace strings using Word UDF with strings longer than 255 characters (MSWord limit) rangeparser parser for printing-like pages interval (e.g.: "1,2,3-5") EnvParser parse strings/paths with environment variables and get full path Random stuff Super Mario beep sound your ears will hurt

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • TheAutomator
      By TheAutomator
      How can you get the downloads folder in AutoIT?
      As far as i know there isn't a macro for it right? like @Downloads or something?
      The ugly solution would be typing in the whole path but what if the user has chosen another location?
      Need to clear that folder regularly on my work and on different accounts..
      regards, TheAutomator
    • jonson1986
      By jonson1986
      Hello,
      I'm having a condition to copy all urls, having same ending and starting pattern, from source code of a specific website, that's why I write autoit codes but it  only copy very first matched url and exist.
      Could you please help me how can I save all the available URLs matching with my pattern given in codes;
       
      Here are codes
      #RequireAdmin #include <Excel.au3> #include <IE.au3> #include <String.au3> #include <Array.au3> Local $oExcel = _Excel_Open() Local $oWorkbook1 = _Excel_BookOpen($oExcel, @ScriptDir & "\Urls.xlsx", True) ProcessClose ( "iexplore.exe") $file = fileopen(@scriptdir & "\source.txt", 10) $IE = _IECreate(_Excel_RangeRead ($oWorkbook1, Default, "A1"), 0, 0 ) $source = _IEDocReadHTML($IE) FileWrite($file, $source) $target_source2 = _StringBetween($source, 'http://example.com/posts/', '/"') If Not @error Then FileWrite (@scriptdir & "\links.txt", 'http://example.com/posts/' & $target_source2[0] & @crlf) EndIf Thanks