我向谷歌照片上传了几百个旧的(~2009-2010)视频(mpg,mts),令我沮丧的是,EXIF元数据不存在或无法识别,所以他们都将日期标记设置为什么时候上传。
我想我可以使用Google Drive API
更改modifiedTime
属性,因为可以通过那里访问照片。
但是,API似乎只根据范围提供对照片空间的只读访问权限,因此我收到了权限问题。
file_metadata = {
'modifiedTime': some_custom_date#datetime.utcnow().isoformat() + 'Z'
}
file = DRIVE.files().update(fileId=file_id,
body=file_metadata,
fields='id, modifiedTime').execute()
具体来说,我收到了错误
HttpError: <HttpError 403 when requesting https://www.googleapis.com/drive/v3/files/xxxxxxxxxxxxxxxxxxxxxx?fields=id%2C+modifiedTime&alt=json returned
"The user has not granted the app yyyyyyyy write access to the file xxxxxxxxxxxxxxxxxxxxxx.">
所以问题是,是否有办法通过Drive API修改照片范围内的文件?错误本身似乎表明它是一个可以更改的权限吗?