我想在没有用户参与的情况下自动将视频上传到YouTube,所以我创建了一个服务帐户,跳过了箍,一切看起来很棒,然后尝试上传,一个块,并且我的代码遭到了这个Google_Exception异常的爆炸:
"无法启动可恢复上传(HTTP 401:youtube.header,Unauthorized)"
然后我在YouTube API v3上挖掘并找到错误信息:
https://developers.google.com/youtube/v3/docs/errors
"如果您尝试使用OAuth 2.0服务帐户流程,则会出现此错误.YouTube不支持服务帐户,如果您尝试使用服务帐户进行身份验证,则会收到此错误."
它是否正确?我无法使用服务帐户自动将视频上传到YouTube?
(这是浪费了几天努力工作!)
使用此 HTML,我无法弄清楚为什么文本显示在图像后面:
<div style="position: relative">
<img src="image_url_here" style="position:absolute; top: 10px; left: 10px;" />
This is some text, drawn on the page after the image, why is it drawn behind the image?
</div>
Run Code Online (Sandbox Code Playgroud)
?
在 Mac 和 PC 上的 Chrome 和 PC 上的 IE 中测试。
我想定期搜索系统上是否存在与特定名称匹配的所有文件,删除它们,然后如果找到任何文件,则运行附加命令。
test=1
find /home/ -name 'file_name_to_find' -exec bash -c "rm \"{}\" && test=2" \;
echo $test
if [[${test} == '2']] ; then
echo "it worked!"
fi
Run Code Online (Sandbox Code Playgroud)
我认为因为 exec 中的变量作用域是新的,所以脚本的其余部分无法访问 $test 的值。
我怎样才能达到预期的结果?