Skip to content

Commit

Permalink
a fix for failed downloads during imagereel generation
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnmjones committed Jun 5, 2020
1 parent 30eef5f commit a0206ca
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = '0.2020.05.08.220018'
release = '0.2020.06.05.214724'


# -- General configuration ---------------------------------------------------
Expand Down
10 changes: 9 additions & 1 deletion mementoembed/mementoimagereel.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,15 @@ def generate_imagereel(self, urim, duration, countlimit, requested_width, reques

for imageuri in [ i[1] for i in sorted(scorelist, reverse=True) ]:

r = self.httpcache.get(imageuri)
try:

r = self.httpcache.get(imageuri)

except Exception:

module_logger.exception("failed to download image at {}, skipping".format(imageuri))
continue

ifp = io.BytesIO(r.content)

baseims.append(
Expand Down
6 changes: 6 additions & 0 deletions mementoembed/textprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ class SnippetGenerationError(TextProcessingError):

def get_text_without_boilerplate(htmlcontent):

# Note: this boilerplate method did not work for archive.is

# from boilerpy3 import extractors
# extractor = extractors.ArticleExtractor()
# bpfree = extractor.get_content(htmlcontent)
# return bpfree
# htmlcontent = htmlcontent.replace('\n', ' ')

try:
Expand Down
2 changes: 1 addition & 1 deletion mementoembed/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__appname__ = "MementoEmbed"
__appversion__ = '0.2020.05.08.220018'
__appversion__ = '0.2020.06.05.214724'
__useragent__ = "{}/{}".format(__appname__, __appversion__)

0 comments on commit a0206ca

Please sign in to comment.