Skip to content

Commit

Permalink
* fix(product_details.py): ensure image_url ends with .jpg or .png ex…
Browse files Browse the repository at this point in the history
…tension if not already present
  • Loading branch information
DanielWTE committed Dec 31, 2024
1 parent fd8679b commit fee85a5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scraper/product_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def process_image_url(image_url: str) -> str:
base_url = image_url.split('_thumbnail_')[0]
if base_url.startswith('//'):
base_url = 'https:' + base_url
if not any(base_url.endswith(ext) for ext in ('.jpg', '.png')):
base_url += '.jpg'
return base_url

@with_captcha_check
Expand Down

0 comments on commit fee85a5

Please sign in to comment.