diff --git a/feediverse.py b/feediverse.py index e56ac82..f3836a7 100755 --- a/feediverse.py +++ b/feediverse.py @@ -164,14 +164,18 @@ def collect_images(entry, generator=None): for u in urls) images = [] for url in urls: - resp = http.request('GET', url, preload_content=False) - if resp.headers['content-type'].startswith(("image/", "video/")): - images.append(resp) - # IMPORTANT: Need to release_conn() later! - if len(images) >= MAX_IMAGES: - break - else: - resp.release_conn() + try: + resp = http.request('GET', url, preload_content=False) + if resp.headers['content-type'].startswith(("image/", "video/")): + images.append(resp) + # IMPORTANT: Need to release_conn() later! + if len(images) >= MAX_IMAGES: + break + else: + resp.release_conn() + except urllib3.exceptions.HTTPError: + # ignore http errors, maybe they should be logged? + pass return images diff --git a/setup.py b/setup.py index fcd76d9..d5e8b5c 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open("README.md") as f: setup( name='feediverse', - version='0.1.3', + version='0.1.4', python_requires='>=3.3', url='https://github.com/edsu/feediverse', author='Ed Summers',