From 24d023513f04fa5567aad6e3fcd0054bfef9fdef Mon Sep 17 00:00:00 2001 From: andresmlna Date: Wed, 15 Nov 2017 16:08:29 -0300 Subject: [PATCH] Fixed URL images without 'http' --- kp3/periodical.py | 3 +++ setup.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/kp3/periodical.py b/kp3/periodical.py index ec9db2f..f15b2b1 100755 --- a/kp3/periodical.py +++ b/kp3/periodical.py @@ -123,6 +123,9 @@ def __articles_images(self, item_id, html_content): img_count += 1 try: + # Only for URL without 'http:' + if str(img.attrs['src'])[:2] == '//': + img.attrs['src'] = 'http:' + img.attrs['src'] # Download image from URL HTML tag. response = urllib.request.urlopen(img.attrs['src']) img_data = response.read() diff --git a/setup.py b/setup.py index 2dbb174..ea2f011 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup setup(name='kp3', - version='0.3', + version='0.4', description='A kindle periodical util writen in python 3 for generating kindle .mobi files in periodical style.', url='https://github.com/andresmlna/kindle-periodical', author='Andrés Molina',