Mon Premier post sur ce forum bien sympa.
Ma version d'un "Youtube Downloader" est un tantinet differente.
Effectivement en fouillant un peu youtube j'ai trouver qu'on pouvais réaliser une recherche très simplement.
pour faire ça rien de plus simple

http://www.youtube.com/rss/tag/autoit.rss
ceci vous retourne les video concernant autoit au format xml mais pas de panique je n'utilse pas, dans ce script en tous
cas, l'xml. la méthode est somme toutes plus brutale mais très efficace.
La ou ça devient amusant c'est avec la syntaxe suivante
http://www.youtube.com/rss/tag/autoit+tutorial.rss
Dans la recherche vous pouvez mettre des [espaces] qui serons directement convertis en [+]
Code : Tout sélectionner
#include <Array.au3>
#include <Inet.au3>
#include <String.au3>
_QuakeTubes(InputBox("Quake The Tubes","Tapez Votre recherche"))
Func _QuakeTubes($XQuery)
$XQuery = StringReplace($XQuery," ","+")
$Yquery = _INetGetSource("http://www.youtube.com/rss/tag/" & $XQuery & ".rss")
if @error <> 1 then
$result = _StringBetween($Yquery, '<item>', '</item>')
local $Yarray[UBound($result)][3]
for $yt = 0 to UBound($result)-1
$Titles = _StringBetween($result[$yt],'<media:title>','</media:title>')
$Link = _StringBetween($result[$yt],'<media:player url="','" />')
$Thumb = _StringBetween($result[$yt],'<media:thumbnail url="','" width=')
$Yarray[$yt][0] = _ArrayToString($Titles)
$Yarray[$yt][1] = _Convert($Link[0])
$Yarray[$yt][2] = _ArrayToString($Thumb)
ConsoleWrite($Yarray[$yt][1] & @crlf)
Next
_ArrayDisplay($Yarray)
Else
MsgBox("error","Aucun résultat pour votre recherche",0)
EndIf
Endfunc
Func _Convert($BaseLink)
Local $r_Url = $Baselink, $Init = 1001
Local $r_ID = StringTrimLeft($r_Url, StringInStr($r_Url, '='))
Local $_kb = 0, $_kbl = 0
$oRet = _INetGetSource('http://www.youtube.com/get_video_info?&video_id=' & $r_ID)
$s_token = _StringBetween($oRet, '&token=', '&thumbnail_url=')
If Not IsArray($s_token) Then
If StringLeft(StringTrimLeft($oRet, 22), 3) = '150' Then
;~ ConsoleWrite("Error" & @crlf)
Return -1
Else
;~ GUICtrlSetData($l_pr, $a_lng[23])
EndIf
;~ Return _ResetCtrl( )
EndIf
$v_title = _StringBetween($oRet, '&title=', '&')
If Not IsArray($v_title) Then
$v_title = StringTrimLeft($oRet, StringInStr($oRet, '&title=') + StringLen('&title=') -1)
If $v_title = "" Then
;~ GUICtrlSetData($l_pr, $a_lng[24])
;~ Return _ResetCtrl( )
Else
$s_title = $v_title
EndIf
Else
$s_title = $v_title[0]
EndIf
$Link = "http://www.youtube.com/get_video?video_id=" & $r_ID & "&t=" & $s_token[0] & "&fmt=5"
return $link
EndFunc ;==>_download
Effectivement dans l'array '$Yarray' se trouve tous ce dont vous avez besoin pour telecharger ou même jouer directement.
je fait d'ailleur un affichage de cette array en fin de programme.
Donc,
$Yarray[x][0] = Titres de la video
$Yarray[x][1] = Lien (pret a telecharger) de la video (un simple inetget vous telechargeras ça sans problème)
$Yarray[x][2] = Thumbnail soit l'image representant la vidéo (telechargeable aussi via inetget)
* [x] = Nombre de Video trouvée.
Bon le gros reste encore a faire mais j'ai écrit ce 'bout' de code en vue de l'intégrer dans d'autres de mes programmes sans
trop de soucis.
La Fonction _QuakeTube() est une création. la fonction _convert() émane du forum anglais d'autoIT (toujours en rade a l'heure ou je vous écrit

Voila j'espère que ça vous plairas.