class AISWorker(QThread):
ui_text_signal = pyqtSignal(str, str)
ui_color_signal = pyqtSignal(str, str)
def __init__(self):
super().__init__()
self.api = MarineTrafficApi(api_key="deleted for privacy reason")
# time_span = The maximum age, in minutes, of the returned positions.
# Maximum value for terrestrial coverage is 60.
# Maximum value for satellite coverage is 180.
self.vessel = self.api.single_vessel_positions(time_span=20, mmsi=441577000)
# Mega Trust mmsi = 441577000
MarineTrafficApi.print_params_for('single_vessel_positions')
self.vessel = self.vessel.models[0]
self.alive = True
I executed this code and get this result :
self.vessel = self.vessel.models[0]
IndexError: list index out of range
Hello.
I followed simple example code on your website : https://pypi.org/project/Marine-Traffic-API/
I executed this code and get this result :
self.vessel = self.vessel.models[0] IndexError: list index out of range