YouTube APIを
Pythonで使うにはどうすればいいのか調べた。このページにたどり着いた。
http://code.google.com/apis/youtube/code.html
次のページの記述に従って設定してみる。
http://code.google.com/apis/gdata/articles/python_client_lib.html
- Google data Python client libraryというものを使うことになるらしい。
- ElementTreeは今のままで使えそうだ。
- Google data libraryをインストールする。
- gdata.py-1.1.1.zipをダウンロードして展開する。
- 展開したディレクトリで、# python setup.py installを実行する。
- テストの実行。% python ./tests/run_data_tests.py → OK
- さらにテスト。/samples/docs/docs_example.pyを実行。→ダメ!エラー。
エラーの内容。
NOTE: Please run these tests only with a test account. Please enter your username: Password: Traceback (most recent call last): File "samples/docs/docs_example.py", line 261, inmain() File "samples/docs/docs_example.py", line 252, in main sample = DocsSample(user, pw) File "samples/docs/docs_example.py", line 51, in __init__ self.gd_client.ProgrammaticLogin() File "/usr/local/lib/python2.5/site-packages/gdata/service.py", line 325, in ProgrammaticLogin content_type='application/x-www-form-urlencoded') File "/usr/local/lib/python2.5/site-packages/atom/service.py", line 316, in HttpRequest connection.endheaders() File "/usr/local/lib/python2.5/httplib.py", line 856, in endheaders self._send_output() File "/usr/local/lib/python2.5/httplib.py", line 728, in _send_output self.send(msg) File "/usr/local/lib/python2.5/httplib.py", line 695, in send self.connect() File "/usr/local/lib/python2.5/httplib.py", line 1131, in connect ssl = socket.ssl(sock, self.key_file, self.cert_file) AttributeError: 'module' object has no attribute 'ssl'