diff --git a/freshpaper.py b/freshpaper.py index 1996471..e652def 100644 --- a/freshpaper.py +++ b/freshpaper.py @@ -273,14 +273,14 @@ def download_image_nat_geo(download_dir, image_extension="jpg"): raise ConnectionError html = request.read().decode("utf-8") - url_regex = r"twitter:image:src\" content=\"(.*)\"" + url_regex = r"twitter:image:src\" content=\"(.*?)\"" image_url = re.findall(url_regex, html)[0] if not image_url: log.info("No National Geographic image of the day available.\n") return None - image_name_regex = r"json\":{\"title\":\"(.*)\"" + image_name_regex = r"(.*?)" image_name = re.findall(image_name_regex, html)[0] try: