diff --git a/pythonforandroid/recipe.py b/pythonforandroid/recipe.py index f07a412fbf..ecea95a55c 100644 --- a/pythonforandroid/recipe.py +++ b/pythonforandroid/recipe.py @@ -9,6 +9,7 @@ import sh import shutil import fnmatch +import urllib from urllib.request import urlretrieve from os import listdir, unlink, environ, mkdir, curdir, walk from sys import stdout @@ -23,6 +24,12 @@ from pythonforandroid.util import load_source as import_recipe +# jqueryui.com returns a 403 w/ the default user agent +url_opener = urllib.request.build_opener() +url_opener.addheaders = [('User-agent', 'Mozilla/5.0')] +urllib.request.install_opener(url_opener) + + class RecipeMeta(type): def __new__(cls, name, bases, dct): if name != 'Recipe':