Sign in to follow this  
Followers 0
WhiteCrow

Site leapfrog

3 posts in this topic

#1 ·  Posted (edited)

This is a little script i made to get the content of a website.

Hope it is of use to anyone ;)

What this script does is, get the jpg's of a website, it counts up.

First it wil count the jpgs, and downloads them to C:\Temp\Data\

and then it wil go up a directory, and download all jpgs in that dir again.

#Include <Constants.au3>
#Include <string.au3>
#include <Array.au3>

$count=0
$counter=0

;=============these are the settings :)=================

$starturl="http://www.fakewebsite.com/content/0001/00.jpg"

$downloadpath= "c:\Temp\Data\"  

;=======Warning, this script uses alot of bandwith!======



$startcopy=$starturl

Do

Do
$counter=$counter+1

$starturl_regexp3= StringRegExp($startcopy, '(\d*)', 3)

$jpgnaam= $starturl_regexp3[UBound($starturl_regexp3)-1]

$timestamp=@year & "_" & @mon & "-" & @mday  & "_" &  @hour & "-" & @min & "-" & @sec & " _ "

if $counter=1 then
$directory=$starturl_regexp3[UBound($starturl_regexp3)-2]
$jpgnaam_backup=$jpgnaam
endif

InetGet($startcopy, $downloadpath & $timestamp & $jpgnaam & ".jpg", 0, 0)
$size=FileGetSize ( $downloadpath & $timestamp & $jpgnaam & ".jpg" )
if $size < 2000 then
FileDelete ($downloadpath & $timestamp & $jpgnaam & ".jpg")
$count=999
endif


$plus=$jpgnaam
$countstring= stringlen($jpgnaam)

$plus=Number($plus)
$plus=$plus+1
$plus=String($plus)

$countstring2= stringlen($plus)

$numberofzeros= $countstring - $countstring2

Do

if $numberofzeros > 0 then
$plus = "0" & $plus
endif

$numberofzeros=$numberofzeros-1
Until $numberofzeros <1

$startcopy = StringTrimRight($startcopy, $countstring + 4)
$startcopy = $startcopy & $plus & ".jpg"

$secondcount = StringLen($plus)

Until $count=999

$plus=$directory
$countstring= stringlen($directory)

$plus=Number($plus)
$plus=$plus+1
$plus=String($plus)

$countstring2= stringlen($plus)

$numberofzeros= $countstring - $countstring2

Do

if $numberofzeros > 0 then
$plus = "0" & $plus
endif

$numberofzeros=$numberofzeros-1
Until $numberofzeros <1

$startcopy = Stringtrimright ($startcopy, $countstring + $secondcount + 5)
$startcopy = $startcopy & $plus & "/" & $jpgnaam_backup & ".jpg"

$counter=0
$count=0

Until $counter=999

It goes on endless, so watch your download, if it drops to almost zero, quit the script :P

/edit Removed the example, not suitable for this forum :mad2:

Edited by WhiteCrow

Share this post


Link to post
Share on other sites



This is pretty cool, I made a script kind of like this that it would open a comic in the photo viewer and each time you execute it the next comic would be displayed. The only thing I would suggest that you should remove is the link to the porn because I believe that it isn't suitable for this forum.

...other than that this program is pretty good! ;)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I made a few changes, so that it will stop when all files are done, and it gives some traytip messages of howmany files are downloaded.

And thank you for liking this script ;)

#Include <Constants.au3>
#Include <string.au3>
#include <Array.au3>
#NoTrayIcon

TraySetIcon("Shell32.dll",41)
TraySetState()
TraySetToolTip("Mass JPeg Downloader")


$count=0
$counter=0
$count_files = 0
$count_check2 = 0

;=============these are the settings :)=================

$starturl="http://www.fakewebsite.com/content/0001/00.jpg"

$downloadpath= "c:\Temp\Data\"  

;=================-=-=-=-=-=-=-=-=-=-=-=================


$startcopy=$starturl

Do

Do
$counter=$counter+1


$starturl_regexp3= StringRegExp($startcopy, '(\d*)', 3)

$jpgnaam= $starturl_regexp3[UBound($starturl_regexp3)-1]
$directory=$starturl_regexp3[UBound($starturl_regexp3)-2]

if $counter=1 then
$jpgnaam_backup=$jpgnaam
endif



InetGet($startcopy, $downloadpath & $directory & $jpgnaam & ".jpg", 0, 0)
$size=FileGetSize ( $downloadpath & $directory & $jpgnaam & ".jpg" )
if $size < 2000 then
FileDelete ($downloadpath & $directory & $jpgnaam & ".jpg")
$count=999
endif


$plus=$jpgnaam
$countstring= stringlen($jpgnaam)

$plus=Number($plus)
$plus=$plus+1
$plus=String($plus)

$countstring2= stringlen($plus)

$numberofzeros= $countstring - $countstring2

$count_files = $count_files + 1
$count_check1 = $count_files


TrayTip("Mass JPeg Downloader", $count_files & " Files Downloaded" & @LF & "Directory = " & $Directory , 3, 0)

Do

if $numberofzeros > 0 then
$plus = "0" & $plus
endif

$numberofzeros=$numberofzeros-1
Until $numberofzeros <1

$startcopy = StringTrimRight($startcopy, $countstring + 4)
$startcopy = $startcopy & $plus & ".jpg"

$secondcount = StringLen($plus)

Until $count=999

$plus=$directory
$countstring= stringlen($directory)

$plus=Number($plus)
$plus=$plus+1
$plus=String($plus)

$countstring2= stringlen($plus)

$numberofzeros= $countstring - $countstring2

Do
if $numberofzeros > 0 then
$plus = "0" & $plus
endif
$numberofzeros=$numberofzeros-1
Until $numberofzeros <1


$startcopy = Stringtrimright ($startcopy, $countstring + $secondcount + 5)
$startcopy = $startcopy & $plus & "/" & $jpgnaam_backup & ".jpg"

$counter=0
$count=0

if $count_check1 = $count_check2 then
$counter=999
endif

$count_check2 = $count_files

$count_files = $count_files - 1

Until $counter=999

TrayTip("Mass JPeg Downloader", "all done!" , 3, 0)
Sleep(9000)
Edited by WhiteCrow

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
Sign in to follow this  
Followers 0