Jump to content



Photo

iPod Music Transfer [GetPod] (With Search)


  • Please log in to reply
5 replies to this topic

#1 torels

torels

    I Hacked 127.0.0.1! :D

  • Active Members
  • PipPipPipPipPipPip
  • 676 posts

Posted 06 September 2008 - 09:50 AM

Hi There
I Just wrote a program which extracs tracks from your iPod.
It can extract all the tracks or just some using a search function i wrote ;)
Hope you enjoy it!

Here is the code...
AutoIt         
;extract iPod - torels #include <Array.au3> Dim $files[1] Opt("TrayMenuMode", 1) Global $drivep _init() Func _init()     $drivep = InputBox("Drive", "Please Insert the Drive Path For Your iPod", "H:\", Default, Default, 100) EndFunc   ;==>_init If @error = 1 Then Exit If StringLen($drivep) = 3 And _IsiPod($drivep) Then     _Store($drivep)     TrayTip("Elaboration Done", "Right-Click the icon for the menu", 20, 16)     $all = TrayCreateItem("Extract All")     $spec = TrayCreateItem("Extract Specific (by search)")     TrayCreateItem("")     $exit = TrayCreateItem("Exit")     While 1         Switch TrayGetMsg()             Case $all                 _ExtractAll()             Case $spec                 _ExtractSpecific()             Case $exit                 _Exit()         EndSwitch     WEnd Else     MsgBox(0, "", $drivep & " Is not a Valid Drive")     _init() EndIf Func _Store($drive)     $dir = FileFindFirstFile($drive & "iPod_Control\Music\*.*")     While 1         $sch = FileFindNextFile($dir)         If @error Then ExitLoop         $fsc = FileFindFirstFile($drive & "iPod_Control\Music\" & $sch & "\*.*")         If $fsc = -1 Then TrayTip("Elaborating", $drive & "iPod_Control\Music\" & $sch & "\Elaborating...", 20, 16)         TrayTip("Elaborating", $drive & "iPod_Control\Music\" & $sch & "\*.*", 20, 16)         While 1             $file = FileFindNextFile($fsc)             If @error Then                 TrayTip("Elaborating", $drive & "iPod_Control\Music\" & $sch & "\Elaborating...", 20, 16)                 ExitLoop             EndIf             _ArrayAdd($files, $drive & "iPod_Control\Music\" & $sch & "\" & $file)         WEnd         TrayTip("Elaborating", $drive & "iPod_Control\Music\" & $sch & "\Elaborating...", 10, 16)         If @error Then ExitLoop     WEnd EndFunc   ;==>_Store Func _ExtractAll()     For $i = 1 To UBound($files) - 1         TrayTip("Working...", "Copying: " & $files[$i], 20, 16)         $info = Songinfo($files[$i])         FileCopy($files[$i], "C:\GetPod\Music\" & $info[2] & "\" & $info[1] & "\" & $info[3] & " - " & $info[1] & ".mp3", 8)     Next EndFunc   ;==>_ExtractAll Func _ExtractSpecific()     $v = 0     $criteria = InputBox("Search", "Please Insert a Search Criteria." & @LF & "Order: Artist Title Album" & @LF & "eg. Metallica One" & @LF & "eg2. Duality" & @LF & _             "If you enter two or more parameters they MUST follow the order or no file will be found")     For $i = 1 To UBound($files) - 1         $info = Songinfo($files[$i])         TrayTip("Working...", "Analyzing: " & $files[$i], 20, 16)         $line = $info[2] & " " & $info[3] & " " & $info[1]         If StringInStr($line, $criteria) Then             TrayTip("Copying...", "Copying: " & $files[$i], 20, 16)             FileCopy($files[$i], "C:\GetPod\Music\" & $info[2] & "\" & $info[3] & "\" & $info[2] & " - " & $info[1] & ".mp3", 8)             $v += 1         EndIf     Next     If $v = 0 Then         TrayTip("GetPod", "No Tracks Found!", 20, 16)     Else         TrayTip("GetPod", $v & " Tracks Found!", 20, 16)     EndIf EndFunc   ;==>_ExtractSpecific Func _IsiPod($drive)     If DriveGetType($drive) = "removable" And FileExists($drive & "iPod_Control\iTunes\") Then         Return 1     Else         Return 0     EndIf EndFunc   ;==>_IsiPod Func Songinfo($file) ;Finds Title|Author|Album for any media file     Dim $return[5]     $return[1] = _GetExtProperty($file, 10);name     $return[2] = _GetExtProperty($file, 16);atrist     $return[3] = _GetExtProperty($file, 17);album         If $return[1] = "" Or $return[1] = "Unknown" Then $return[1] = "No_name_" & Floor(Random(0, 100))     If $return[2] = "" Or $return[2] = "Unknown" Then $return[2] = "Unknown_Artist"     If $return[3] = "" Or $return[3] = "Unknown" Then $return[3] = "Unknown_Album"         Return $return EndFunc   ;==>Songinfo Func _GetExtProperty($sPath, $iProp)     Local $iExist, $sFile, $sDir, $oShellApp, $oDir, $oFile, $aProperty, $sProperty     $iExist = FileExists($sPath)     If $iExist = 0 Then         SetError(1)         Return 0     Else         $sFile = StringTrimLeft($sPath, StringInStr($sPath, "\", 0, -1))         $sDir = StringTrimRight($sPath, (StringLen($sPath) - StringInStr($sPath, "\", 0, -1)))         $oShellApp = ObjCreate("shell.application")         $oDir = $oShellApp.NameSpace($sDir)         $oFile = $oDir.Parsename($sFile)         If $iProp = -1 Then             Local $aProperty[35]             For $i = 0 To 34                 $aProperty[$i] = $oDir.GetDetailsOf($oFile, $i)             Next             Return $aProperty         Else             $sProperty = $oDir.GetDetailsOf($oFile, $iProp)             If $sProperty = "" Then                 Return "Unknown"             Else                 Return $sProperty             EndIf         EndIf     EndIf EndFunc   ;==>_GetExtProperty Func _Exit()     Exit EndFunc   ;==>_Exit


