Jump to content

[Question] random part in url


Recommended Posts

Hi all,

Case:

I'm trying to have my script download an file from a URL, but the URL/File keeps changing.

Question:

How can i script in something like/as a wildcard for an URL?

Example:

The URL is something like this "www.meow.com/meow/awesomefile-273-884-58.exe"

273-884-58 is the part that keeps changing to random numbers , File and .exe is what is always thesame

Tried:

InetGet("www.meow.com/meow/awesomefile-2F3DB458.exe", "C:\Users\User\Desktop\" & "*.exe", 1, 1)

InetGet("www.meow.com/meow/awesomefile-2F3DB458.exe", "C:\Users\User\Desktop\" & "?.exe", 1, 1)

InetGet("www.meow.com/meow/awesomefile-2F3DB458.exe", "C:\Users\User\Desktop\File" & "*.exe", 1, 1)

InetGet("www.meow.com/meow/awesomefile-2F3DB458.exe", "C:\Users\User\Desktop\File" & "?.exe", 1, 1)

InetGet("www.meow.com/meow/awesomefile-2F3DB458.exe", "C:\Users\User\Desktop\File*" & ".exe", 1, 1)

well u get my drift.

Thnx in advance,

Aapjuh

Link to post
Share on other sites

weird no permission to edit my own post ^^

Ment:

InetGet("www.meow.com/meow/awesomefile-" & "*.exe", "C:UsersUserDesktop" & "Awesomefile.exe", 1, 1)

InetGet("www.meow.com/meow/awesomefile-" & "?.exe", "C:UsersUserDesktop" & "Awesomefile.exe", 1, 1)

InetGet("www.meow.com/meow/awesomefile*" & ".exe", "C:UsersUserDesktop" & "Awesomefile.exe", 1, 1)

InetGet("www.meow.com/meow/awesomefile?" & ".exe", "C:UsersUserDesktop" & "Awesomefile.exe", 1, 1)

InetGet("www.meow.com/meow/awesomefile*.exe", "C:UsersUserDesktop*" & "Awesomefile.exe", 1, 1)

Link to post
Share on other sites

Local $s_Url = "www.meow.com/meow/awesomefile-2F3DB458.exe"
Local $s_File = StringRegExpReplace($s_Url, ".+/(.+)", "$1")
InetGet($s_Url, "C:UsersUserDesktop" & $s_File, 1, 1)

Edit: You don't have enough total posts yet to be able to edit your posts. IIRC the magic number is 5.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to post
Share on other sites

Thnx for the reply's

i'll try it 2morrow since im at a diffrent pc atm and the rest of my script aint on this one

@Dictatorofzeusa

nah not making malware,

im making a script to automaticaly install latest ccleaner when no ccleaner is installed, keep a log, run once every sunday and automatically do settings and clean, and dl+place latest ccenhancer ini file.

Link to post
Share on other sites

It's just the way you described it, usually "Hyperbolic name+random-characters-to-defeat-filebased-scans+.exe"=bad news.

eg.

#include <INet.au3>
$sSite="http://www.piriform.com/ccleaner/download/standard"
$sSource=_INetGetSource ($sSite)
$aDownload=StringRegExp($sSource,"http://.*ccsetup.*?.exe",3)
MsgBox(0,"Download Link",$aDownload[0])
Edited by DicatoroftheUSA
Link to post
Share on other sites

You should never need that _INetGetSource() function any more. Not since InetRead() has been working correctly and that's a few years now.

$s_Str = BinaryToString(InetRead($sSite))

I see no sense including libraries when you don't need most of the functionality and particularily when there are functions native to AutoIt that will handle the job.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...