Sign in to follow this  
Followers 0
Rogue5099

Inetget($varable .mp3)????

5 posts in this topic

Without going to the source of a website and finding links to each file hosted on site, is there a read the location of a file and downloading all of the contains of an index with file type .whatever.

Example:

http://causeequalstime.com/musique/

INetGet("http://causeequalstime.com/musique/" & $SongName & ".mp3")

How would I get the variable?

Share this post


Link to post
Share on other sites



Without going to the source of a website and finding links to each file hosted on site, is there a read the location of a file and downloading all of the contains of an index with file type .whatever.

Example:

http://causeequalstime.com/musique/

INetGet("http://causeequalstime.com/musique/" & $SongName & ".mp3")

How would I get the variable?

i guess you need to use _IELinkGetCollection () Function!

Share this post


Link to post
Share on other sites

I can't imagine it could be done any easier than this.

#AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6

Global $sURL = "http://causeequalstime.com/musique/"
Global $sSource = BinaryToString(InetRead($sURL))
Global $aLinks = StringRegExp($sSource, '(?s)(?i)<a href="(.*?)">', 3)

For $i = 0 To UBound($aLinks) - 1
    If StringRight($aLinks[$i], 4) = ".mp3" Then InetGet($sURL & $aLinks[$i], @ScriptDir & "\" & StringReplace($aLinks[$i], "%20", " "))
Next

Awesome!!!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

_IELinkGetCollection works well ! :x

#include <IE.au3>

DirCreate ( @ScriptDir & "\Downloads" )
$oIE = _IECreate ( "http://causeequalstime.com/musique", 0, 0 )
$oLinks = _IELinkGetCollection ( $oIE )
For $oLink In $oLinks
    $_Link = $oLink.href
    If StringRight ( $_Link, 4 ) = ".mp3" Then 
        ConsoleWrite ( 'link : ' & $_Link & @CRLF )
        InetGet ( $_Link, @ScriptDir & "\Downloads\" & StringReplace ( _GetFullNameByUrl ( $_Link ), '%20', ' ' ) )
    EndIf
Next
 
_IEQuit ( $oIE ) 

Func _GetFullNameByUrl ( $_FileUrl )
    $_FileName = StringSplit ( $_FileUrl, '/' )
    If Not @error Then 
        Return $_FileName[$_FileName[0]]
    Else
        Return 0
    EndIf
EndFunc ;==> _GetFullNameByUrl ( )
Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

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