Reputation: 171
So im working on an app which is supposed to query youtube and get a list of videos. I cannot use the google data api v3 because I have python 3.4.
My question is if there is a way to speed the response from the server as the application hangs for a good minute before the server sends a response. When I type the url into any browser though it works near instantaneously. I have already tried setting the headers to see if google was throttling requests that were coming from a server but with no luck. When I run the exact same query on any other website using python, the response is fast as well. Here is my current code.
header = {'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.99 Safari/537.36','accept':'text/html,application/xhtml+xml,application/xml',}
url="http://gdata.youtube.com/feeds/api/videos?q="+str(quote(songName))+"&max-results=10&v=2"
parser = etree.XMLParser(remove_blank_text=True)
page=urllib.request.urlretrieve(url)
Upvotes: 1
Views: 237
Reputation: 171
Turns out it was google's api that was just slow when I was testing my code.
Upvotes: 1