Voici mon script:
► Afficher le texte
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <IE.au3>
#include <Math.au3>
#include <WindowsConstants.au3>
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=..\..\..\Program Files (x86)\AutoIt3\Aut2Exe\Icons\YoutubeDownloader.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
Opt("GUIOnEventMode", 1)
$GUI = GUICreate("JST Youtube Downloader", 606, 283, 192, 124)
GUICtrlSetFont(-1, 14, 400, 0, "Segoe UI")
GUICtrlSetColor(-1, 0x1E3287)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
$LabelTitre = GUICtrlCreateLabel("Youtube Downloader Par Jamesst20", 175, 8, 255, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Segoe UI")
$TitreVideoYoutube = GUICtrlCreateLabel("", 48, 88, 518, 24)
GUICtrlSetFont(-1, 11, 400, 0, "Segoe UI")
$Group1 = GUICtrlCreateGroup("Téléchargement de la Vidéo de Youtube", 32, 56, 545, 201, $BS_CENTER)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$LienYoutube = GUICtrlCreateInput("http://www.youtube.com/....", 48, 120, 409, 21)
$GetDownloadInfo = GUICtrlCreateButton("Pret", 472, 109, 89, 21, $WS_GROUP)
GUICtrlSetOnEvent(-1, "_GetDownloadLinkAndQuality")
$DownloadButton = GUICtrlCreateButton("Download", 472, 131, 89, 21, $WS_GROUP)
GUICtrlSetOnEvent(-1, "_DownloadVideo")
$ProgressBar = GUICtrlCreateProgress(48, 224, 513, 17)
GUISetState(@SW_SHOW)
$load = 1
$LienYoutubeRead = "about:blank"
$oIETitre = _IECreate($LienYoutubeRead,0,0,1)
AdlibRegister("_Gettitle",20)
While 1
Sleep(1)
WEnd
Func _Exit()
_IEQuit($oIETitre)
Exit
EndFunc
Func _GetTitle()
$LienYoutubeRead = GUICtrlRead($LienYoutube)
If $LienYoutubeRead = "" Then GUICtrlSetData($TitreVideoYoutube, "")
If $LienYoutubeRead >= "http://www.youtube.com/watch?v=" Then
If $load = 1 Then
GUICtrlSetData($TitreVideoYoutube, "Chargement...")
$load = 2
EndIf
_IENavigate($oIETitre, $LienYoutubeRead,1)
_IENavigate($oIETitre, "javascript:fv=document.getElementById('watch-headline-title').innerText;",0)
$Titredetecter = _IEBodyReadText($oIETitre)
GUICtrlSetData($TitreVideoYoutube, $Titredetecter)
EndIf
EndFunc
Func _GetDownloadLinkAndQuality()
$LienYoutubeReadForDownload = GUICtrlRead($LienYoutube)
Local $_JScriptCmd2 ="javascript:isIE=/*@cc_on!@*/false;isIE ? swfHTML=document.getElementById('movie_player').getElementsByTagName('param')[1].value:swfHTML=document.getElementById('movie_player').getAttribute('flashvars');w=swfHTML.split('&');for(i=0;i<=w.length-1;i++) if(w[i].split('=')[0]=='fmt_url_map') {links=unescape(w[i].split('=')[1]);}"
$oIE = _IECreate($LienYoutubeReadForDownload,0,1, 0)
Sleep(2000)
_IENavigate($oIE, $_JScriptCmd2,0)
Sleep (1000)
$ALLURLDetected = _IEBodyReadText ($oIE)
$UrlArray = StringSplit ( $ALLURLDetected, ',' )
Global $Ext
Global $Quality
$UBound = _Min ( 6, UBound ( $UrlArray ) -1 )
For $i = 1 To $UBound
$AllLinkDivisedArray = StringSplit ($UrlArray[$i], '|' )
Next
For $ii = 1 To UBound($UrlArray) -1
$FinalUrl = StringSplit ( $UrlArray[$ii], '|' )
_SwitchExt ( $UrlArray[$ii] )
If $ii = 1 Then $Quality1 = GUICtrlCreateRadio ($Ext , 48, 144, 135, 25 )
If $ii = 2 Then $Quality2 = GUICtrlCreateRadio ($Ext , 190, 144, 135, 25 )
If $ii = 3 Then $Quality3 = GUICtrlCreateRadio ($Ext , 332, 144, 135, 25 )
If $ii = 4 Then $Quality4 = GUICtrlCreateRadio ($Ext , 48, 164, 135, 25 )
If $ii = 5 Then $Quality5 = GUICtrlCreateRadio ($Ext , 190, 164, 135, 25 )
If $ii = 6 Then $Quality6 = GUICtrlCreateRadio ($Ext , 332, 164, 135, 25 )
If $ii = 7 Then $Quality7 = GUICtrlCreateRadio ($Ext , 48, 184, 135, 25 )
If $ii = 8 Then $Quality8 = GUICtrlCreateRadio ($Ext , 190, 184, 135, 25 )
If $ii = 9 Then $Quality9 = GUICtrlCreateRadio ($Ext , 332, 184, 135, 25 )
Next
EndFunc
Func _SwitchExt ( $Switch )
$StringSplit = StringSplit ( $Switch, '|' )
If $StringSplit[1] = 37 Then $Ext = "Haute Qualitée MP4"
If $StringSplit[1] = 18 Then $Ext = "Basse Qualitée MP4"
If $StringSplit[1] = 22 Then $Ext = "Moyenne Qualitée MP4"
If $StringSplit[1] = 38 Then $Ext = "Très haute Qualitée MP4"
If $StringSplit[1] = 13 Then $Ext = "Basse Qualitée 3GP"
If $StringSplit[1] = 17 Then $Ext = "Haute Qualitée 3GP"
If $StringSplit[1] = 43 Then $Ext = "Basse Qualitée WebM"
If $StringSplit[1] = 45 Then $Ext = "Haute Qualitée WebM"
If $StringSplit[1] = 5 Then $Ext = "Basse Qualitée Flv"
If $StringSplit[1] = 34 Then $Ext = "Haute Qualitée Flv"
If $StringSplit[1] = 35 Then $Ext = "Très Haute Qualitée Flv"
If $StringSplit[1] = 6 Then $Ext = "Moyenne Qualitée Flv"
If $StringSplit[1] = 0.5 Then $Ext = "Très Basse Qualitée Flv"
EndFunc
Func _DownloadVideo()
EndFuncMerci Beaucoup

