myspace music downloader

  • hier mal aus Spaß an der Freud ;)
    [Blockierte Grafik: http://leviathan-design.de/tools/soad.png]

    Spoiler anzeigen
    [autoit]


    #cs
    Myspace-Music-Downloader by Leviathan
    v0.1 please don't copy without my Name
    #ce
    #include <GuiListView.au3>
    #include <GUIConstants.au3>
    #include <String.au3>
    #Include <INet.au3>
    #NoTrayIcon

    [/autoit] [autoit][/autoit] [autoit]

    $Form1 = GUICreate("Myspace Music-Downloader v0.2", 222, 270, 193, 125)
    $input = GUICtrlCreateInput("", 8, 32, 209, 21)
    $Tracks = GUICtrlCreateListView("Tracks ", 8, 72, 209, 145)

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlSetLimit($Tracks, 210)
    $Label1 = GUICtrlCreateLabel("Myspace-Account-Link:", 8, 8, 116, 17)
    $Button1 = GUICtrlCreateButton("download", 8, 224, 121, 25, 0)
    GUICtrlSetState($Button1, $GUI_DISABLE)
    $Button2 = GUICtrlCreateButton("analyize", 136, 224, 81, 25, 0)
    $progressCurrent = GUICtrlCreateProgress(8, 255, 209, 10)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit
    If $msg = $Button2 Then _analyize()
    If $msg = $Button1 Then _download()
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _analyize()
    GUICtrlSetState($Button1, $GUI_DISABLE)
    _GUICtrlListViewDeleteAllItems($Tracks)
    $id = _getid(GUICtrlRead($input))
    If $id <> 0 Then
    _retrievedata($id)
    GUICtrlSetState($Button1, $GUI_ENABLE)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _download()
    $current = _GUICtrlListViewGetHotItem($Tracks)
    ;MsgBox(0,"", $current)
    $dlpath = @ScriptDir&"\Downloads"
    DirCreate($dlpath)
    For $i = 0 to Ubound($durl)-1
    $size = InetGetSize($durl[$i])
    InetGet($durl[$i], $dlpath&"\"&$name[0]&" - "&$title[$i]&".mp3", 0, 1)
    If @error Then
    MsgBox(0,"","error")
    Else
    While @InetGetActive
    GUICtrlSetData($progressCurrent,(@InetGetBytesRead/$size)*100)
    WEnd
    EndIf
    Next
    GUICtrlSetData($input, "Download Complete")
    GUICtrlSetData($progressCurrent, 0)
    GUICtrlSetState($Button1, $GUI_DISABLE)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _getid($url)
    If StringinStr($url, 'http://') Then $url = StringReplace($url, 'http://', '')
    $source = _INetGetSource($url)
    ;MsgBox(0,"", $source)
    If @error Then
    GUICtrlSetData($input, "Couldn't connect!")
    Else
    $search = _StringBetween($source, '"DisplayFriendId":', ',')
    If @error then
    GUICtrlSetData($input, "Couldn't find User-ID")
    Return 0
    Else
    Return $search[0]
    GUICtrlSetData($input, $search[0])
    Endif
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _retrievedata($id)
    Global $list[99]
    $res = ""
    $res2 = ""
    $url = "http://mediaservices.myspace.com/services/media/musicplayerxml.ashx?b="&$id
    $source = _INetGetSource($url)
    ;FileWrite(@Scriptdir&"\xml.xml", $source)
    Global $durl = _StringBetween($source, 'durl="', '"')
    Global $title = _StringBetween($source, 'title="', '"')
    Global $name = _StringBetween($source, '')
    If IsArray($durl) Then
    #cs For $i = 0 To Ubound($durl)-1
    $res &= $durl[$i]&@CRLF
    $res2 &= $title[$i]&@CRLF
    Next
    #ce MsgBox(0,"", $res2)
    For $i = 0 To Ubound($title)-1
    $list[$i] = GUICtrlCreateListViewItem($name[0]&" - "&$title[$i], $Tracks)
    Next
    EndIf
    EndFunc

    [/autoit]

    2 Mal editiert, zuletzt von leviathan (25. Januar 2008 um 20:50)

  • Hi

    Genau sowas hab ich shcon gesucht!
    Jetzt wollte ich das ausprobieren, hab das skript kopiert und in den editor für autoit eingefügt, doch wenn ich das skript starte werde ich von fehlermeldungen bombadiert:

    mit #include gibts nen problem....

    Mach ich das richtig?,
    kannst du vieleicht ne fertige exe oder dasfertige skript reinstellen?

    Wär supa!!!

    Tester

  • So geht es. Ich musste auch noch 1 oder 2 andere Sachen anpassen... Noch mit v3.2.8.1

    Spoiler anzeigen
    [autoit]

    #cs
    Myspace-Music-Downloader by Leviathan
    v0.1 please don't copy without my Name
    #ce
    #include <GuiListView.au3>
    #include <GUIConstants.au3>
    #include <String.au3>
    #Include <Inet.au3>
    #NoTrayIcon

    [/autoit] [autoit][/autoit] [autoit]

    $Form1 = GUICreate("Myspace Music-Downloader v0.2", 222, 270, 193, 125)
    $input = GUICtrlCreateInput("", 8, 32, 209, 21)
    $Tracks = GUICtrlCreateListView("Tracks ", 8, 72, 209, 145)
    _GUICtrlListViewSetColumnWidth($Tracks,0,$LVSCW_AUTOSIZE_USEHEADER)
    GUICtrlSetLimit($Tracks, 210)
    $Label1 = GUICtrlCreateLabel("Myspace-Account-Link:", 8, 8, 116, 17)
    $Button1 = GUICtrlCreateButton("download", 8, 224, 121, 25, 0)
    GUICtrlSetState($Button1, $GUI_DISABLE)
    $Button2 = GUICtrlCreateButton("analyize", 136, 224, 81, 25, 0)
    $progressCurrent = GUICtrlCreateProgress(8, 255, 209, 10)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit
    If $msg = $Button2 Then _analyize()
    If $msg = $Button1 Then _download()
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _analyize()
    GUICtrlSetState($Button1, $GUI_DISABLE)
    _GUICtrlListViewDeleteAllItems($Tracks)
    $id = _getid(GUICtrlRead($input))
    If $id <> 0 Then
    _retrievedata($id)
    GUICtrlSetState($Button1, $GUI_ENABLE)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _download()
    $current = _GUICtrlListViewGetHotItem($Tracks)
    ;MsgBox(0,"", $current)
    $dlpath = @ScriptDir&"\Downloads"
    DirCreate($dlpath)
    For $i = 0 to Ubound($durl)-1
    $size = InetGetSize($durl[$i])
    InetGet($durl[$i], $dlpath&"\"&$name[0]&" - "&$title[$i]&".mp3", 0, 1)
    If @error Then
    MsgBox(0,"","error")
    Else
    While @InetGetActive
    GUICtrlSetData($progressCurrent,(@InetGetBytesRead/$size)*100)
    WEnd
    EndIf
    Next
    GUICtrlSetData($input, "Download Complete")
    GUICtrlSetData($progressCurrent, 0)
    GUICtrlSetState($Button1, $GUI_DISABLE)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _getid($url)
    If StringinStr($url, 'http://') Then $url = StringReplace($url, 'http://', '')
    $source = _INetGetSource($url)
    ;MsgBox(0,"", $source)
    If @error Then
    GUICtrlSetData($input, "Couldn't connect!")
    Else
    $search = _StringBetween($source, '"DisplayFriendId":', ',')
    If @error then
    GUICtrlSetData($input, "Couldn't find User-ID")
    Return 0
    Else
    Return $search[0]
    GUICtrlSetData($input, $search[0])
    Endif
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _retrievedata($id)
    Global $list[99]
    $res = ""
    $res2 = ""
    $url = "http://mediaservices.myspace.com/services/media/musicplayerxml.ashx?b="&$id
    $source = _INetGetSource($url)
    ;FileWrite(@Scriptdir&"\xml.xml", $source)
    Global $durl = _StringBetween($source, 'durl="', '"')
    Global $title = _StringBetween($source, 'title="', '"')

    [/autoit] [autoit][/autoit] [autoit]

    Global $name = _StringBetween($source,"<name>", '</name>')
    If IsArray($durl) Then
    #cs For $i = 0 To Ubound($durl)-1
    $res &= $durl[$i]&@CRLF
    $res2 &= $title[$i]&@CRLF
    Next
    #ce MsgBox(0,"", $res2)
    For $i = 0 To Ubound($title)-1
    $list[$i] = GUICtrlCreateListViewItem(StringTrimRight(StringTrimLeft($name[0],9),3)&" - "&_HTML_ASCII_ToStr($title[$i]), $Tracks)
    Next
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _HTML_ASCII_ToStr($string)
    Local $temp = StringRegExp($string,"&#(\d\d?\d?);",1)
    For $i = 0 To UBound($temp)-1
    $string = StringReplace($string,"&#"&$temp[$i]&";",Chr($temp[$i]))
    Next
    Return $string
    EndFunc

    [/autoit]
  • ja hab mir endlich ma die neue zugelegt - und welche Fehlermeldungen bekommst du ich hab ma oben die includes richtig reingemacht?

  • hi Leviatan,

    Danke für die korrektur, jetzt kommt die Benutzeroberfläche mit dem eingabefeld.
    Doch mit den paar adressen, mitdenen ich es probiert habe, kommt immer die Fehlermedlung:
    line 43:_GuictrLLISTVIEWDELETEALLITEMS($Tracks)
    ERROR

    error:unknown funktion name


    oder soähnlich.
    Ich habe zb: auch die soad adresse probiert, die im Screenshot drin steht.

    Kannste da noch was machen?

    Grus tester

  • AUf welche version den?
    ich habe autoit erst diese woche entdeckt, hab also die neuste nicht beta version AutoIt v3.2.10.0 25th November, 2007 History

    Soll ich sone beta probieren?
    die 3.2.11?


    ich glaub das mach ich mal...

    Edit: geht auch nciht, habe die Beta zusätzlich installiert, und öffne das skript über start-programme-autoit3-beta-runscript-beta


    und nochmal zur Fehlermeldung:
    Die ist in deinem hier gepostetem script in Linie 32, ich hatte noch den Standart Text von Autoit vornedran.

    2 Mal editiert, zuletzt von tester (26. Januar 2008 um 13:49)

  • sicher, dass du auch die includes alle drinne hast? also die guilistview siehe oben im Skript

  • Also, das Script ist noch für v3.2.8.1 mit Auto3Lib
    In 3.2.10.0 heißen die Funktionen anders.

  • Hi progandy, mit der alten version geht das Script ohne fhelermeldung, es wird auch ein download-ordner auf dem desktop erstellt, doch nach 5 sec meldet das script: download beendet , is aber nix im ordner....

    Schade, werd noch ein bißchen rumprobieren.

  • In meiner Version die Func _download ersetzen:

    Spoiler anzeigen
    [autoit]

    Func _download()
    ;$current = _GUICtrlListViewGetSelectedIndices($Tracks,1)
    ;MsgBox(0,"", $current[0])
    _ArrayDisplay($title)
    $dlpath = @ScriptDir&"\Downloads"
    DirCreate($dlpath)
    For $i = 0 to Ubound($durl)-1
    $size = InetGetSize($durl[$i])
    InetGet($durl[$i], $dlpath&"\"&$name[0]&" - "&_HTML_ASCII_ToStr($title[$i])&".mp3", 0, 1)
    If @error Then
    MsgBox(0,"","error")
    Else
    While @InetGetActive
    GUICtrlSetData($progressCurrent,(@InetGetBytesRead/$size)*100)
    WEnd
    EndIf
    Next
    GUICtrlSetData($input, "Download Complete")
    GUICtrlSetData($progressCurrent, 0)
    GUICtrlSetState($Button1, $GUI_DISABLE)
    EndFunc

    [/autoit]

    2. Möglichkeit. Nur ausgewählte Lieder downloaden !

    Spoiler anzeigen
    [autoit]

    Func _download()
    $current = _GUICtrlListViewGetSelectedIndices($Tracks,1)
    ;MsgBox(0,"", $current[0])

    [/autoit] [autoit][/autoit] [autoit]

    $dlpath = @ScriptDir&"\Downloads"
    DirCreate($dlpath)
    If Not IsArray($current) Then Return MsgBox(16,"Fehler","Bitte Lieder zum Downloaden auswählen!")
    GUICtrlSetState($Button1, $GUI_DISABLE)
    For $i = 1 to $current[0]
    $size = InetGetSize($durl[$current[$i]])
    InetGet($durl[$current[$i]], $dlpath&"\"&$name[0]&" - "&_HTML_ASCII_ToStr($title[$current[$i]])&".mp3", 0, 1)
    If @error Then
    MsgBox(0,"","error")
    Else
    While @InetGetActive
    GUICtrlSetData($progressCurrent,(@InetGetBytesRead/$size)*100)
    WEnd
    EndIf
    Next
    GUICtrlSetData($input, "Download Complete")
    GUICtrlSetData($progressCurrent, 0)
    GUICtrlSetState($Button1, $GUI_ENABLE)
    EndFunc

    [/autoit]

    Einmal editiert, zuletzt von progandy (26. Januar 2008 um 16:25)