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

How to fix SRT.session.error ?? #23

Open
daje0601 opened this issue Aug 29, 2024 · 2 comments
Open

How to fix SRT.session.error ?? #23

daje0601 opened this issue Aug 29, 2024 · 2 comments

Comments

@daje0601
Copy link

Notification mail sent successfully.
Error:
Traceback (most recent call last):
  File "/Users/.../Documents/k-trains/reserve.py", line 93, in get_trains
    trains = ktrains.search_train(dep, arr, date, time, available_only=False)
  File "/Users/.../Documents/k-trains/ktrains/srt/srt.py", line 231, in search_train
    raise SRTResponseError(parser.message())
ktrains.srt.errors.SRTResponseError: 사용자가 많아 접속이 원활하지 않습니다.<br>잠시 후 다시 이용하여 주시기바랍니다.

Error occurred
Sending error message
Notification mail sent successfully.

I've only been running for about 5 minutes and I got this error.
I'm not sure if I can leave it alone or if I need to run it again, what should I do?

Also, I don't want these errors to occur, so where should I fix them?

@daje0601
Copy link
Author

Running main script!
Sending start message
Notification mail sent successfully.
Error:
Traceback (most recent call last):
  File "/Users/gangdasol/Documents/k-trains/reserve.py", line 93, in get_trains
    trains = ktrains.search_train(dep, arr, date, time, available_only=False)
  File "/Users/gangdasol/Documents/k-trains/ktrains/srt/srt.py", line 228, in search_train
    parser = SRTResponseData(r.text)
  File "/Users/.../Documents/k-trains/ktrains/srt/response_data.py", line 19, in __init__
    self._parse()
  File "/Users/.../Documents/k-trains/ktrains/srt/response_data.py", line 28, in _parse
    self._status = self._json["resultMap"][0]
KeyError: 'resultMap'

Error occurred
Sending error message
Notification mail sent successfully.

The problem is probably in the process of successfully making the booking, getting the data from the API, and parsing it.
Is it because the API specification is different? or Should I be checking other things?. I did a customisation to add the recently added SRT station.

@fedebotu
Copy link
Owner

Hi @daje0601 !
Thanks for reporting. The first message is probably due to the bot making too many requests (recently Korail + SRT updated their systems), so I guess we should update this part so that the block is not triggered.

About the second: my guess is that we should update the code to use the update SRT API code: https://github.com/ryanking13/SRT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants