[BUG: ship_traffic] Access to images on marinetraffic is restricted
Cannot get the ship_id as usual from mmsi value (e.g. 369540000):
ship_url = 'https://tinyurl.com/aispage/mmsi:'
headers = {'User-Agent': 'Mozilla/5.0'}
r=requests.get(f'{ship_url}{mmsi}', allow_redirects=True, headers=headers) # r returns 403
ship_id = [el for el in r.url.split('/') if el.startswith('shipid')]
If I manually fetch the ship id manually from the marinetraffic.com website, I cannot get the real image from the current url approach, it's just a placeholder: (https://photos.marinetraffic.com/ais/showphoto.aspx?shipid=4924194&size=thumb300&stamp=false).
And if I manually navigate to the correct image on their website (https://images.marinetraffic.com/collection/4924194.webp?size=800),
... I cannote access it programmatically:
response = requests.get(url, stream=True) # 403
I'm not too surprised that marinetraffic.com has changed things around: this was intended to just be a demo and was never a supported API. Looks like you have tried some ideas for workarounds without success...
Maybe there is another online catalog of ships we can get photos for by MMSI?
@jbednar just to make you aware