在python中无法绕过YouTube的api上传缩略图

时间:2017-01-15 17:49:26

标签: python api youtube subprocess

我正致力于使用api将视频上传到YouTube。但是,我无法解决来自youtubes uploadThumbnail.py文件的这些错误。来自uploadThumbnail的错误无法识别我传入的文件。我正在使用subprocess来运行uploadThumbnail文件,这就是我收到错误的地方。

def updateThumbnail(imagePath):
    arr = []
    arr = textFile.readLine(r"C:\Users\user1\Desktop\tester\Video-id.txt")
    print(imagePath)
    print(imagePath.replace("\\", "\\\\"))
    (Right below this is the error)
    subprocess.check_output('python Thumbnail.py --file ="'+imagePath.replace("\\", "\\\\")+ '" --video-id=" '+arr[0]+'"')
    print("thumbnail updated!")

这是我得到的错误。 enter image description here

只是为了让你们了解一下,我从这里下载了代码 - > https://github.com/youtube/api-samples/blob/master/python/upload_thumbnail.py

有谁知道为什么这不起作用?

0 个答案:

没有答案