Programma creato per scaricare i video da youtube in formato mp3.
Di Hpmezzo dell'autoit fanclub forum.


Codice:
$Versione="0x312C300A"
;http://analyzelab.altervista.org/AYMP3C/Download/Versione.html
#include <guiconstantsex.au3>
#include <windowsconstants.au3>
#include <ie.au3>
;#NoTrayIcon
$LANG=IniRead ([MENTION=317446765]Script[/MENTION]Dir&"\Impost.ini" , "LANG" , "LANG" , "ENG")
$BUTTON1=IniRead ([MENTION=317446765]Script[/MENTION]Dir&"\Impost.ini" , $LANG , "BUTTON1" , "Back")
$BUTTON2=IniRead ([MENTION=317446765]Script[/MENTION]Dir&"\Impost.ini" , $LANG , "BUTTON2" , "Forward")
$BUTTON3=IniRead ([MENTION=317446765]Script[/MENTION]Dir&"\Impost.ini" , $LANG , "BUTTON3" , "Info")
$BUTTON4=IniRead ([MENTION=317446765]Script[/MENTION]Dir&"\Impost.ini" , $LANG , "BUTTON4" , "Stop")
$BUTTON5=IniRead ([MENTION=317446765]Script[/MENTION]Dir&"\Impost.ini" , $LANG , "BUTTON5" , "Download Mp3")
$BUTTON6=IniRead ([MENTION=317446765]Script[/MENTION]Dir&"\Impost.ini" , $LANG , "BUTTON6" , "Update")
$BUTTON7=IniRead ([MENTION=317446765]Script[/MENTION]Dir&"\Impost.ini" , $LANG , "BUTTON7" , "Search")
$EXITBUTTON=IniRead ([MENTION=317446765]Script[/MENTION]Dir&"\Impost.ini" , $LANG , "EXIT" , "Exit")








$MSG1=IniRead ([MENTION=317446765]Script[/MENTION]Dir&"\Impost.ini" , $LANG , "MSG1" , "Quick Search")
$MSG2=IniRead ([MENTION=317446765]Script[/MENTION]Dir&"\Impost.ini" , $LANG , "MSG2" , "You have the latest version of Analyze Youtube Mp3 Converter is not need to perform any update.")
$MSG3=IniRead ([MENTION=317446765]Script[/MENTION]Dir&"\Impost.ini" , $LANG , "MSG3" , "It is necessary to upgrade the program. Upgrade Now?")
$MSG4=IniRead ([MENTION=317446765]Script[/MENTION]Dir&"\Impost.ini" , $LANG , "MSG3" , "Non Ŕ stato possibile scaricare il brano, Ŕ possibile che URL non sia valido o servizio temporaneamente non disponibile. o che non sia un video proprietario")




$QUERYYT="http://www.youtube.com/results?search_query="








$oIE = _IECreateEmbedded ()
GUICreate("Analyze Youtube Mp3 Converter", [MENTION=317442937]Desktop[/MENTION]Width , [MENTION=317442937]Desktop[/MENTION]Height )
$GUIActiveX = GUICtrlCreateObj($oIE, 10, 100, [MENTION=317442937]Desktop[/MENTION]Width-100, [MENTION=317442937]Desktop[/MENTION]Height)




$GUI_Button_Back = GUICtrlCreateButton($BUTTON1, 10, 10, 100, 30)
$GUI_Button_Forward = GUICtrlCreateButton($BUTTON2, 120, 10, 100, 30)
$GUI_Button_Info = GUICtrlCreateButton($BUTTON3, 230, 10, 100, 30)
$GUI_Button_Stop = GUICtrlCreateButton($BUTTON4, 340, 10, 100, 30)
$GUI_Button_Download = GUICtrlCreateButton($BUTTON5, 450, 10, 100, 30)
$GUI_Button_Aggiornamenti = GUICtrlCreateButton($BUTTON6, 560, 10, 100, 30)
$GUI_Button_Exit = GUICtrlCreateButton($EXITBUTTON, 670, 10, 100, 30)
$GUI_Search_Bar= GUICtrlCreateInput ($MSG1 , 10 , 55 , 300 , 20)
$GUI_Button_Ricerca = GUICtrlCreateButton($BUTTON7, 310, 50, 100, 30)












GUISetState ()




; Waiting for user to close the window
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $GUI_Button_Info
MsgBox ( 0 , "Analyze Youtube Mp3 Converter" , "Created by Mezzofante Gaetano Emanuele")




Case $msg = $GUI_Button_Back
_IEAction ($oIE, "back")
Case $msg = $GUI_Button_Forward
_IEAction ($oIE, "forward")
Case $msg = $GUI_Button_Stop
_IEAction ($oIE, "stop")
Case $msg = $GUI_Button_Exit
ShellExecute ("www.analyzelab.altervista.org\AYMP3C\index"&$LANG&".htm" )
Exit
Case $msg = $GUI_Button_Aggiornamenti
$Test="NO"
$Chooser=0
$Data=InetRead ("http://analyzelab.altervista.org/AYMP3C/Download/Versione.html" , 0)
if $Data=$Versione then $Test="OK"
if $Test="OK" then MsgBox (64 , "Analyze GPA" , $MSG2)
if $Test="NO" then $Chooser=MsgBox (68 , "Analyze GPA" , $MSG3)
if $Chooser=6 then InetGet ("http://analyzelab.altervista.org/AYMP3C/Download/GPA.exe" , [MENTION=317446765]Script[/MENTION]Dir&"\GPA.exe")
if $Chooser=6 then Run ([MENTION=317446765]Script[/MENTION]Dir&"\GPA.exe" , [MENTION=317446765]Script[/MENTION]Dir)




Case $msg = $GUI_Button_Ricerca
$InputSearchYT=GUICtrlRead ($GUI_Search_Bar)
_IENavigate ($oIE , $QUERYYT&$InputSearchYT)




case $msg = $GUI_Button_Download








$IDIStance= _IEPropertyGet($oIE, "locationurl")
ProgressOn ("Analyze Youtube MP3 Converter" , "Cerco" , "Sto cercando")




GUICreate("Download", [MENTION=317442937]Desktop[/MENTION]Width , [MENTION=317442937]Desktop[/MENTION]Height , @SW_SHOW )
$oIE1 = _IECreateEmbedded ()
$GUIActiveX1 = GUICtrlCreateObj($oIE1, 10, 100, [MENTION=317442937]Desktop[/MENTION]Width-100, [MENTION=317442937]Desktop[/MENTION]Height)
_IENavigate ($oIE1 , "http://www.youtube-mp3.org/it")
$Input = _IEGetObjById ($oIE1, "youtube-url")
_IEFormElementSetValue ($Input, $IDIStance)
$submitbutton = _IEGetObjById ($oIE1, "submit")




_IEAction($submitbutton, "click")
Global $Ricalcolo=0
Sleep (5000)
ProgressOff ()
$Convalidate=_IELinkClickByText ($oIE1, "Scarica")
if $Convalidate=0 then Call ("Ricalcolo")




EndSelect
WEnd




GUIDelete()




Exit




Func Ricalcolo ()
$Ricalcolo=$Ricalcolo+1




if $Ricalcolo>3 then MsgBox (16 , "Errore!" , $MSG4)
Sleep (1000)
$Convalidate=_IELinkClickByText ($oIE, "Scarica")
if $Ricalcolo>5 then $Convalidate=1
if $Convalidate=0 then Call ("Ricalcolo")




EndFunc