Skip to content

Commit

Permalink
Fixed URL images without 'http'
Browse files Browse the repository at this point in the history
  • Loading branch information
andresmlna committed Nov 15, 2017
1 parent c74b43c commit 24d0235
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions kp3/periodical.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <img> URL HTML tag.
response = urllib.request.urlopen(img.attrs['src'])
img_data = response.read()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -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',
Expand Down

0 comments on commit 24d0235

Please sign in to comment.