예제 #1
0
 def download_file(self, doc):
     url = doc.get('URL')
     if not url:
         return
     if url.startswith('data'):
         return download_file_from_encoded_str(url)
     else:
         return download_file_from_url(url)
예제 #2
0
 def download_file(self, doc):
     url = doc.get('URL')
     if not url:
         return
     if url.startswith('data'):
         return download_file_from_encoded_str(url)
     else:
         return download_file_from_url(url)
 def fetch_rendition(self, rendition):
     stream, name, mime = download_file_from_url(rendition.get("href"))
     return stream