Hallo!
Es soll während der Zeit des Downloads ein Tooltip den Cursor verfolgen, der nach dem Download natürlich wieder verschwinden soll.
Meine Versuche wurden nur bei den Funktionen von dem Mtvdownload angewandt.
#include <GUIConstants.au3>
#include<Guilistview.au3>
#include<array.au3>
#include<Inet.au3>
#include<string.au3>
#include<guibutton.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>
$inireader= iniread(@Scriptdir & "\data.ini", "default", "Ausgabeort", @DocumentsCommonDir)
[/autoit][autoit][/autoit][autoit]$Multidownloader_1 = GUICreate("Multidownloader", 670, 530, 208, 107)
$ListView1 = GUICtrlCreateListView("Link|Portal|Ausgabeort|Ausgabename|Format", 5, 50, 655, 313)
GUICtrlSendMsg(-1, 0x101E, 0, 250)
GUICtrlSendMsg(-1, 0x101E, 1, 50)
GUICtrlSendMsg(-1, 0x101E, 2, 150)
GUICtrlSendMsg(-1, 0x101E, 3, 150)
GUICtrlSendMsg(-1, 0x101E, 4, 50)
$Download = GUICtrlCreateGroup("Download hinzufügen", 5, 369, 652, 122)
$LINK = GUICtrlCreateInput("MTV.video / Youtube-Link hier eingeben", 18, 392, 421, 21)
$Input1 = GUICtrlCreateInput("Ausgabetitel hier eingeben", 449, 392, 200, 21)
$Ausgabeort = GUICtrlCreateButton("Ausgabeort ändern", 339, 420, 98, 29, $WS_GROUP)
$Button1 = GUICtrlCreateButton("Download hinzufügen", 8, 458, 641, 28, $WS_GROUP)
$Radio1 = GUICtrlCreateRadio("Mp3", 466, 428, 75, 20)
GUICtrlSetState(-1, $GUI_CHECKED)
$Radio2 = GUICtrlCreateRadio("Mp4", 550, 428, 86, 20)
$Ausgabe = GUICtrlCreateInput("", 18, 424, 313, 21)
If $inireader= "" then
guictrlsetdata($ausgabe, @DocumentsCommonDir)
Else
guictrlsetdata($ausgabe, $inireader)
endif
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button2 = GUICtrlCreateButton("Liste downloaden", 10, 496, 638, 25, $WS_GROUP)
$Pic1 = GUICtrlCreatePic(@Scriptdir & "\multidownloader.jpg", 0, 0, 669, 100)
$Label2 = GUICtrlCreateLabel("Multidownloader by PM", 3, 3, 326, 36)
GUICtrlSetFont(-1, 20, 400, 0, "Lucida Fax")
GUICtrlSetBkColor(-1, 0xFFFFFF)
guisetstate(@SW_SHOW)
guictrlsetstate($button2, $gui_disable)
global $portal= ""
global $sformat= true
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $link
$linkread= guictrlread($link)
If $linkread= "" Then
Msgbox(16, "Fehler", "Bitte gib einen Link ein")
endif
If StringRegExp($linkread, "^(?:http:\/\/)*www\.mtv\.de\/videos") Then
$bla=True
$portal= "mtv"
EndIf
If Stringregexp($linkread, "(?i)(?:http\:\/\/)?www\.youtube\.\w+\/watch\?v=[\d\w-_]+(?:\s*$|&feature=\w+\s*$)") then
$portal= "youtube"
EndIf
Case $ausgabeort
$OUtPUTFILE=Fileselectfolder("Ausgabeort", "Eigene Dateien", 1, "" )
If $outputfile= "" then
msgbox(16, "Fehler", "Bitte gib einen Speicherort an")
else
iniwrite(@Scriptdir & "\data.ini", "default", "Ausgabeort", $outputfile)
$inireadb= iniread(@Scriptdir & "\data.ini", "default", "Ausgabeort", @DocumentsCommonDir)
guictrlsetdata($ausgabe, $inireadb)
endif
If $outputfile= "arbeitsplatz" Then
Msgbox(16, "Fehler", "Du kannst keine Datei auf dem Arbeitsplatz speichern")
guictrlsetdata($ausgabe, @DocumentsCommonDir)
else
guictrlsetstate($button1, $gui_enable)
endif
case $button1
$ausgaberead= guictrlread($input1)
If guictrlread($radio1)= $GUI_checked then
$formatauswahl= "MP3"
else
$formatauswahl= "MP4"
endif
If $portal="" then
Msgbox(0, "Fehler", "Gib einen gültigen Link/ein gültiges Format an!")
else
guictrlcreatelistviewitem($linkread & "|" &$portal & "|" & guictrlread($ausgabe) & "|" & $ausgaberead & "|" & $formatauswahl, $listview1)
guictrlsetstate($button2, $gui_enable)
GUICtrlSetData($link, "MTV.video / Youtube-Link hier eingeben")
Guictrlsetdata($input1, "Ausgabetitel hier eingeben")
guictrlsetstate($button1, $gui_disable)
endif
case $button2
linkchecker()
EndSwitch
WEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Funktionen;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func mtvdownload()
guisetstate(@SW_hide)
global $bla=0
do
Tooltip("bla")
mtvdownloadb()
If $bla=1 then
Tooltip("")
Msgbox(0, "Tadaaaaa", "Der Download war erfolgreich")
guisetstate(@SW_Show, $multidownloader_1)
guictrlsetstate($button2, $gui_disable)
guictrlsetstate($button1, $gui_disable)
EndIf
until $bla=1
EndFunc
[/autoit][autoit][/autoit][autoit]func mtvdownloadb()
$url1 = "http://de.esperanto.mtvi.com/www/xml/flv/flvgen.jhtml?vid="
$url2 = "&hiLoPref=hi"
$aItem = _GUICtrlListView_GetItemTextArray($ListView1, 0)
$Quelltext = _INetGetSource($aItem[1])
$sStart = 'var so = new SWFObject("http://media.mtvnservices.com/mgid:uma:video:mtv.de:'
$sEnde = '",'
$string = _StringBetween($Quelltext, $sStart, $sEnde)
If IsArray($string) Then
$adresse = $url1 & $string[0] & $url2
$Quelltext2 = _INetGetSource($adresse)
$string2 = _StringBetween($Quelltext2, '<src>', '</src>')
$ausgabetitel = $aItem[4]
$mp3zieladresse = $aItem[3]
$tempadresse = @ScriptDir & "\video.flv"
$zieladresse = $mp3zieladresse & "\" & $ausgabetitel & ".mp3"
$mp4zieladresse= $mp3zieladresse & "\" & $ausgabetitel & ".mp4"
InetGet($string2[0], $tempadresse, "", 0)
$ffmpeg = @ScriptDir&"\ffmpeg.exe"
$sformat= $aitem[5]
If $sformat= "MP3" then
RunWait('ffmpeg.exe -i "' & $tempadresse & '"' & ' -ab 320k "' & $zieladresse & '"', "", @SW_HIDE)
else
runwait('ffmpeg.exe -i "' & $tempadresse & '"' & ' -ab 320k "' & $mp4zieladresse & '"', "", @SW_hide)
endif
GUICtrlSetState($Button2, $gui_disable)
guictrlsetstate($button1, $gui_disable)
EndIf
_GUICtrlListView_DeleteItem($ListView1, 0)
If _Guictrllistview_getitemcount($listview1)=0 then
$bla=1
else
Filedelete($tempadresse)
linkchecker()
endif
endfunc
func linkchecker()
$bItem= _GUICtrlListView_GetItemTextArray($ListView1, 0)
If $bitem[2]= "mtv" then
guisetstate(@SW_disABLE, $Multidownloader_1)
mtvdownload()
EndIf
If $bItem[2]= "youtube" Then
guisetstate(@SW_disABLE, $Multidownloader_1)
youtubedownload()
endif
endfunc
func youtubedownload()
$aItem = _GUICtrlListView_GetItemTextArray($ListView1, 0)
$ssource= _Inetgetsource($aItem[1])
Local $a_token = _StringBetween($sSource, '&t=', '&r')
Local $s_vID = StringTrimLeft($aitem[1], StringInStr($aitem[1], '='))
If IsArray($a_token) Then $a_token = $a_token[0]
$sDownloadLink = "http://www.youtube.com/get_video?video_id=" & $s_vID & "&t=" & $a_token & "&asv=&fmt=18"
$mp3zieladresse = $aItem[3]
$ausgabetitel = $aItem[4]
$yzieladresse=$aitem[3]&"\"&$aitem[4]&".mp3"
$ymp4zieladresse=$aitem[3]&"\"&$aitem[4]&".mp4"
$tempadresse =@ScriptDir&"\video.flv"
Inetget($sdownloadlink , $tempadresse, "", 0)
$ffmpeg = @ScriptDir & "\ffmpeg.exe"
$sformat= $aitem[5]
If $sformat= "MP3" then
RunWait('ffmpeg.exe -i "' & $tempadresse & '"' & ' -ab 320k "' & $yzieladresse & '"', "", @SW_HIDE)
else
runwait('ffmpeg.exe -i "' & $tempadresse & '"' & ' -ab 320k "' & $ymp4zieladresse & '"', "", @SW_hide)
endif
_GUICtrlListView_DeleteItem($ListView1, 0)
If _GUICtrlListView_GetItemCount($ListView1) = 0 Then
msgbox(0, "Tadaaa", "Der Download war erfolgreich")
guisetstate(@SW_Enable, $multidownloader_1)
guictrlsetstate($button2, $gui_disable)
guictrlsetstate($button1, $gui_disable)
Else
Filedelete($tempadresse)
linkchecker()
endif
endfunc
Das Problemo ist also in den Zeilen 108-113.
Also wie muss man die Do-until-schleife ändern, dass die funktion mtvdownloadb ausgeführt wird und ein tooltip den cursor während des downloads verfolgt?