车次支持大小写
This commit is contained in:
@@ -71,7 +71,7 @@ class Cdn:
|
||||
CommonLog.add_quick_log(CommonLog.MESSAGE_CDN_START_TO_CHECK.format(len(self.items))).flush()
|
||||
self.restore_items()
|
||||
for i in range(self.thread_num): # 多线程
|
||||
create_thread_and_run(jobs=self, callback_name='check_available', wait=Const.IS_TEST)
|
||||
create_thread_and_run(jobs=self, callback_name='check_available', wait=False)
|
||||
|
||||
def load_items(self):
|
||||
with open(Config().CDN_ITEM_FILE, encoding='utf-8') as f:
|
||||
@@ -149,7 +149,7 @@ class Cdn:
|
||||
CommonLog.add_quick_log(
|
||||
CommonLog.MESSAGE_CDN_START_TO_RECHECK.format(len(self.items), time_now())).flush()
|
||||
for i in range(self.thread_num): # 多线程
|
||||
create_thread_and_run(jobs=self, callback_name='check_available', wait=Const.IS_TEST)
|
||||
create_thread_and_run(jobs=self, callback_name='check_available', wait=False)
|
||||
stay_second(self.retry_num)
|
||||
|
||||
def destroy(self):
|
||||
|
||||
@@ -26,7 +26,7 @@ class QueryLog(BaseLog):
|
||||
LOG_INIT_JOBS = ''
|
||||
|
||||
MESSAGE_GIVE_UP_CHANCE_CAUSE_TICKET_NUM_LESS_THAN_SPECIFIED = '余票数小于乘车人数,放弃此次提交机会'
|
||||
MESSAGE_QUERY_LOG_OF_EVERY_TRAIN = '{}-{}'
|
||||
MESSAGE_QUERY_LOG_OF_EVERY_TRAIN = '{}'
|
||||
MESSAGE_QUERY_LOG_OF_TRAIN_INFO = '{} {}'
|
||||
MESSAGE_QUERY_START_BY_DATE = '出发日期 {}: {} - {}'
|
||||
|
||||
|
||||
@@ -103,8 +103,8 @@ class Job:
|
||||
tmp_start_time = time.time()
|
||||
response = self.query_by_date(date)
|
||||
tmp_end_time = time.time() # 耗时
|
||||
QueryLog.add_query_time_log(tmp_start_time, tmp_end_time, is_cdn=self.is_cdn)
|
||||
self.handle_response(response)
|
||||
QueryLog.add_query_time_log(tmp_start_time, tmp_end_time, is_cdn=self.is_cdn)
|
||||
if not self.is_alive: return
|
||||
self.safe_stay()
|
||||
if is_main_thread():
|
||||
@@ -233,7 +233,7 @@ class Job:
|
||||
|
||||
def is_trains_number_valid(self, ticket_info):
|
||||
if self.allow_train_numbers:
|
||||
return self.get_info_of_train_number() in self.allow_train_numbers
|
||||
return self.get_info_of_train_number().upper() in map(str.upper, self.allow_train_numbers)
|
||||
return True
|
||||
|
||||
def is_member_number_valid(self, seat):
|
||||
|
||||
Reference in New Issue
Block a user