ist aber noch net fertig.. und die includes sind vllt manchmal unsinnig :D
PHP Code:
#Include <Date.au3>
#Include <Misc.au3>
#include <IE.au3>
#Include <String.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#Include <GuiListView.au3>
#include <INet.au3>
#EndRegion ### END Koda GUI section ###
$Form1 = GUICreate("Wiederholer", 626, 474, 189, 121)
GUISetFont(8, 400, 0, "Comic Sans MS")
GUISetBkColor(0x0000FF)
$List1 = GUICtrlCreateListView("Gespeicherte",16, 56, 593, 231,-1,$LVS_EX_CHECKBOXES)
GUICtrlSetColor(-1, 0x000000)
$Iwh = GUICtrlCreateInput("", 232, 304, 169, 23)
GUICtrlSetColor(-1, 0x000000)
$Label1 = GUICtrlCreateLabel("Wiederholungen:", 24, 296, 208, 36)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$Iseite = GUICtrlCreateInput("", 208, 408, 401, 23)
GUICtrlSetColor(-1, 0x000000)
$Label2 = GUICtrlCreateLabel("Webseite zum Speichern:", 16, 408, 185, 24)
GUICtrlSetFont(-1, 13, 400, 0, "MS Sans Serif")
$Bsave = GUICtrlCreateButton("Speichern", 24, 336, 113, 49, $WS_GROUP)
GUICtrlSetColor(-1, 0x000000)
$Bplay = GUICtrlCreateButton("Play", 464, 336, 121, 49, $WS_GROUP)
GUICtrlSetColor(-1, 0x000000)
$Label3 = GUICtrlCreateLabel("Wiederholer", 224, 8, 152, 36)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$Label4 = GUICtrlCreateLabel("Videozeit:", 416, 16, 56, 19)
GUICtrlSetColor(-1, 0x000000)
$lzeit = GUICtrlCreateLabel("blabla", 468, 16, 34, 19)
GUICtrlSetColor(-1, 0x000000)
$Checkbox1 = GUICtrlCreateCheckbox("Webseite manuell einfügen", 456, 440, 169, 17)
GUICtrlSetColor(-1, 0x000000)
$Label5 = GUICtrlCreateLabel("Liedname:", 16, 440, 78, 24)
GUICtrlSetFont(-1, 13, 400, 0, "MS Sans Serif")
$Iname = GUICtrlCreateInput("", 104, 440, 345, 23)
GUICtrlSetColor(-1, 0x000000)
$Checkbox2 = GUICtrlCreateCheckbox("Internet öffnen", 456, 456, 145, 17)
GUICtrlSetColor(-1, 0x000000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
;$blub=
$bla=IniRead("Seiten","Anzahl","zahlnamen","0")
$i2=0
$i=0
$dll = DllOpen("user32.dll")
$anzahl=0
if FileExists("Seiten.ini") Then
$savedsites=IniRead("Seiten","Anzahl","zahlseiten","0")
$bla=IniRead("Seiten","Anzahl","zahlnamen","0")
Else
$savedsites=1
$bla=0
EndIf
if FileExists("Seiten.ini") Then
$savednames=IniRead("Seiten","Anzahl","zahlnamen","0")
Else
$savednames=1
EndIf
if FileExists("Seiten.ini") Then
For $i2=IniRead("Seiten","Anzahl","zahlseiten","0")-1 to 0 Step -1
$bla=$bla-1
GUICtrlCreateListViewItem(IniRead("Seiten","YouTube-Seiten",$bla,"0")&IniRead("Seiten","YouTube-Namen",$bla,"0"),$List1)
Next
EndIf
While(1)
settime()
setedit()
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Bsave
save()
Case $Bplay
play()
EndSwitch
$wiederholungen=GUICtrlRead($Iwh)
WEnd
Func setedit()
If GUICtrlRead($Checkbox1)=$GUI_CHECKED Then
Else
$oForm=_IEAttach("YouTube")
$sHTML = _IEDocReadHTML ($oForm)
GUICtrlSetData($Iseite,_IEPropertyGet ( $oForm,"locationurl" ))
GUICtrlSetData($Iname,_IEPropertyGet ( $oForm,"title" ))
EndIf
EndFunc
Func start()
If $wiederholungen="unendlich" Then
startun()
Else
WinActivate("YouTube")
WinWaitActive("YouTube")
Do
Sleep(100)
Until _IsPressed(01,$dll)
Do
$oForm=_IEAttach("YouTube")
$sHTML = _IEDocReadHTML ($oForm)
$videotime = _stringbetween($sHTML,'"length_seconds":',',')
$videotime1=$videotime[0]
ToolTip("Dauer in Sekunden:"&$videotime1,0,0)
Sleep($videotime1*1000+3000)
ControlClick("YouTube","","MacromediaFlashPlayerActiveX1","left",1, 88, 59)
$i=$i+1
Until $i=$wiederholungen
EndIf
EndFunc
Func startun()
WinActivate("YouTube")
WinWaitActive("YouTube")
Do
Sleep(100)
Until _IsPressed(01,$dll)
While(1)
$oForm=_IEAttach("YouTube")
$sHTML = _IEDocReadHTML ($oForm)
$videotime = _stringbetween($sHTML,'"length_seconds":',',')
$videotime1=$videotime[0]
ToolTip("Dauer in Sekunden:"&$videotime1,0,0)
Sleep($videotime1*1000+3000)
ControlClick("YouTube","","MacromediaFlashPlayerActiveX1","left",1, 88, 59)
WEnd
EndFunc
Func settime()
If WinExists("YouTube") Then
Global $iHours, $iMins, $iSecs
$oForm=_IEAttach("YouTube")
_IELoadWait($oForm)
$sHTML = _IEDocReadHTML ($oForm)
$videotime = _stringbetween($sHTML,'"length_seconds":',',')
GUICtrlSetData($lzeit,$videotime[0])
;GUICtrlSetData($lzeit,$videotime[0],0)
EndIf
EndFunc
Func play()
start()
EndFunc
Func save()
$seitenname=GUICtrlRead($Iseite)
$liedname=GUICtrlRead($Iname)
IniWrite("Seiten","YouTube-Seiten",$savedsites,$seitenname)
IniWrite("Seiten","Youtube-Namen",$savednames,$liedname)
sleep(500)
GUICtrlCreateListViewItem(IniRead("Seiten","YouTube-Seiten",$savedsites,"0")&IniRead("Seiten","YouTube-Namen",$savednames,"0"),$List1)
$savednames=$savednames+1
$savedsites=$savedsites+1
IniWrite("Seiten","Anzahl","zahlseiten",$savedsites)
IniWrite("Seiten","Anzahl","zahlnamen",$savednames)
EndFunc