示例#1
0
def updateYouTubePermissions(video):
    api = GoogleAPI()
    if not api.authorized:
        raise Exception("Website is not authorized to upload to YouTube")
    is_public = False
    for perm in video.rolesOfPermission("View"):
        if perm['name'] == 'Anonymous':
            if perm['selected'] != '':
                is_public = True
            break
    if is_public:
        if video.youtube_data['status']['privacyStatus'] != 'public':
            api.edit_video(video.youtube_data, video.Title(),
                           video.Description(), 'public')
            video.youtube_data['status']['privacyStatus'] = 'public'
    else:
        if video.youtube_data['status']['privacyStatus'] != 'unlisted':
            api.edit_video(video.youtube_data, video.Title(),
                           video.Description(), 'unlisted')
            video.youtube_data['status']['privacyStatus'] = 'unlisted'
示例#2
0
def updateYouTubePermissions(video):
    api = GoogleAPI()
    if not api.authorized:
        raise Exception("Website is not authorized to upload to YouTube")
    is_public = False
    for perm in video.rolesOfPermission("View"):
        if perm['name'] == 'Anonymous':
            if perm['selected'] != '':
                is_public = True
            break
    if is_public:
        if video.youtube_data['status']['privacyStatus'] != 'public':
            api.edit_video(video.youtube_data, video.Title(),
                           video.Description(), 'public')
            video.youtube_data['status']['privacyStatus'] = 'public'
    else:
        if video.youtube_data['status']['privacyStatus'] != 'unlisted':
            api.edit_video(video.youtube_data, video.Title(),
                           video.Description(), 'unlisted')
            video.youtube_data['status']['privacyStatus'] = 'unlisted'
示例#3
0
def editYouTubeVideo(video):
    api = GoogleAPI()
    if not api.authorized:
        raise Exception("Website is not authorized to upload to YouTube")
    api.edit_video(video.youtube_data, video.Title(), video.Description())
示例#4
0
def editYouTubeVideo(video):
    api = GoogleAPI()
    if not api.authorized:
        raise Exception("Website is not authorized to upload to YouTube")
    api.edit_video(video.youtube_data, video.Title(), video.Description())