Merge branch 'master' into gutenberg2

gut2-dev
eric 2019-06-07 15:13:58 -04:00
commit 11f755ca52
2 changed files with 6 additions and 1 deletions

View File

@ -218,8 +218,12 @@ class CloudStorage (object):
url = session.ebook.get_source_url () url = session.ebook.get_source_url ()
# Caveat: use requests.get, not session.get, because it is an insecure # Caveat: use requests.get, not session.get, because it is an insecure
# transport. session.get would raise InsecureTransportError # transport. session.get would raise InsecureTransportError
# turn off server encoding since we're going to re-stream the bytes
return requests.get ( return requests.get (
url, headers = { 'user-agent': self.user_agent }, stream = True) url,
headers = {'user-agent': self.user_agent, 'accept-encoding': ''},
stream = True
)
def fix_filename (self, filename): def fix_filename (self, filename):

View File

@ -50,6 +50,7 @@ class XMLishFormatter (BaseFormatter.BaseFormatter):
def fix_dc (self, dc, os): def fix_dc (self, dc, os):
""" Tweak dc. """ """ Tweak dc. """
def has_std_path (file_obj): def has_std_path (file_obj):
''' so cloudstorage links can be elided when the url is non-standard'''
if file_obj.filetype == 'pdf': if file_obj.filetype == 'pdf':
return STD_PDF_MATCH.search (file_obj.url) return STD_PDF_MATCH.search (file_obj.url)
return True return True