Skip to content

Commit

Permalink
Faz a busca do vídeo de acordo com o título
Browse files Browse the repository at this point in the history
  • Loading branch information
berinhard committed Oct 16, 2010
1 parent 05b3077 commit e6bb381
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions youtube_search/views.py
Expand Up @@ -22,7 +22,7 @@ def do_search(request):


form = SearchForm(request.POST) form = SearchForm(request.POST)
if form.is_valid(): if form.is_valid():
search_term = form.cleaned_data['full_text'] + ' cover' search_term = u'allintitle:%s cover' % form.cleaned_data['full_text']
results = __search_videos(search_term) results = __search_videos(search_term)


context = RequestContext(request, {'videos':results, 'form':form}) context = RequestContext(request, {'videos':results, 'form':form})
Expand All @@ -45,7 +45,6 @@ def __search_videos(search_terms):
yt_service.developer_key = DEVELOPER_KEY yt_service.developer_key = DEVELOPER_KEY
yt_service.client_id = CLIENT_ID yt_service.client_id = CLIENT_ID


yt_service = gdata.youtube.service.YouTubeService()
query = gdata.youtube.service.YouTubeVideoQuery() query = gdata.youtube.service.YouTubeVideoQuery()
query.vq = search_terms query.vq = search_terms
query.orderby = 'viewCount' query.orderby = 'viewCount'
Expand Down

0 comments on commit e6bb381

Please sign in to comment.