Giter Club home page Giter Club logo

korail2's Issues

Support Python3

Support Python3.
Now, setup.py is describing python3 supported.
But it is wrong. Need to enhance.

Search for all day.

search_train() 의 출력결과는 지정한 시간이후로 10개씩인데,
하루 전체를 반복해서 검색해 올 필요가 있음

혹시 PyPI에 버전업해서 올려주실 수 있을까요?

먼저 바쁘신 와중에 죄송합니다!

PyPI에 패키지를 최신 버전으로 올려주십사 부탁드리고 싶습니다.

파이썬3를 사용하는 프로젝트에 이 패키지를 사용하고 있는데 PyPI에는 아직 업데이트가 안 된 것 같습니다. 지금은 직접 빌드해서 사용하고 있지만 배포할 때 PyPI에 버전이 있으면 정말 편리할 것 같습니다. 혹시 시간이 가능하실 때 올려주실 수 있을까요?

로그인 오류

안녕하세요, 바쁘신 와중에 요청드릴 부분이 있어 이슈를 생성합니다.
로그인 시 오류가 나 Postman으로 확인해보니 다음과 같은 메세지와 함께 로그인이 진행되지 않네요.
혹시 업데이트가 가능할까요?
Screenshot 2023-05-17 at 9 13 35 PM

`Korail` 클래스의 `_session` 변수가 인스턴스 변수로 선언되어야 할 것 같습니다.

현재 Korail 클래스의 선언입니다.

class Korail(object):
    _session = requests.session()
    def __init__(self, korail_id, korail_pw, auto_login=True, want_feedback=False):
        self.korail_id = korail_id
        ...

이렇게 _session이 클래스 변수로 선언되어 있어 서로 다른 객체가 같은 세션을 공유하게 됩니다.
이는 실제 로그인 되어있는 사용자의 아이디와 Korail 객체의 korail_id 필드가 다른 상황을 초래합니다.

k1 = Korail(USERID_1, PASSWD_1)
k2 = Korail(USERID_2, PASSWD_2)  # k1과 k2의 _session은 동일한 객체라 USERID_2로 다시 로그인합니다.

k1.reserve(train)  # USERID_1이 기차를 예매할 것이 예상되지만 실제로는 USERID_2가 예매하게 됩니다.

그래서 _session을 인스턴스 변수로 옮기는게 좋을 것 같은데 어떤가요?

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

오랫동안 잘 써왔는데, 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)

로그인 실패 에러

현재 로그인 단계에서 자꾸 False 가 나고 있습니다. 아이디 2개로 검증해도 똑같습니다. 다른 분은 잘 작동하나요? 아니라면 어떤 문제일까요?

Time에서의 정확한 내부 동작 구조

안녕하세요.
먼저, 이 라이브러리를 만들어주셔서 너무 고맙습니다.
너무 잘 쓰고 있어요.

다름이 아니라, search_train 에서 time 을 140000 으로 입력하면 어떤 시간대의 기차들이 잡히는지 알고 싶어서요.

주말 혹은 명절날에는 거의 안잡히고.. 여유 좌석이 있으면 금방 잡히더라구요.

만약 time 부분에 140000 을 입력하게 되면 14:00:00시부터 1초마다 1값이 증가하면서 예약 가능한 열차를 확인하나요 ??

코드를 봐도 전혀 이해가 안되네요 ㅠ

NoResultsError 에러 발생 특정날짜 (아마도 연휴기간)

>>> print(korail.search_train('광명', '동대구', '20200129')[0])
[KTX-산천] 1월 29일, 광명~동대구(15:26~16:58) 특실,일반실 41,300원 5%적립

>>> print(korail.search_train('광명', '동대구', '20200122')[0])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "korail2/korail2.py", line 788, in search_train
    raise NoResultsError()
korail2.korail2.NoResultsError: No Results (None)

특정날짜 1월 22~25일까지에는
NoResultsError 가 발생하는데, 아마 연휴 기간이라서 발생하는 에러 같습니다.

아직까지 코레일톡 공식앱에서는 잘 조회되는걸로는 보입니다.

Result 클래스 리팩토링

  1. Result의 일부만 취하는 형태에서, Result를 그대로 갖고, Accessor를 구현하는 형태로 리팩토링
  2. Result간 상속관계 확립.

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.