Youtube API - Set the Thumbnail of Video (python)(Youtube API - 设置视频缩略图(python))
问题描述
是否可以为通过 YouTube API 上传的视频指定您自己的缩略图?
使用最新版本的 Python 库,我似乎可以在将视频条目插入 YouTube 之前创建和设置媒体组的缩略图 - 但是指定的缩略图不会在视频本身上设置.
Using the most recent version of the Python Library, it appears that I can create and set the thumbnail of my media group before inserting a video entry to YouTube - however the thumbnail specified does NOT get set on the video itself.
我正在使用类似这样的代码:
I'm using code similar to this:
from gdata import media
from gdata.youtube import YouTubeVideoEntry
from gdata.youtube.service import YouTubeService
# Create a thumbnail and pass it to my media group
thumbnail = media.Thumbnail(url='http://valid_image_url.jpg')
media_group = media.Group(thumbnail=thumbnail, title='foo', ...)
# Use the media group to create a video entry
entry = YouTubeVideoEntry(media=media_group)
# Create a service instance and use it to login
service = YouTubeService(...)
service.ClientLogin(...)
# Get video file
file = open('/path_to_video.mp4', 'rb')
# Push the video to YouTube
service.InsertVideoEntry(
entry,
file
)
# Close the file
file.close()
推荐答案
否.使用标准的 YouTube API,您无法以编程方式为视频设置缩略图.
No. Using the standard YouTube API, you cannot programatically set a thumbnail for your video.
但是,如果您是 内容合作伙伴并有权访问 YouTube CMS(您的合作伙伴经理可以启用),您显然可以从那里设置您的视频艺术作品.我将在完成此过程时发布详细信息.
However, if you are a content partner and have access the YouTube CMS (which your partner manager can enable), you can apparently set your video artwork from there. I'll post details as I run through this process.
这篇关于Youtube API - 设置视频缩略图(python)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Youtube API - 设置视频缩略图(python)
基础教程推荐
- 由Python将MP3转换为MIDI(类型错误:无法加载插件:mtg-Melodia:Melodia) 2022-01-01
- Discord.py 缺少必需的参数 2022-01-01
- 将 x 轴刻度更改为自定义字符串 2022-01-01
- 与常规 dict 相比,Python manager.dict() 非常慢 2022-01-01
- pyserial - 可以从线程 a 写入串行端口,是否阻塞从线程 b 读取? 2022-01-01
- 使用生成器和迭代器时 Python 多循环失败 2022-01-01
- numpy float:比算术运算中内置的慢 10 倍? 2022-01-01
- 用 Python 编写 Fortran 无格式文件 2022-01-01
- 尝试制作WhatsApp机器人 2022-01-01
- 在 Celery 工作人员中捕获 Heroku SIGTERM 以优雅地关 2022-01-01
