Giter Club home page Giter Club logo

Comments (1)

frogbam avatar frogbam commented on September 14, 2024 4

오랫동안 잘 써왔는데, korail api가 버전업이 되었는지 다음과 같은 에러가 나오네요ㅠ

KorailError                               Traceback (most recent call last)
~/Dropbox/Programming/Workspace/korail.py in <module>
     24         try:
---> 25             trains = korail.search_train(dep, arr, date, depart_time, include_no_seats=True, passengers=psgrs)
     26             #print(trains)

~/anaconda3/lib/python3.7/site-packages/korail2/korail2.py in search_train(self, dep, arr, date, time, train_type, passengers, include_no_seats)
    774
--> 775         if self._result_check(j):
    776             train_infos = j['trn_infos']['trn_info']

~/anaconda3/lib/python3.7/site-packages/korail2/korail2.py in _result_check(self, j)
    620             else:
--> 621                 raise KorailError(h_msg_txt, h_msg_cd)
    622         else:

KorailError: 최신버전으로 업데이트하신 후 이용하여 주십시오. (SUPDATE)

데이터를 api서버에 보낼때 버전도 같이 보내는데 최근에 api를 업데이트하면서 특정 버전 이하는 "최신버전으로 업데이트하신 후 이용하여 주십시오. (SUPDATE)" 이 오류를 내는거 같습니다.
근데 이게 로그인 응답은 또 최신버전으로 바꾸면 오히려 오류를 냅니다.
이점만 유의하면 바로 느낌이 오실겁니다.

다음은 제가 해결한 방법입니다.
korail2.py의 Korail 클래스안의

_device = 'AD'
_version = '190617001' //기존값 '150718001'
_key = 'korail1234567890' //기존값이 아마 korail01234567890이였을 겁니다.

값을 이렇게 바꾸시고
같은 파일의 login 함수의

'Device': self._device,
'Version':'150718001',   //기존값 self._version

값을 이렇게 바꾸니 해결되었습니다.

이렇게 수정하니 search_train, login, reserve 함수는 잘 작동했습니다.
다른 함수들은 확인은 안해봤으나 잘 되리라 봅니다.

from korail2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.