mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Function to download builtin recipes from new server
This commit is contained in:
parent
fee978759a
commit
f5bc132d2a
@ -207,6 +207,11 @@ def download_builtin_recipe(urn):
|
|||||||
from calibre.utils.https import get_https_resource_securely
|
from calibre.utils.https import get_https_resource_securely
|
||||||
return get_https_resource_securely('https://status.calibre-ebook.com/recipe/'+urn)
|
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):
|
def get_builtin_recipe(urn):
|
||||||
with zipfile.ZipFile(P('builtin_recipes.zip', allow_user_override=False), 'r') as zf:
|
with zipfile.ZipFile(P('builtin_recipes.zip', allow_user_override=False), 'r') as zf:
|
||||||
return zf.read(urn+'.recipe')
|
return zf.read(urn+'.recipe')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user