From cbe19ea6066a600cbd0b5110db5d43f8252d14a8 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期四, 13 六月 2024 11:23:53 +0800 Subject: [PATCH] L撤成交进度相关改进 --- third_data/kpl_api.py | 23 +++++++++++------------ 1 files changed, 11 insertions(+), 12 deletions(-) diff --git a/third_data/kpl_api.py b/third_data/kpl_api.py index a616eb9..83b1ddb 100644 --- a/third_data/kpl_api.py +++ b/third_data/kpl_api.py @@ -19,7 +19,7 @@ DABAN_TYPE_EVER_LIMIT_DOWN = 5 -def __base_request(url, data, timeout=60): +def __base_request(url, data, timeout=10): DELEGATE = True if not DELEGATE: headers = { @@ -49,7 +49,6 @@ def __getLimitUpInfo(pidType, page, pageSize): data = f"Order=0&a=DailyLimitPerformance&st={pageSize}&apiv=w35&Type=4&c=HomeDingPan&PhoneOSNew=1&DeviceID=a38adabd-99ef-3116-8bb9-6d893c846e24&VerSion=5.13.0.0&Index={(page - 1) * pageSize}&PidType={pidType}&" result = __base_request("https://apphq.longhuvip.com/w1/api/index.php", data=data) - print(result) return result @@ -61,12 +60,10 @@ for i in range(100): start_time = time.time() result = __getLimitUpInfo(pid_info[0], i + 1, 20) - print("璇锋眰鐢ㄦ椂", time.time() - start_time) result = json.loads(result) datas = result["info"][0] results.extend(datas) day = result["info"][1] - print(datas) if len(datas) < 20: break for r in results: @@ -213,17 +210,19 @@ blocks = [] try: _bks = __getConceptJXBK(code) + print(_bks) if _bks: blocks.extend(_bks) except: pass - - try: - _bks = __getConceptBK(code) - if _bks: - blocks.extend(_bks) - except: - pass + if not blocks: + try: + _bks = __getConceptBK(code) + print(_bks) + if _bks: + blocks.extend(_bks) + except: + pass return list(set(blocks)) @@ -259,4 +258,4 @@ if __name__ == "__main__": - print(getCodeBlocks("600822")) + print(getZYLTAmount("300198")) -- Gitblit v1.8.0