小编yev*_*vvy的帖子

如何从 id 中抓取 youtube 视频的缩略图?

我对 python 很陌生,我想知道如何只打印 maxres 缩略图,而不是字面上关于视频的所有内容。对不起,如果答案有点明显,我对 python 和一般编程有点陌生。

from apiclient.discovery import build

DEVELOPER_KEY = 'xxxxxx'
youtube = build('youtube', 'v3', developerKey=DEVELOPER_KEY)

ids = '6Gw-RyTRMns'
results = youtube.videos().list(id=ids, part='snippet').execute()
for result in results.get('items', []):
    print(results)    
Run Code Online (Sandbox Code Playgroud)

我还想知道是否有办法从给定视频的描述中获取图片的 URL 并将其保存到文件夹中。

python youtube

4
推荐指数
1
解决办法
4999
查看次数

标签 统计

python ×1

youtube ×1