Sign in to follow this  
Followers 0
Kip

Youtube UDF

5 posts in this topic

Hi,

(I dont have anything to say this time)

Functions:

_Youtube_Read($iID)



    _Youtube_GetID($sPlayer)
    _Youtube_GetTitle($sPlayer)
    _Youtube_GetDescription($sPlayer)
    _Youtube_GetKeywords($sPlayer)

    _Youtube_GetEmbedLink($sPlayer)
    _Youtube_GetPlayerLink($sPlayer)
    _Youtube_GetPlayerSwf($sPlayer)


    
    _Youtube_Create($iX, $iY, $iWidth=$YT_DEFAULTWIDTH, $iHeight=$YT_DEFAULTHEIGHT)
    _Youtube_Load($aPlayerControl, $sPlayer, $iAutoPlay=True)
    _Youtube_Stop($aPlayerControl)

Example: Just enter a video ID and the UDF will to the rest

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <Youtube.au3>


$GUI = GUICreate("YTPlayer",700,500)
    
    $iInput = GUICtrlCreateInput("6j7huh5Egew",480,50,115,23); 6j7huh5Egew is a cool song XD
    $iPlay = GUICtrlCreateButton("Play",600,50,90,23)
    
    $iLabel = GUICtrlCreateLabel("ID:        " &@CRLF & _
        "Title:      " &@CRLF & _
        "Description:    " &@CRLF & _
        "Keywords:   " ,490,90,200,600)
    
    $aPlayerControl = _Youtube_Create(50,50)
    
GUISetState()



While 1
    
    $iMsg = GUIGetMsg()
    
    Switch $iMsg
        
        Case $GUI_EVENT_CLOSE
            
            Exit
            
        Case $iPlay
            
            $sID = GUICtrlRead($iInput)
            
            GUICtrlSetState($iPlay,$GUI_DISABLE)
            $sPlayer = _Youtube_Read($sID); Read webpage (could take a while)
            
            $sTitle = _Youtube_GetTitle($sPlayer)
            $sDescription = _Youtube_GetDescription($sPlayer)
            $sID = _Youtube_GetID($sPlayer)
            $sKeywords = _Youtube_GetKeywords($sPlayer)
            
            GUICtrlSetData($iLabel,"Title:       "&$sTitle &@CRLF & _
                "Description:    "& $sDescription &@CRLF & _
                "Keywords:   "& $sKeywords &@CRLF&@CRLF& _
                "ID:         "&$sID)
            
            _Youtube_Load($aPlayerControl, $sPlayer)
            
            GUICtrlSetState($iPlay,$GUI_ENABLE)
        
    EndSwitch
    
WEnd

Youtube.au3

Share this post


Link to post
Share on other sites



Very good job. :P:(

Work fine.


When the words fail... music speaks

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Looks good,

I'd hate for Youtube to update their code and this broke (this happens all the time), another thing, It depends on two things Internet Explorer and Adobe Flash, which will fail if flash was disabled. :P

Edited by mrRevoked

Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet()

Share this post


Link to post
Share on other sites

umm.. this doesn't work for me..

I have flash and Internet explorer..

It returns the title, description, webstie and keywords all fine..

but I just see a white screen..

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I'd add a youtube download :mellow:

And a search

anyway... very good job!

Edited by torels

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
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
Sign in to follow this  
Followers 0