dorosh / gdata-python-client

Automatically exported from code.google.com/p/gdata-python-client
0 stars 0 forks source link

YouTube InsertVideoEntry fails with "Unknown authorization header" #408

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Some users are experiencing the error "gdata.youtube.service.YouTubeError: 
{'status': 401, 'body': 'Unknown authorization header', 'reason': 
'Unauthorized'}"

after attempting to upload a large video with InsertVideoEntry.

Here is the code (from a subclass of gdata.youtube.service.YouTubeService):

my_media_group = Group(title=Title(text=title or filename),
                       description=Description(text=desc or 'A video'),
                       keywords=Keywords(text=tags),
                       category=build_category(category))

video_entry = gdata.youtube.YouTubeVideoEntry(media=my_media_group)
self.InsertVideoEntry(video_entry, path)

What version of the product are you using?
2.0.10 (possibly others as well)

Please provide any additional information below.
Attached is a file containing trimmed output of a failed upload with the debug 
attribute set to true. (The initial GET is a check to see if the access token 
is valid, not part of the upload)

Original issue reported on code.google.com by tom.h.mi...@gmail.com on 10 Jul 2010 at 2:29

Attachments:

GoogleCodeExporter commented 9 years ago
I'm having this problem when uploading a 412MB video. It takes more then 2 
hours before the errormessage appears.

Connection: 4Mbps down 512kbps up
OS: QNAP Version 3.2.5 build 0409T
Python: 2.5.2
GData: 2.0.10

Original comment by mrtn...@gmail.com on 12 Jul 2010 at 12:47

GoogleCodeExporter commented 9 years ago
Is there any updates on this issue?
I see no problems when uploading small (~50mb) files but getting the following 
error when trying bigger files (over 500mb)

Traceback (most recent call last):
  File "/opt/local/bin/google", line 536, in <module>
    main()
  File "/opt/local/bin/google", line 530, in main
    run_once(options, args)
  File "/opt/local/bin/google", line 408, in run_once
    task.run(client, options, args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/googlecl/youtube/service.py", line 205, in _run_post
    tags=options.tags, category=options.category)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/googlecl/youtube/service.py", line 117, in post_videos
    self.InsertVideoEntry(video_entry, path)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/gdata/youtube/service.py", line 656, in InsertVideoEntry
    raise YouTubeError(e.args[0])
gdata.youtube.service.YouTubeError: {'status': 401, 'body': 'Unknown 
authorization header', 'reason': 'Unauthorized'}

Some info:
OS: OS X 10.6.3

-->uname -a
Darwin macmini.local 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 
PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386

-->google --version
google 0.9.8

-->port installed | egrep "gdata|python"
  py26-gdata @2.0.10_0 (active)
  python26 @2.6.4_0+darwin
  python26 @2.6.5_3 (active)

Thx

Original comment by hubert.b...@gmail.com on 25 Jul 2010 at 12:01

GoogleCodeExporter commented 9 years ago
is there any progress on this? it seems like a pretty clear-cut 
reauthentication issue. If the video takes too long to upload, the original 
session times-out or becomes stale. Shouldn't the server pause the upload and 
reauthenticate? or can the client reauthenticate after N minutes? googleCL is 
pretty worthless to me if I can't automate youtube uploads for big projects.

Original comment by sjoub...@gmail.com on 1 Sep 2010 at 1:07

GoogleCodeExporter commented 9 years ago
I'm experiencing this as well.  Same conditions, large files fail, small ones 
succeed.

Original comment by bill.p...@gmail.com on 12 Oct 2010 at 11:56

GoogleCodeExporter commented 9 years ago
I've filed a new issue here: 
http://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=2304

this problem seems to extend past the python client library, so that's the 
appropriate place for this issue.

Please post on the new issue with any relevant details you can think of -- 
video size, type of video, OS, whatever. Headers from the initial POST message 
and final server response might help.

Original comment by thmil...@google.com on 1 Nov 2010 at 6:04

GoogleCodeExporter commented 9 years ago
The same for me. :-((((

Original comment by lukas.zapletal on 9 Apr 2011 at 12:02

GoogleCodeExporter commented 9 years ago

Original comment by afs...@google.com on 7 Oct 2011 at 12:01

GoogleCodeExporter commented 9 years ago
Another solution would be to upload in chunks using the Resumable Uploader with 
the client/data and YouTube API 2.0. I see this is not yet implemented in the 
library.

Original comment by afs...@google.com on 21 Dec 2011 at 10:34