Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name='tensorpy',
version='1.0.8',
version='1.0.9',
url='http://tensorpy.com',
author='Michael Mintz',
author_email='@mintzworld',
Expand Down
6 changes: 3 additions & 3 deletions tensorpy/image_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ def get_all_images_on_page(page_url):
image_url_list = []
for img in imgs:
link = img["src"].split("src=")[-1]
link = link.split('?')[0]
if (link.endswith('.png') or link.endswith('.jpg') or
link.endswith('.jpeg')):
compact_link = link.split('?')[0]
if (compact_link.endswith('.png') or compact_link.endswith('.jpg') or
compact_link.endswith('.jpeg')):
if not link.startswith("http"):
if ":" not in link:
link = full_base_url + link
Expand Down
2 changes: 1 addition & 1 deletion tensorpy/web_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def rebuild_source(source, full_base_url):
def get_content_type(url):
content = requests.get(url)
content_type = content.headers['Content-Type']
if 'text/html' in content_type:
if 'html' in content_type:
return 'html'
elif 'image/jpeg' in content_type or 'image/png' in content_type:
return 'image'
Expand Down