我是 python 新手,在搜索时我发现我可以在 linux 的命令行中将视频上传到 youtube,而且我使用的是 centos 5.7
我首先安装了 python 2.7 并在执行过程中遇到了很多问题,但我在谷歌上搜索并找到答案
一个主要问题已经面临并解决了 httpsconnection,在安装了 open ssl 和 openssl-devel 之后,我可以使用这个命令来上传视频:
>python youtube_upload.py --email="test.for.utube@gmail.com" --password="****" --title="test" --category="test" test.mp4
并得到这个结果:
Login to Youtube API: email='test.for.utube@gmail.com', password='********' Traceback (most recent call last):
File "youtube_upload.py", line 449, in <module>
sys.exit(catch_exceptions(EXIT_CODES, main_upload, sys.argv[1:]))
File "youtube_upload.py", line 105, in catch_exceptions
fun(*args, **kwargs)
File "youtube_upload.py", line 381, in main_upload
captcha_response=options.captcha_response)
File "youtube_upload.py", line 183, in login
self.categories = self.get_categories()
File "youtube_upload.py", line 255, in get_categories
xml = ElementTree.XML(xmldata)
File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 1301, in XML
parser.feed(text)
File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 1643, in feed
self._raiseerror(v)
File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 1507, in _raiseerror
raise err
xml.etree.ElementTree.ParseError: syntax error: line 1, column 49
并没有在谷歌上找到任何解决方案。所以希望任何人都可以帮助我通过命令行成功完成youtube上传。
非常感谢。如果我能快速回复预计有解决方案的时间,那么我知道我应该等多久