Comments are wlcome! :D

Attached Files


Edited by torels, 06 September 2008 - 09:56 AM.

Some Projects:indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org







#2 torels

torels

    I Hacked 127.0.0.1! :D

  • Active Members
  • PipPipPipPipPipPip
  • 676 posts

Posted 06 September 2008 - 10:14 AM

BUMP!
Some Projects:indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

#3 ludocus

ludocus

    Possibly inventive crap going on right here

  • Active Members
  • PipPipPipPipPipPip
  • 664 posts

Posted 07 September 2008 - 03:24 PM

very nice!!
maybe you could make a gui, showing all songs in a listview?

#4 torels

torels

    I Hacked 127.0.0.1! :D

  • Active Members
  • PipPipPipPipPipPip
  • 676 posts

Posted 10 September 2008 - 01:47 PM

I thought of it... but I delayed the idea because many iPods have tons of music in them so I don't know how confortable it is to have them all in a listbox :)
Anyway... thanks for the idea... I could think of an option in the menu that creates the gui (so to have the gui if you want it but not by default)
Some Projects:indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

#5 youknowwho4eva

youknowwho4eva

    Giggity Giggity Goo

  • Active Members
  • PipPipPipPipPipPip
  • 710 posts

Posted 10 September 2008 - 03:53 PM

I haven't looked at your program, but what if you made it in treeview so that you could click on an artist and just expand that individual artists songs. Or maybe an export to WhiteDragon feature :) >_<
Giggity

#6 torels

torels

    I Hacked 127.0.0.1! :D

  • Active Members
  • PipPipPipPipPipPip
  • 676 posts

Posted 11 September 2008 - 08:23 AM

in case you had many songs on your iPod it would take years!
It has to retrieve all the songs, then retrieve all the data (using a shell.application) then put it in a tree view
Just to give you an idea... it does this as a rythm of half / 1/3 of a folder per second... it takes ages
As I said Above... I could add an option to do this... but not set it as default...

Edited by torels, 11 September 2008 - 08:43 AM.

Some Projects:indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users