holoviz-topics / examples

Visualization-focused examples using HoloViz for specific topics
https://examples.holoviz.org
Creative Commons Attribution 4.0 International
84 stars 25 forks source link

[BUG: ship_traffic] Access to images on marinetraffic is restricted #401

Open droumis opened 5 months ago

droumis commented 5 months ago

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).

image

And if I manually navigate to the correct image on their website (https://images.marinetraffic.com/collection/4924194.webp?size=800),

image

... I cannote access it programmatically:

response = requests.get(url, stream=True) # 403
jlstevens commented 5 months ago

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?

droumis commented 5 months ago

@jbednar just to make you aware