Forums Home | FAQ | Search  
Forums > iGetter for Mac OS X
applescript to automate Multi Megaupload links to iGetter
< Last Thread     Next Thread >
Author
Thread    Post New Thread     Post A Reply

05-08-2008 07:43 PM

Posted by:
Djundi Karjadi

Find more posts by Djundi Karjadi

I wrote this script a couple months ago, I've been an avid fans of iGetter, and use it extensively.... and I thought I share it with you all...
This is not a perfect script by all mean, maybe someone who's a real expert in applescript can modify it and make it better....

such as, at the moment, it will create a TAB on Safari for each link, I don't know how to close the tab properly... what I do is just create a new window before I start the script and let it creates all the TABs, then close the window when it's done its job.

How does it work? Well I steal some of the code from the guy who wrote the script to paste the links from RS to iGetter and modify it to work with MU. However MU is much harder... since you have to actually parse the html source and find the real link within each page... and it needs to be a combination of the 1st link and the 3rd link to make the real link... I really dunno why they did what they did.... but anyhow... after a bunch of trial and error,... this script works :)

Good luck :)

-----------------------------------------------------------------------------
--AppleScript by Djundi Karjadi (dkarjadi@gmail.com)
-- Copy (to clipboard) your list of MegaUpload links (delimited by CR) so 1 link per line
-- make sure you set the default directory where you want the files you're about to download in iGetter Preference
-- then open a new blank browser from your default browser (I use safari)
-- then run this script...
------------------------------------------------------------------------------
set astid to AppleScript's text item delimiters
set mydelim to "document.getElementById(\"downloadhtml\").innerHTML = '<a href=\""
set myend to "\" class=\"downloadlink\""
set thirddelim to "'<a href=\""
set URLlist to (the clipboard) as text
set lastDelimit to AppleScript's text item delimiters
set AppleScript's text item delimiters to ASCII character (13)
set URLlist to every text item of URLlist
set AppleScript's text item delimiters to lastDelimit
tell application "Safari"
repeat with eachURL in URLlist
open location eachURL
delay 3 --- depending on your network speed, I found 3 seconds is enough for me, where it gives safari a change
--- to download the page... you can adjust and add or reduce the delay...
--- if you get an error message, try increasing the delay value... DK
set T to source of document 1
set AppleScript's text item delimiters to mydelim -- to chop off most of the front end we'll keep everything after this.
set lastPart to text item 2 of T -- keep the last part, where the action is.
set simpen to lastPart
set AppleScript's text item delimiters to myend
set myURL to text item 1 of lastPart
set AppleScript's text item delimiters to thirddelim
set sisanya to text item 3 of simpen
set AppleScript's text item delimiters to "."
set myhttp to text item 1 of sisanya
set AppleScript's text item delimiters to ".mega"
set therest to text item 2 of myURL
set toget to myhttp & ".mega" & therest
tell application "iGetter"
GetURL toget
end tell
-- delay 2
-- close tab 2 of window 1
end repeat
end tell
set AppleScript's text item delimiters to astid
--//AppleScript

All times are CT (US)    Post New Thread     Post A Reply
Forum Jump:
< Last Thread     Next Thread >



| Home | News | iGetter | Downloads | Forums |

| Privacy Policy | Contact us |

All contents of these forums are copyright © 2001-2016 Presenta Ltd. All rights reserved.
Forums are moderated by Presenta Ltd.

Powered by: vBulletin Lite Version 1.0.0 Lite
Copyright © Jelsoft Enterprises Limited 2000.