Function to download builtin recipes from new server

This commit is contained in:
Kovid Goyal 2015-01-06 21:09:41 +05:30
parent fee978759a
commit f5bc132d2a

View File

@ -207,6 +207,11 @@ def download_builtin_recipe(urn):
from calibre.utils.https import get_https_resource_securely
return get_https_resource_securely('https://status.calibre-ebook.com/recipe/'+urn)
def download_builtin_recipe2(urn):
from calibre.utils.https import get_https_resource_securely
import bz2
return bz2.decompress(get_https_resource_securely('https://code.calibre-ebook.com/recipe-compressed/'+urn))
def get_builtin_recipe(urn):
with zipfile.ZipFile(P('builtin_recipes.zip', allow_user_override=False), 'r') as zf:
return zf.read(urn+'.recipe')