Skip to content

Commit

Permalink
add non-alm subsite handling
Browse files Browse the repository at this point in the history
  • Loading branch information
feederbox826 committed Sep 30, 2024
1 parent edf6f40 commit fc08318
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scrapers/Teamskeet/TeamskeetAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ def try_img_replacement(imgurl):
if (try_url(newurl)):
return newurl
# try shared/hi on /tour url
tourHi = imgurl.replace('/alm', '/alm/tour/pics').replace('shared/med', 'shared/hi')
# get the subsite name
subsite = imgurl.split("/")[4]
# replace with /tour/pics
tourHi = imgurl.replace(f"/{subsite}", f"/{subsite}/tour/pics").replace('shared/med', 'shared/hi')
if (try_url(tourHi)):
return tourHi
# fallback to original image
Expand Down

0 comments on commit fc08318

Please sign in to comment.