我对 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 并将其保存到文件夹中。