copiesofcopies / youtube-transcription

Apache License 2.0
72 stars 8 forks source link

YouTube Throws a 400 Error #11

Open waldoj opened 11 years ago

waldoj commented 11 years ago

As with @mtdukes' problem in #9, I also find that things break down for me shortly after starting. Although I suspect that our two problems are unrelated. I get as far as uploading the first video before this appears:

$ python upload-videos.py -i manifest.json manifest-output.json
INFO: Downloading video from http://archive.org/download/vahouse20100308/20100308.mp4...
Progress: 100%
INFO: Uploading video from http://archive.org/download/vahouse20100308/20100308.mp4 to YouTube...
Traceback (most recent call last):
  File "upload-videos.py", line 174, in <module>
    uploaded_vid = upload_video(fn, metadata)
  File "upload-videos.py", line 72, in upload_video
    new_entry = yt_service.InsertVideoEntry(video_entry, filename)
  File "/usr/lib/python2.6/site-packages/gdata/youtube/service.py", line 661, in InsertVideoEntry
    raise YouTubeError(e.args[0])
gdata.youtube.service.YouTubeError: {'status': 400, 'body': "<?xml version='1.0' encoding='UTF-8'?><errors><error><domain>yt:validation</domain><code>required</code><location type='xpath'>media:group/media:category[@scheme='http://gdata.youtube.com/schemas/2007/categories.cat']/text()</location></error></errors>", 'reason': 'Bad Request'}

I find the error generated by gdata a bit frustrating—if there's a been a bad request, it seems to me that it ought to provide both the error and the request that prompted it. That's an annoying error on Google's part.

This is my config.yaml:

user_email: jaquith@gmail.com
user_password: xxxxxxxxxxxxxxxxxx
source: yt-transcription
developer_key: AI39si6kJeP-i-Rk1a-FlGIqSj6q_Vb70H6VbjSJ8TOciqiO5JYzn12xY8Idz3h6sNAfas93KJ7eO6-9slWR3ewkeW9qRPNvUA
client_id: 507530339541.apps.googleusercontent.com

My manifest.json is enormous, but here's the first stanza:

{"http:\/\/archive.org\/download\/house20080109\/20080109.mp4":
    {"title":
    "Virginia General Assembly, House Session, January 09, 2008",
    "date":"2008-01-09",
    "category_label":"News &amp; Politics",
    "keywords":"virginia, general assembly, legislature, government, house"},
[...]

It's within reason that I've done something wrong within my config.yaml, but it seems unlikely that would result in a 400, instead of, say, a 403.