Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
droumis opened this issue Jun 26, 2024 · 2 comments
Open

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

droumis opened this issue Jun 26, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@droumis
Copy link
Contributor

droumis commented Jun 26, 2024

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
Copy link
Contributor

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
Copy link
Contributor Author

droumis commented Jun 28, 2024

@jbednar just to make you aware

@maximlt maximlt added the bug Something isn't working label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants