My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 356: 500, "Internal Server Error" when uploading a video.
3 people starred this issue and may be notified of changes. Back to list
Status:  Accepted
Owner:  ----


Sign in to add a comment
 
Reported by aron.jo...@gmail.com, Apr 26, 2010
What steps will reproduce the problem?
1. Run this code: (mostly strait from the Getting Started guide)

import gdata.youtube
import gdata.youtube.service
import gdata.service
import gdata.media

from django.conf import settings


yt_service = gdata.youtube.service.YouTubeService()

yt_service.email = settings.G_ACCOUNT_EMAL
yt_service.password = settings.G_ACCOUNT_PASSWORD
yt_service.source = settings.YT_CLIENT_ID
yt_service.developer_key = settings.YT_DEV_KEY
yt_service.client_id = settings.YT_CLIENT_ID

yt_service.ProgrammaticLogin()


def upload_to_youtube(video_file, title='Untitled', desc='', tags=list()):
    my_media_group = gdata.media.Group(
        title=gdata.media.Title(text=title),
        description=gdata.media.Description(description_type='plain', 
text=desc),
        category=[gdata.media.Category(
            text='Autos',
            scheme='http://gdata.youtube.com/schemas/2007/categories.cat',
            label='Autos')],
        player=None
    )
    
    video_entry = gdata.youtube.YouTubeVideoEntry(media=my_media_group)
    video_entry.AddDeveloperTags(['mazava'])
    
    new_entry = yt_service.InsertVideoEntry(video_entry, video_file)
    
    return new_entry.GetMediaURL()


What is the expected output? What do you see instead?
Traceback:
File "/django/core/handlers/base.py" in get_response
  100.                     response = callback(request, *callback_args, 
**callback_kwargs)
File "/django/contrib/auth/decorators.py" in _wrapped_view
  25.                 return view_func(request, *args, **kwargs)
File "/code-za/apps/proposals/views.py" in new
  81.                     title=proposal.title)
File "/code-za/apps/core/youtube.py" in upload_to_youtube
  40.     new_entry = yt_service.InsertVideoEntry(video_entry, video_file, 
'mazavaexchange')
File "/code-za/lib/gdata/youtube/service.py" in InsertVideoEntry
  656.         raise YouTubeError(e.args[0])

Exception Type: YouTubeError at /proposals/new/
Exception Value: {'status': 500, 'body': 'Internal Error', 'reason': 
'Internal Server Error'}

What version of the product are you using?
gdata-python-client 2.0.9
python 2.6

May 31, 2010
Project Member #1 tom.h.mi...@gmail.com
I just started seeing this as well - the problem is passing an empty string or 
NoneType in for the description. So change

my_media_group = gdata.media.Group(
        title=gdata.media.Title(text=title),
        description=gdata.media.Description(description_type='plain', 
text=desc),

to

my_media_group = gdata.media.Group(
        title=gdata.media.Title(text=title),
        description=gdata.media.Description(description_type='plain', 
text=desc or 'No description'),

Of course, a server-side fix would be nice too...
Oct 7, 2011
Project Member #2 afs...@google.com
(No comment was entered for this change.)
Status: Accepted
Labels: Component-YouTube
Sign in to add a comment

Powered by Google Project Hosting