The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WebService::GData::YouTube::Feed::Video - a Video YouTube contents(read/write) for data API v2.

SYNOPSIS

    use WebService::GData::YouTube;

    #create an object that only has read access
    my $yt = new WebService::GData::YouTube();

    #get a feed response from YouTube;
    my $videos  = $yt->get_top_rated;
    #more specific:
    my $videos  = $yt->get_top_rated('JP','Comedy');

    foreach my $video (@$videos) {
        $video->video_id;
        $video->title;
        $video->content;
                $video->view_count;
                $video->favorite_count;
                $video->duration;
                #...etc
    }

    #connect to a YouTube account
    my $auth = new WebService::GData::ClientLogin(
        email=>'...'
        password=>'...',
        key        =>'...'
    );

    #give write access with a $auth object that you created
    my $yt = new WebService::GData::YouTube($auth);

    my $videos  = $yt->get_user_videos();#returns videos from the loggedin user even if private

    #update the playlist by adding the playlist title as a keyword
    foreach my $video (@$videos) {

        if($video->video_id eq $myid) {

            $video->delete();

        }else {

            if($video->is_listing_allowed){

                $video->kewords($playlist->title.','.$video->keywords);
                $video->save();
            }
        }
    }
         

DESCRIPTION

inherits from WebService::GData::Feed::Entry;

This package represents a Youtube Video. If you are logged in you can edit existing video metadata,create new metadata, upload videos.

Most of the time you will not instantiate this class directly but use some of the helpers in the WebService::GData::YouTube class.

CONSTRUCTOR

new

Parameters:

jsonc_video_entry_feed:Object
authorization:Object (Optional)

If an authorization object is set (WebService::GData::ClientLogin),

it will allow you to access private contents and insert/edit/delete/upload videos.

GET METHODS

All the following methods are information that a video contains.

You can not update them and are read only.

view_count

favorite_count

media_player

aspect_ratio

duration

content

comments

thumbnails

uploaded

etag

appcontrol_state

GENERAL SET/GET METHODS

All these methods represents information about the video but as these information can be updated,

you have read/write access to them.

It is therefore necessary to be logged in programmaticly to be able to use them.

video_id

category

description

keywords

filename

upload_mode

ACCESS CONTROL SET/GET METHODS

These methods allow to grant access to certain activity to the users.

You can decide to unlist the video from the search, make it private or forbid comments,etc.

access_controll

is_listing_allowed

is_comment_allowed

is_comment_vote_allowed

is_video_response_allowed

is_rating_allowed

is_embedding_allowed

is_syndication_allowed

private

QUERY METHODS

These methods actually query the service to save your edits.

You must be logged in programmaticly to be able to use them.

The save method will do an insert if there is no video_id or an update if there is one.

delete

save

CONFIGURATION AND ENVIRONMENT

none

DEPENDENCIES

JSON

LWP

INCOMPATIBILITIES

none

BUGS AND LIMITATIONS

If you do me the favor to _use_ this module and find a bug, please email me i will try to do my best to fix it (patches welcome)!

AUTHOR

shiriru <shirirulestheworld[arobas]gmail.com>

LICENSE AND COPYRIGHT

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.