django-youtube icon indicating copy to clipboard operation
django-youtube copied to clipboard

fetch_feed_by_username giving error: 'YouTubeVideoEntry' object has no attribute 'video_id'

Open ghost opened this issue 11 years ago • 2 comments

Here's my effort:

def video_list(request, username=None):

   # trying to lists all user uploaded videos in my channel 

 # If user is not authenticated and username is None, raise an error
if username is None and not request.user.is_authenticated():

    from django.http import HttpResponse
    return HttpResponse404

# loop through the videos of the user
api = Api()
api.authenticate()    
videos = api.fetch_feed_by_username (username='mychannelname')
video_params = []

for video in videos.entry:   # omitting entry gives error "...object not iterable"        
    video_params.append(_video_params(request, video.video_id))

return render_to_response(
    "django_youtube/videos.html",
    {"video_params": video_params},
    context_instance=RequestContext(request)
)

what could I be doing wrong?

ghost avatar May 27 '13 00:05 ghost

It seems that the problem is in fetch_feed_by_username api method. I'll try to fix it whenever I can.

laplacesdemon avatar May 27 '13 09:05 laplacesdemon

shot Lap. Thanks

ghost avatar May 27 '13 10:05 ghost