Jump to content

Youtube HQ Player


AzKay
 Share

Recommended Posts

Saw all the other "Youtube Download"ers, and thought I would make one.

Ended up just being a HQ player. Ohwell, I might update it, But chances are ill forget.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListBoxConstants.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <GUIListBox.au3>
#include <GUITab.au3>
#include <String.au3>
#include <Array.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Youtube", 506, 408, 217, 129)
$PageControl1 = GUICtrlCreateTab(8, 8, 489, 390)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem("Search")
$List1 = GUICtrlCreateList("", 16, 40, 177, 314, $WS_BORDER)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Input1 = GUICtrlCreateInput("", 200, 40, 193, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Button1 = GUICtrlCreateButton("Search", 400, 40, 81, 21, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Pic1 = GUICtrlCreatePic("", 272, 72, 137, 100)
$Edit1 = GUICtrlCreateEdit("", 200, 184, 281, 137, $ES_READONLY)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Button2 = GUICtrlCreateButton("Watch Video", 200, 328, 281, 21, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label1 = GUICtrlCreateLabel("BAWWWWWWWWWWWWWWWWWWW", 16, 360, 475, 33)
GUICtrlSetFont(-1, 18, 800, 0, "Arial")
$TabSheet2 = GUICtrlCreateTabItem("Player")
$Obj1 = ObjCreate("ShockwaveFlash.ShockwaveFlash.9")
$Obj1_ctrl = GUICtrlCreateObj($Obj1, 12, 33, 480, 360)
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            GUICtrlSetState($Button1, $GUI_DISABLE)
            _GUICtrlListBox_ResetContent($List1)
            Search()
            GUICtrlSetState($Button1, $GUI_ENABLE)
        Case $List1
            Load()
        Case $Button2
            GUICtrlSetState($Button2, $GUI_DISABLE)
            $x = _GUICtrlListBox_GetCurSel($List1)
            LoadVideo($Obj1, StringRight($oVideosX[$x][1], 11))
            _GUICtrlTab_ClickTab($PageControl1, 1)
            GUICtrlSetState($Button2, $GUI_ENABLE)
    EndSwitch
WEnd

Func Load()
    $x = _GUICtrlListBox_GetCurSel($List1)
    InetGet($oVideosX[$x][5], @TempDir & "\default.jpg")
    GUICtrlSetImage($Pic1, @TempDir & "\default.jpg")
    FileDelete(@TempDir & "\default.jpg")
EndFunc

Func Search()
    Global $oVideosX[20][13]
    $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
    $oHTTP.Open("GET", "http://www.youtube.com/results?search_query=" & GUICtrlRead($Input1), False)
    $oHTTP.Send()
    $Videos = _StringBetween($oHTTP.ResponseText, "<div class=""v120WrapperInner"">", "</a>")
    For $i = 0 To UBound($Videos) -1
        $oVideos = StringSplit($Videos[$i], """", 2)
        For $x = 0 To UBound($oVideos) -1
            $oVideosX[$i][$x] = $oVideos[$x]
        Next
        GUICtrlSetData($List1, $oVideosX[$i][9] & "|")
    Next
EndFunc

Func LoadVideo($oYoutube, $id, $quality = 18)
    $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
    $oHTTP.Open("GET", "http://www.youtube.com/watch?v=" & $id & "&fmt=" & $quality, False)
    $oHTTP.Send()
    Dim $FlashVarsX
    $FlashVars = _StringBetween($oHTTP.ResponseText, "var swfArgs = {", "};")
    $FlashVars = StringSplit($FlashVars[0], ", ", 1)
    For $i = 1 To $FlashVars[0]
        $FlashVarsX &= StringReplace(StringReplace($FlashVars[$i], """", ""), ": ", "=") & "&"
    Next
    $oYoutube.Movie = "http://"
    $oYoutube.Flashvars = $FlashVarsX & "playnext=0&enablejsapi=1"
    $oYoutube.Movie = "http://s.ytimg.com/yt/swf/watch-vfl65425.swf"
EndFunc

Feedback?

Edited by AzKay
# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

You need latest beta.

but can you figure out how to implement fullscreen mide?

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

I could "Attempt", But I doubt ill succeed.

Ill hasstle Brett when he gets online to help me. xD

Edited by AzKay
# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

Found it... 1line of code :mellow: $Obj1.AllowFullScreen = True

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Found it... 1line of code :mellow: $Obj1.AllowFullScreen = True

Genius. xD

EDIT::

Also, incase anyone was wondering why theres bland controls and BAWwwwwwwwwwwwwwwwwwwwwwwwwwww.

I was trying to fill in space, In the "original idea", there was going to have the file size, rating, date added, author, description, etc.

But arrays and such confuse me after awhile, So I havnt gotten around to it yet.

Edited by AzKay
# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

:mellow: just oleview.exe

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Yeah, I always oleview. Though, I thought the fullscreen button wouldve been some "custom" youtube JS attached sort of thing, like, just for use in browsers.

Guess I was wrong.

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

  • 9 months later...

doesn't work here... always keeps on crashing

[u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...