Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResumableUploadError #2

Open
GoogleCodeExporter opened this issue Jan 28, 2016 · 1 comment
Open

ResumableUploadError #2

GoogleCodeExporter opened this issue Jan 28, 2016 · 1 comment

Comments

@GoogleCodeExporter
Copy link

Returning this error when attempting to upload a file with a title, 
description, keywords, category, and privacyStatus="private"

Uploading file...
No handlers could be found for logger "oauth2client.util"
Traceback (most recent call last):
  File "/Users/mileslauridsen/Dropbox/PRODUCTION/SYSTEMS/python/upload_video.py", line 162, in <module>
    initialize_upload(options)
  File "/Users/mileslauridsen/Dropbox/PRODUCTION/SYSTEMS/python/upload_video.py", line 107, in initialize_upload
    resumable_upload(insert_request)
  File "/Users/mileslauridsen/Dropbox/PRODUCTION/SYSTEMS/python/upload_video.py", line 117, in resumable_upload
    status, response = insert_request.next_chunk()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/oauth2client/util.py", line 128, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/apiclient/http.py", line 747, in next_chunk
    raise ResumableUploadError(resp, content)
apiclient.errors.ResumableUploadError: <HttpError 400 "Bad Request">


Original issue reported on code.google.com by [email protected] on 13 Apr 2013 at 10:27

@GoogleCodeExporter
Copy link
Author

Found the issue.  Added the error code 400 to the least of retries and got a 
bit more info back:
A retriable HTTP error 400 occurred:
{
 "error": {
  "errors": [
   {
    "domain": "youtube.video",
    "reason": "invalidCategoryId",
    "message": "Bad Request",
    "locationType": "other",
    "location": "body.snippet.categoryId"
   }
  ],
  "code": 400,
  "message": "Bad Request"
 }
}

So as it turns it I was trying to use a category="Film" as is described 
somewhere in the youtube v2 api python docs.  This version expects an integer 
submitted as a string.

Here's an example of how an upload worked for me:
sudo python ~/pathTo/upload_video.py --file="someVideo.mp4" --title="Test 
Upload" --description="This is a test" --keywords="test" --category="3" 
--privacyStatus="private"


And here's the category codes as I couldn't find a list anywhere: 

Film & Animation    1
Autos & Vehicles    2
Howto & Style   3
People & Blogs  4
Entertainment   5
People & Blogs  6
News & Politics 7
Entertainment   8
Comedy  9
Music   10
News & Politics 11
Comedy  12
People & Blogs  13
People & Blogs  14
Pets & Animals  15
Howto & Style   16
Sports  17
Entertainment   18
Travel & Events 19
News & Politics 21
People & Blogs  22
Comedy  23
Entertainment   24
News & Politics 25
Howto & Style   26
Education   27
Science & Technology    28
Nonprofits & Activism   29

Original comment by [email protected] on 13 Apr 2013 at 11:19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant