Jump to content
TheSaint

Downloads Dropbox

Recommended Posts

TheSaint

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  v1.6 DD_1-6.png.b6b2dcd3788d05836424e1a82b0bcd79.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.6.zip  (see Post #7 for a GOG example)

Downloads Dropbox v1.7.zip  (see Post #8 for detail)

OLDER DOWNLOADS

Spoiler

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

Downloads Dropbox v1.3.zip  (111 downloads)

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
  • Like 4

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
TheDcoder
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

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) mean to do that to anybody!!!

3fHNZJ.gif

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

Share this post


Link to post
Share on other sites
TheSaint

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
TheSaint

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
TheSaint

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
Jefrey
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) · RC4 RC4 encryption compatible with PHP and JS 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
TheSaint
Posted (edited)

Updated to v1.6 (see first post for download).

I have no clue, aside from the visual changes, what other improvements I may have made to the pretty basic, but not quite so basic now, program. My apologies about that, the update was done back in November 2017, and did not get uploaded for some reason long lost to me, as the two previous versions haven't been uploaded either. I did discover that I forgot to change the version number in the window title of the program, which was still on v1.5, even though the Program Information dialog correctly said v1.6. So perhaps I got distracted by some life issue at a crucial moment and finishing/uploading got forgotten in the wash. The zip file was named correctly, and I had backed it up, so it may just have been discovery of that wrong version number that delayed/put off uploading. Anyway, I have been using the program on and off since then, mostly with GOG game images, as I am about to describe. Usually I am pretty meticulous at recording update detail.

One of the things my IonGoG Wishlist program does, is grab the full size game image (i.e. cover with title text), when you add a game to it. That program has an option (Ctrl+P) to save the image to a specified location, and that is generally what I use after buying and downloading a game from GOG. I rename the saved JPG file to Folder.jpg, and it displays as a thumbnail for that game in its root folder.

Some games however, have more than one game to them, and while only having one web page at GOG, and thus one game image file, when added to your GOG Library, they show as two or more separate games. The Blackwell Bundle, which is 4 games (or episodes as some see it), is an example of that. When you download that game from GOG, four separate download folders are created by the GOG Downloader. I like to have a correct game image for each. This is where the Downloads Dropbox can help you. Or if you prefer you can just follow the manual instructions to get the correct image for every game, even the ones IonGoG Wishlist gets.

DD_1-6.png

In the screenshot above, is a game image path in the drop field, that I got by right clicking (in Firefox) on a game thumbnail in my GOG Library, then using the 'Copy Image Location' option, then using the 'Paste' button to add to the drop field. The original link had more to it (see thumbnail).

a870ec302c05f8c41445b527ed8e548818aff5a9

But when you paste it into the Downloads Dropbox, it will strip the last portion (_196) off, and you get the following to download.

a870ec302c05f8c41445b527ed8e548818aff5a9

I also clicked on the thumbnail in my GOG Library for that game, and then copied the game title (name) from the popup and then pasted that into the first input field of Downloads Dropbox. Having already specified a destination folder (by drag & drop) in the 4th input, I only need to click ADD to have it appear in the download list (last field). Then I click DOWNLOAD to get that game image ... or add others to the list first.

P.S. If you are going to rename the downloaded image to Folder.jpg, then you don't really need to use the game title (name) in the first input field, just go with the very long default. But as I tend to do a few at a time though, a name can be helpful for recognition to later relocate to game folder and rename.

Edited by TheSaint
  • Like 1

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
TheSaint

Updated to v1.7 (see first post for download).

(v1.7)
Added a feature, where the EXIT button is renamed to RESET, which can be used to clear the memory of the last added URL, so it can be added with the ADD button again.


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

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

    • Tersion
      By Tersion
      Why I can't get more than two simultaneously background downloads?
      Simultaneously background downloads with InetGet() works! It was just server limitation from which I downloaded files.
    • 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
×