Rogue5099 Posted December 18, 2010 Share Posted December 18, 2010 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? My projects: Inventory / Mp3 Inventory, Computer Stats Link to comment Share on other sites More sharing options...
DCCD Posted December 18, 2010 Share Posted December 18, 2010 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! [u][font=Arial Black]M[/font]y Blog, AVSS Parts[/u][font=Arial Black]Else[/font][font=Arial Black]L[/font]ibya Linux Users Group Link to comment Share on other sites More sharing options...
Rogue5099 Posted December 18, 2010 Author Share Posted December 18, 2010 #include <IE.au3> $oIE = _IECreate ("http://causeequalstime.com/musique") $oLinks = _IELinkGetCollection ($oIE) For $oLink In $oLinks InetGet("http://causeequalstime.com/musique/" & $oLink, @ScriptDir & "\Downloads\") Next This isn't working any suggestions? My projects: Inventory / Mp3 Inventory, Computer Stats Link to comment Share on other sites More sharing options...
Rogue5099 Posted December 18, 2010 Author Share Posted December 18, 2010 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!!! My projects: Inventory / Mp3 Inventory, Computer Stats Link to comment Share on other sites More sharing options...
wakillon Posted December 18, 2010 Share Posted December 18, 2010 (edited) _IELinkGetCollection works well ! #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 December 18, 2010 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now