mns-common 1.3.9.9__tar.gz → 1.4.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/PKG-INFO +1 -1
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/akshare/stock_bid_ask_api.py +11 -11
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/em/real_time/east_money_stock_a_api.py +25 -24
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/em/real_time/east_money_stock_a_v2_api.py +3 -3
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/kpl/symbol/symbol_his_quotes_api.py +1 -1
- mns_common-1.4.0.1/mns_common/component/proxies/proxy_common_api.py +156 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common.egg-info/PKG-INFO +1 -1
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/setup.py +1 -1
- mns_common-1.3.9.9/mns_common/component/proxies/proxy_common_api.py +0 -192
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/README.md +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/akshare/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/akshare/k_line_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/akshare/stock_dt_pool.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/akshare/stock_zb_pool.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/akshare/stock_zt_pool_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/akshare/yjyg_sync_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/em/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/em/concept/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/em/concept/em_concept_index_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/em/gd/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/em/gd/east_money_stock_gdfx_free_top_10_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/em/real_time/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/em/real_time/east_money_debt_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/em/real_time/east_money_etf_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/em/real_time/east_money_stock_hk_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/em/real_time/east_money_stock_us_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/hk/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/hk/ths_hk_company_info_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/k_line/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/k_line/stock_k_line_data_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/k_line/stock_minute_data_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/kpl/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/kpl/common/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/kpl/common/kpl_common_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/kpl/common/kpl_common_field_constant.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/kpl/concept/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/kpl/concept/kpl_concept_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/kpl/constant/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/kpl/constant/kpl_constant.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/kpl/industry/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/kpl/industry/kpl_industry_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/kpl/selection/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/kpl/selection/kpl_selection_plate_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/kpl/symbol/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/kpl/symbol/kpl_real_time_quotes_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/kpl/symbol/kpl_symbol_common_field_constant.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/msg/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/msg/push_msg_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/proxies/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/proxies/liu_guan_proxy_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/qmt/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/qmt/qmt_minunte_tick_data.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/big_deal/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/big_deal/ths_big_deal_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/company/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/company/ths_company_announce_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/company/ths_company_info_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/concept/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/concept/app/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/concept/app/ths_concept_detail_app.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/concept/app/ths_concept_index_app.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/concept/web/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/concept/web/ths_common_js_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/concept/web/ths_company_info_web.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/concept/web/ths_concept_detail_web.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/concept/web/ths_concept_index_web.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/self_choose/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/self_choose/ths_self_choose_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/wen_cai/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/wen_cai/ths_wen_cai_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/zt/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/zt/ths_stock_zt_pool_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/zt/ths_stock_zt_pool_v2_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/us/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/us/ths_us_company_info_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/xueqiu/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/xueqiu/xue_qiu_k_line_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/cache/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/cache/cache_service.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/classify/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/classify/symbol_classify_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/classify/symbol_classify_param.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/common_service_fun_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/company/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/company/company_common_service_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/company/company_common_service_new_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/concept/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/concept/kpl_concept_common_service_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/concept/ths_concept_common_service_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/cookie/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/cookie/cookie_info_service.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/data/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/data/data_init_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/deal/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/deal/deal_service_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/deal/terminal_enum.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/em/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/em/em_real_time_quotes_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/em/em_stock_info_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/exception/ExceptionMonitor.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/exception/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/hk/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/hk/company_hk_service_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/industry/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/industry/ths_industry_index_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/k_line/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/k_line/clean/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/k_line/clean/k_line_param.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/k_line/clean/sh_small_normal_zt_k_line_check_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/k_line/common/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/k_line/common/k_line_common_service_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/k_line/patterns/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/k_line/patterns/k_line_patterns_service_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/k_line/patterns/pattern_Enum.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/price/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/price/trade_price_service_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/proxies/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/qmt/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/qmt/qmt_buy_service.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/real_time/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/real_time/real_time_common_service_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/redis_msg/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/redis_msg/redis_msg_publish_service.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/self_choose/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/self_choose/black_list_service_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/self_choose/self_choose_service_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/task/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/task/real_time_data_sync_check.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/tfp/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/tfp/stock_tfp_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/trade_date/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/trade_date/trade_date_common_service_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/zt/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/zt/zt_common_service_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/constant/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/constant/black_list_classify_enum.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/constant/db_name_constant.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/constant/east_money_stock_api.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/constant/extra_income_db_name.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/constant/price_enum.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/constant/redis_msg_constant.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/constant/self_choose_constant.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/db/MongodbUtil.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/db/MongodbUtilLocal.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/db/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/db/v2/MongodbUtilV2.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/db/v2/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/utils/__init__.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/utils/async_fun.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/utils/cmd_util.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/utils/data_frame_util.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/utils/date_handle_util.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/utils/db_util.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/utils/file_util.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/utils/ip_util.py +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common.egg-info/SOURCES.txt +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common.egg-info/dependency_links.txt +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common.egg-info/top_level.txt +0 -0
- {mns_common-1.3.9.9 → mns_common-1.4.0.1}/setup.cfg +0 -0
|
@@ -57,25 +57,25 @@ def stock_bid_ask_em(symbol: str = "000001") -> dict:
|
|
|
57
57
|
temp_df = pd.DataFrame(tick_dict, index=[1])
|
|
58
58
|
temp_df.reset_index(inplace=True)
|
|
59
59
|
temp_df.loc[temp_df['wei_bi'] == '-', 'wei_bi'] = 0
|
|
60
|
-
temp_df.loc[temp_df['
|
|
60
|
+
temp_df.loc[temp_df['sell_5_vol'] == '-', 'sell_5_vol'] = 0
|
|
61
61
|
temp_df.loc[temp_df['sell_5'] == '-', 'sell_5'] = 0
|
|
62
|
-
temp_df.loc[temp_df['
|
|
62
|
+
temp_df.loc[temp_df['sell_4_vol'] == '-', 'sell_4_vol'] = 0
|
|
63
63
|
temp_df.loc[temp_df['sell_4'] == '-', 'sell_4'] = 0
|
|
64
|
-
temp_df.loc[temp_df['
|
|
64
|
+
temp_df.loc[temp_df['sell_3_vol'] == '-', 'sell_3_vol'] = 0
|
|
65
65
|
temp_df.loc[temp_df['sell_3'] == '-', 'sell_3'] = 0
|
|
66
|
-
temp_df.loc[temp_df['
|
|
66
|
+
temp_df.loc[temp_df['sell_2_vol'] == '-', 'sell_2_vol'] = 0
|
|
67
67
|
temp_df.loc[temp_df['sell_2'] == '-', 'sell_2'] = 0
|
|
68
|
-
temp_df.loc[temp_df['
|
|
68
|
+
temp_df.loc[temp_df['sell_1_vol'] == '-', 'sell_1_vol'] = 0
|
|
69
69
|
temp_df.loc[temp_df['sell_1'] == '-', 'sell_1'] = 0
|
|
70
|
-
temp_df.loc[temp_df['
|
|
70
|
+
temp_df.loc[temp_df['buy_1_vol'] == '-', 'buy_1_vol'] = 0
|
|
71
71
|
temp_df.loc[temp_df['buy_1'] == '-', 'buy_1'] = 0
|
|
72
|
-
temp_df.loc[temp_df['
|
|
72
|
+
temp_df.loc[temp_df['buy_2_vol'] == '-', 'buy_2_vol'] = 0
|
|
73
73
|
temp_df.loc[temp_df['buy_2'] == '-', 'buy_2'] = 0
|
|
74
|
-
temp_df.loc[temp_df['
|
|
74
|
+
temp_df.loc[temp_df['buy_3_vol'] == '-', 'buy_3_vol'] = 0
|
|
75
75
|
temp_df.loc[temp_df['buy_3'] == '-', 'buy_3'] = 0
|
|
76
|
-
temp_df.loc[temp_df['
|
|
76
|
+
temp_df.loc[temp_df['buy_4_vol'] == '-', 'buy_4_vol'] = 0
|
|
77
77
|
temp_df.loc[temp_df['buy_4'] == '-', 'buy_4'] = 0
|
|
78
|
-
temp_df.loc[temp_df['
|
|
78
|
+
temp_df.loc[temp_df['buy_5_vol'] == '-', 'buy_5_vol'] = 0
|
|
79
79
|
temp_df.loc[temp_df['buy_5'] == '-', 'buy_5'] = 0
|
|
80
80
|
temp_df['symbol'] = symbol
|
|
81
81
|
return temp_df
|
|
@@ -83,5 +83,5 @@ def stock_bid_ask_em(symbol: str = "000001") -> dict:
|
|
|
83
83
|
|
|
84
84
|
if __name__ == '__main__':
|
|
85
85
|
while True:
|
|
86
|
-
df = stock_bid_ask_em('0.
|
|
86
|
+
df = stock_bid_ask_em('0.000001')
|
|
87
87
|
print(df)
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/em/real_time/east_money_stock_a_api.py
RENAMED
|
@@ -5,7 +5,7 @@ file_path = os.path.abspath(__file__)
|
|
|
5
5
|
end = file_path.index('mns') + 16
|
|
6
6
|
project_path = file_path[0:end]
|
|
7
7
|
sys.path.append(project_path)
|
|
8
|
-
|
|
8
|
+
from mns_common.db.MongodbUtil import MongodbUtil
|
|
9
9
|
import requests
|
|
10
10
|
import json
|
|
11
11
|
import pandas as pd
|
|
@@ -14,15 +14,20 @@ import datetime
|
|
|
14
14
|
from loguru import logger
|
|
15
15
|
import mns_common.utils.data_frame_util as data_frame_util
|
|
16
16
|
|
|
17
|
+
mongodb_util = MongodbUtil('27017')
|
|
18
|
+
fields = ("f352,f2,f3,f5,f6,f8,f10,f11,f22,f12,f14,f15,f16,f17,"
|
|
19
|
+
"f18,f20,f21,f26,f33,f34,f35,f62,f66,f69,f72,f100,f184,f211,f212"),
|
|
20
|
+
fs = "m:0 t:6,m:0 t:80,m:1 t:2,m:1 t:23,m:0 t:81 s:2048"
|
|
21
|
+
|
|
17
22
|
# 最大返回条数
|
|
18
23
|
max_number = 5800
|
|
19
24
|
# 最小返回条数
|
|
20
25
|
min_number = 5600
|
|
21
26
|
# 分页条数
|
|
22
|
-
|
|
27
|
+
PAGE_SIZE = 100
|
|
23
28
|
|
|
24
29
|
|
|
25
|
-
def get_stock_page_data(pn,
|
|
30
|
+
def get_stock_page_data(pn, proxies, page_size):
|
|
26
31
|
"""
|
|
27
32
|
获取单页股票数据
|
|
28
33
|
"""
|
|
@@ -36,7 +41,7 @@ def get_stock_page_data(pn, fields, fs, proxies):
|
|
|
36
41
|
params = {
|
|
37
42
|
"cb": "jQuery1124046660442520420653_" + str(current_timestamp_ms),
|
|
38
43
|
"pn": str(pn),
|
|
39
|
-
"pz":
|
|
44
|
+
"pz": str(page_size), # 每页最大200条
|
|
40
45
|
"po": "0",
|
|
41
46
|
"np": "3",
|
|
42
47
|
"ut": "bd1d9ddb04089700cf9c27f6f7426281",
|
|
@@ -79,18 +84,18 @@ def get_stock_page_data(pn, fields, fs, proxies):
|
|
|
79
84
|
return pd.DataFrame()
|
|
80
85
|
|
|
81
86
|
|
|
82
|
-
def all_stock_ticker_data_new(
|
|
87
|
+
def all_stock_ticker_data_new(proxies) -> pd.DataFrame:
|
|
83
88
|
"""
|
|
84
89
|
使用多线程获取所有股票数据
|
|
85
90
|
"""
|
|
86
91
|
|
|
87
|
-
per_page =
|
|
92
|
+
per_page = PAGE_SIZE
|
|
88
93
|
total_pages = (max_number + per_page - 1) // per_page # 向上取整
|
|
89
94
|
|
|
90
95
|
# 创建线程池
|
|
91
96
|
with ThreadPoolExecutor(max_workers=10) as executor:
|
|
92
97
|
# 提交任务,获取每页数据
|
|
93
|
-
futures = [executor.submit(get_stock_page_data, pn,
|
|
98
|
+
futures = [executor.submit(get_stock_page_data, pn, proxies, PAGE_SIZE)
|
|
94
99
|
for pn in range(1, total_pages + 1)]
|
|
95
100
|
|
|
96
101
|
# 收集结果
|
|
@@ -108,21 +113,10 @@ def all_stock_ticker_data_new(fields, fs, proxies) -> pd.DataFrame:
|
|
|
108
113
|
|
|
109
114
|
|
|
110
115
|
def get_real_time_quotes_all_stocks(proxies):
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
page_one_df = get_stock_page_data(1, fields, fs, proxies)
|
|
116
|
-
# 数据接口正常返回5600以上的数量
|
|
117
|
-
if page_one_df.shape[0] > min_number:
|
|
118
|
-
page_one_df = rename_real_time_quotes_df(page_one_df)
|
|
119
|
-
page_one_df.drop_duplicates('symbol', keep='last', inplace=True)
|
|
120
|
-
return page_one_df
|
|
121
|
-
else:
|
|
122
|
-
page_df = all_stock_ticker_data_new(fields, fs, proxies)
|
|
123
|
-
page_df = rename_real_time_quotes_df(page_df)
|
|
124
|
-
page_df.drop_duplicates('symbol', keep='last', inplace=True)
|
|
125
|
-
return page_df
|
|
116
|
+
page_df = all_stock_ticker_data_new(proxies)
|
|
117
|
+
page_df = rename_real_time_quotes_df(page_df)
|
|
118
|
+
page_df.drop_duplicates('symbol', keep='last', inplace=True)
|
|
119
|
+
return page_df
|
|
126
120
|
|
|
127
121
|
|
|
128
122
|
# 获取所有股票实时行情数据 f33,委比
|
|
@@ -298,5 +292,12 @@ def get_sum_north_south_net_buy_amt():
|
|
|
298
292
|
# 示例调用
|
|
299
293
|
if __name__ == "__main__":
|
|
300
294
|
while True:
|
|
301
|
-
|
|
302
|
-
|
|
295
|
+
ip_proxy_pool = mongodb_util.find_all_data('ip_proxy_pool')
|
|
296
|
+
if data_frame_util.is_not_empty(ip_proxy_pool):
|
|
297
|
+
proxy_ip = list(ip_proxy_pool['ip'])[0]
|
|
298
|
+
proxy = {
|
|
299
|
+
"https": proxy_ip}
|
|
300
|
+
df = get_real_time_quotes_all_stocks(proxy)
|
|
301
|
+
logger.info("涨停数据,{}", 1)
|
|
302
|
+
else:
|
|
303
|
+
logger.error("ip为空")
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/em/real_time/east_money_stock_a_v2_api.py
RENAMED
|
@@ -288,9 +288,9 @@ def rename_real_time_quotes_df(temp_df):
|
|
|
288
288
|
|
|
289
289
|
# 示例调用
|
|
290
290
|
if __name__ == "__main__":
|
|
291
|
-
|
|
291
|
+
number = 1
|
|
292
292
|
while True:
|
|
293
293
|
df = get_all_real_time_quotes(None)
|
|
294
|
-
print(df)
|
|
295
294
|
zt_df = df.loc[df['wei_bi'] == 100]
|
|
296
|
-
logger.info("
|
|
295
|
+
logger.info("同步次数,{}", number)
|
|
296
|
+
number = number + 1
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/kpl/symbol/symbol_his_quotes_api.py
RENAMED
|
@@ -115,7 +115,7 @@ if __name__ == '__main__':
|
|
|
115
115
|
# 2021-10-25,45,0925,0955 2023-09-15,11,0925,1005
|
|
116
116
|
|
|
117
117
|
# get_stock_quotes_his('2023-09-20', 11, '0925', '1005')
|
|
118
|
-
df = sync_stock_his_quotes('
|
|
118
|
+
df = sync_stock_his_quotes('2025-04-18', '0935', '0940')
|
|
119
119
|
get_stock_count('2023-09-14', 0, '0925', '1500')
|
|
120
120
|
|
|
121
121
|
his_test('2021-10-20')
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
file_path = os.path.abspath(__file__)
|
|
5
|
+
end = file_path.index('mns') + 16
|
|
6
|
+
project_path = file_path[0:end]
|
|
7
|
+
sys.path.append(project_path)
|
|
8
|
+
|
|
9
|
+
import mns_common.api.proxies.liu_guan_proxy_api as liu_guan_proxy_api
|
|
10
|
+
import pandas as pd
|
|
11
|
+
import mns_common.utils.data_frame_util as data_frame_util
|
|
12
|
+
from mns_common.db.MongodbUtil import MongodbUtil
|
|
13
|
+
import mns_common.constant.db_name_constant as db_name_constant
|
|
14
|
+
import datetime
|
|
15
|
+
import requests
|
|
16
|
+
import time
|
|
17
|
+
from loguru import logger
|
|
18
|
+
from functools import lru_cache
|
|
19
|
+
import mns_common.api.em.real_time.east_money_stock_a_api as east_money_stock_a_api
|
|
20
|
+
import threading
|
|
21
|
+
|
|
22
|
+
mongodb_util = MongodbUtil('27017')
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def query_liu_guan_proxy_ip():
|
|
26
|
+
ip_proxy_pool = mongodb_util.find_all_data(db_name_constant.IP_PROXY_POOL)
|
|
27
|
+
return ip_proxy_pool
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def remove_proxy_ip():
|
|
31
|
+
mongodb_util.remove_data({}, db_name_constant.IP_PROXY_POOL)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def check_valid(ip_proxy_pool):
|
|
35
|
+
effect_time = list(ip_proxy_pool['effect_time'])[0]
|
|
36
|
+
|
|
37
|
+
now_date = datetime.datetime.now()
|
|
38
|
+
|
|
39
|
+
str_now_date = now_date.strftime('%Y-%m-%d %H:%M:%S')
|
|
40
|
+
|
|
41
|
+
if effect_time > str_now_date:
|
|
42
|
+
return True
|
|
43
|
+
else:
|
|
44
|
+
remove_proxy_ip()
|
|
45
|
+
return False
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@lru_cache(maxsize=None)
|
|
49
|
+
def get_account_cache():
|
|
50
|
+
query = {"type": "liu_guan_proxy", }
|
|
51
|
+
return mongodb_util.find_query_data(db_name_constant.STOCK_ACCOUNT_INFO, query)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def generate_proxy_ip_api(minutes):
|
|
55
|
+
stock_account_info = get_account_cache()
|
|
56
|
+
order_id = list(stock_account_info['password'])[0]
|
|
57
|
+
secret = list(stock_account_info['account'])[0]
|
|
58
|
+
# 获取10分钟动态ip
|
|
59
|
+
ip = liu_guan_proxy_api.get_proxy_api(order_id, secret, str(60 * minutes))
|
|
60
|
+
return ip
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def generate_proxy_ip(minutes):
|
|
64
|
+
ip_proxy_pool = mongodb_util.find_all_data(db_name_constant.IP_PROXY_POOL)
|
|
65
|
+
if data_frame_util.is_not_empty(ip_proxy_pool):
|
|
66
|
+
return list(ip_proxy_pool['ip'])[0]
|
|
67
|
+
else:
|
|
68
|
+
remove_proxy_ip()
|
|
69
|
+
now_date = datetime.datetime.now()
|
|
70
|
+
# 加上分钟
|
|
71
|
+
time_to_add = datetime.timedelta(minutes=minutes)
|
|
72
|
+
new_date = now_date + time_to_add
|
|
73
|
+
str_now_date = new_date.strftime('%Y-%m-%d %H:%M:%S')
|
|
74
|
+
# 获取10分钟动态ip
|
|
75
|
+
while True:
|
|
76
|
+
remove_proxy_ip()
|
|
77
|
+
ip = generate_proxy_ip_api(minutes)
|
|
78
|
+
if check_proxy(ip):
|
|
79
|
+
result_dict = {"_id": ip,
|
|
80
|
+
'effect_time': str_now_date,
|
|
81
|
+
'ip': ip}
|
|
82
|
+
result_df = pd.DataFrame(result_dict, index=[1])
|
|
83
|
+
|
|
84
|
+
mongodb_util.insert_mongo(result_df, db_name_constant.IP_PROXY_POOL)
|
|
85
|
+
break
|
|
86
|
+
else:
|
|
87
|
+
time.sleep(0.5)
|
|
88
|
+
return ip
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def get_proxy_ip(minutes):
|
|
92
|
+
ip_proxy_pool = query_liu_guan_proxy_ip()
|
|
93
|
+
if data_frame_util.is_empty(ip_proxy_pool):
|
|
94
|
+
return generate_proxy_ip(minutes)
|
|
95
|
+
else:
|
|
96
|
+
if check_valid(ip_proxy_pool):
|
|
97
|
+
return list(ip_proxy_pool['ip'])[0]
|
|
98
|
+
else:
|
|
99
|
+
return generate_proxy_ip(minutes)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def check_proxy(proxy_ip):
|
|
103
|
+
try:
|
|
104
|
+
# 两秒超时
|
|
105
|
+
test_df = call_with_timeout(get_em_real_time_data, proxy_ip, timeout=2)
|
|
106
|
+
if data_frame_util.is_not_empty(test_df):
|
|
107
|
+
logger.info("可用代理ip:{}", proxy_ip)
|
|
108
|
+
return True
|
|
109
|
+
else:
|
|
110
|
+
return False
|
|
111
|
+
except Exception as e:
|
|
112
|
+
logger.error("代理ip不可用:{},{}", proxy_ip, e)
|
|
113
|
+
return False
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def get_em_real_time_data(proxy_ip):
|
|
117
|
+
proxies = {
|
|
118
|
+
"http": proxy_ip,
|
|
119
|
+
"https": proxy_ip
|
|
120
|
+
}
|
|
121
|
+
return east_money_stock_a_api.get_stock_page_data(1, proxies, 20)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
# 定义一个带超时的函数调用
|
|
125
|
+
def call_with_timeout(func, *args, timeout=2, **kwargs):
|
|
126
|
+
# 用于存储函数执行结果
|
|
127
|
+
result = None
|
|
128
|
+
exception = None
|
|
129
|
+
|
|
130
|
+
# 定义一个线程目标函数
|
|
131
|
+
def target():
|
|
132
|
+
nonlocal result, exception
|
|
133
|
+
try:
|
|
134
|
+
result = func(*args, **kwargs)
|
|
135
|
+
except Exception as e:
|
|
136
|
+
exception = e
|
|
137
|
+
|
|
138
|
+
# 创建线程并启动
|
|
139
|
+
thread = threading.Thread(target=target)
|
|
140
|
+
thread.start()
|
|
141
|
+
|
|
142
|
+
# 等待线程完成,最多等待 timeout 秒
|
|
143
|
+
thread.join(timeout)
|
|
144
|
+
|
|
145
|
+
# 如果线程仍然存活,说明函数超时了
|
|
146
|
+
if thread.is_alive():
|
|
147
|
+
raise TimeoutError(f"Function exceeded timeout of {timeout} seconds")
|
|
148
|
+
|
|
149
|
+
# 如果函数抛出了异常,重新抛出
|
|
150
|
+
if exception is not None:
|
|
151
|
+
raise exception
|
|
152
|
+
return result
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
if __name__ == "__main__":
|
|
156
|
+
generate_proxy_ip(1)
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import sys
|
|
2
|
-
import os
|
|
3
|
-
|
|
4
|
-
file_path = os.path.abspath(__file__)
|
|
5
|
-
end = file_path.index('mns') + 16
|
|
6
|
-
project_path = file_path[0:end]
|
|
7
|
-
sys.path.append(project_path)
|
|
8
|
-
|
|
9
|
-
import mns_common.api.proxies.liu_guan_proxy_api as liu_guan_proxy_api
|
|
10
|
-
import pandas as pd
|
|
11
|
-
import mns_common.utils.data_frame_util as data_frame_util
|
|
12
|
-
from mns_common.db.MongodbUtil import MongodbUtil
|
|
13
|
-
import mns_common.constant.db_name_constant as db_name_constant
|
|
14
|
-
import datetime
|
|
15
|
-
import requests
|
|
16
|
-
import time
|
|
17
|
-
from loguru import logger
|
|
18
|
-
from functools import lru_cache
|
|
19
|
-
|
|
20
|
-
mongodb_util = MongodbUtil('27017')
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def query_liu_guan_proxy_ip():
|
|
24
|
-
ip_proxy_pool = mongodb_util.find_all_data(db_name_constant.IP_PROXY_POOL)
|
|
25
|
-
return ip_proxy_pool
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def remove_proxy_ip():
|
|
29
|
-
mongodb_util.remove_data({}, db_name_constant.IP_PROXY_POOL)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
def check_valid(ip_proxy_pool):
|
|
33
|
-
effect_time = list(ip_proxy_pool['effect_time'])[0]
|
|
34
|
-
|
|
35
|
-
now_date = datetime.datetime.now()
|
|
36
|
-
|
|
37
|
-
str_now_date = now_date.strftime('%Y-%m-%d %H:%M:%S')
|
|
38
|
-
|
|
39
|
-
if effect_time > str_now_date:
|
|
40
|
-
return True
|
|
41
|
-
else:
|
|
42
|
-
remove_proxy_ip()
|
|
43
|
-
return False
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
@lru_cache(maxsize=None)
|
|
47
|
-
def get_account_cache():
|
|
48
|
-
query = {"type": "liu_guan_proxy", }
|
|
49
|
-
return mongodb_util.find_query_data(db_name_constant.STOCK_ACCOUNT_INFO, query)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
def generate_proxy_ip_api(minutes):
|
|
53
|
-
stock_account_info = get_account_cache()
|
|
54
|
-
order_id = list(stock_account_info['password'])[0]
|
|
55
|
-
secret = list(stock_account_info['account'])[0]
|
|
56
|
-
# 获取10分钟动态ip
|
|
57
|
-
ip = liu_guan_proxy_api.get_proxy_api(order_id, secret, str(60 * minutes))
|
|
58
|
-
return ip
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
def generate_proxy_ip(minutes):
|
|
62
|
-
ip_proxy_pool = mongodb_util.find_all_data(db_name_constant.IP_PROXY_POOL)
|
|
63
|
-
if data_frame_util.is_not_empty(ip_proxy_pool):
|
|
64
|
-
return list(ip_proxy_pool['ip'])[0]
|
|
65
|
-
else:
|
|
66
|
-
remove_proxy_ip()
|
|
67
|
-
now_date = datetime.datetime.now()
|
|
68
|
-
# 加上分钟
|
|
69
|
-
time_to_add = datetime.timedelta(minutes=minutes)
|
|
70
|
-
new_date = now_date + time_to_add
|
|
71
|
-
str_now_date = new_date.strftime('%Y-%m-%d %H:%M:%S')
|
|
72
|
-
|
|
73
|
-
# 获取10分钟动态ip
|
|
74
|
-
while True:
|
|
75
|
-
ip = generate_proxy_ip_api(minutes)
|
|
76
|
-
if check_proxy(ip, timeout=2):
|
|
77
|
-
break
|
|
78
|
-
else:
|
|
79
|
-
time.sleep(0.5)
|
|
80
|
-
result_dict = {"_id": ip,
|
|
81
|
-
'effect_time': str_now_date,
|
|
82
|
-
'ip': ip}
|
|
83
|
-
result_df = pd.DataFrame(result_dict, index=[1])
|
|
84
|
-
|
|
85
|
-
mongodb_util.insert_mongo(result_df, db_name_constant.IP_PROXY_POOL)
|
|
86
|
-
|
|
87
|
-
return ip
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
def get_proxy_ip(minutes):
|
|
91
|
-
ip_proxy_pool = query_liu_guan_proxy_ip()
|
|
92
|
-
if data_frame_util.is_empty(ip_proxy_pool):
|
|
93
|
-
return generate_proxy_ip(minutes)
|
|
94
|
-
else:
|
|
95
|
-
if check_valid(ip_proxy_pool):
|
|
96
|
-
return list(ip_proxy_pool['ip'])[0]
|
|
97
|
-
else:
|
|
98
|
-
return generate_proxy_ip(minutes)
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
def check_baidu_proxy(proxy_ip, timeout=2):
|
|
102
|
-
"""
|
|
103
|
-
检测代理IP是否能访问百度
|
|
104
|
-
:param proxy_ip: 代理IP地址
|
|
105
|
-
:param proxy_port: 代理端口
|
|
106
|
-
:param timeout: 超时时间(秒)
|
|
107
|
-
:return: (是否可用, 响应时间, 检测结果信息)
|
|
108
|
-
"""
|
|
109
|
-
# 构造代理地址
|
|
110
|
-
|
|
111
|
-
# 设置代理参数
|
|
112
|
-
proxies = {
|
|
113
|
-
"http": proxy_ip,
|
|
114
|
-
"https": proxy_ip
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
# 模拟浏览器请求头
|
|
118
|
-
headers = {
|
|
119
|
-
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
|
|
120
|
-
"Accept-Language": "zh-CN,zh;q=0.9",
|
|
121
|
-
"Connection": "keep-alive"
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
try:
|
|
125
|
-
# 记录开始时间
|
|
126
|
-
start_time = time.time()
|
|
127
|
-
|
|
128
|
-
# 发送请求到百度
|
|
129
|
-
response = requests.get(
|
|
130
|
-
url="https://www.baidu.com",
|
|
131
|
-
proxies=proxies,
|
|
132
|
-
headers=headers,
|
|
133
|
-
timeout=timeout,
|
|
134
|
-
allow_redirects=True # 允许重定向
|
|
135
|
-
)
|
|
136
|
-
|
|
137
|
-
# 计算响应时间
|
|
138
|
-
response_time = round((time.time() - start_time) * 1000) # 毫秒
|
|
139
|
-
# 检查响应状态和内容
|
|
140
|
-
if response.status_code == 200:
|
|
141
|
-
# 验证是否返回百度页面
|
|
142
|
-
if "百度一下" in response.text and "baidu.com" in response.text:
|
|
143
|
-
logger.info("代理ip可用:{},响应时间:{}", proxy_ip, response_time)
|
|
144
|
-
return True
|
|
145
|
-
else:
|
|
146
|
-
logger.error("代理ip不可用:{},响应时间:{}", proxy_ip, response_time)
|
|
147
|
-
return False
|
|
148
|
-
else:
|
|
149
|
-
logger.error("代理ip不可用:{},响应时间:{},HTTP状态码异常:{}", proxy_ip, response_time, response.status_code)
|
|
150
|
-
return False
|
|
151
|
-
except requests.exceptions.ConnectTimeout:
|
|
152
|
-
logger.error("代理ip不可用:{},连接超时", proxy_ip, response_time)
|
|
153
|
-
return False
|
|
154
|
-
except requests.exceptions.ProxyError:
|
|
155
|
-
logger.error("代理ip不可用:{},代理拒绝连接", proxy_ip, response_time)
|
|
156
|
-
return False
|
|
157
|
-
except requests.exceptions.SSLError:
|
|
158
|
-
logger.error("代理ip不可用:{},SSL证书错误", proxy_ip, response_time)
|
|
159
|
-
return False
|
|
160
|
-
except requests.exceptions.RequestException as e:
|
|
161
|
-
logger.error("代理ip不可用:{},网络错误:{}", proxy_ip, str(e))
|
|
162
|
-
return False
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
def check_proxy(proxy_ip, timeout=2):
|
|
166
|
-
proxies = {
|
|
167
|
-
"http": proxy_ip,
|
|
168
|
-
"https": proxy_ip
|
|
169
|
-
}
|
|
170
|
-
try:
|
|
171
|
-
# 测试请求(httpbin.org 返回请求的IP)
|
|
172
|
-
response = requests.get(
|
|
173
|
-
"http://httpbin.org/ip",
|
|
174
|
-
proxies=proxies,
|
|
175
|
-
timeout=timeout # 超时时间
|
|
176
|
-
)
|
|
177
|
-
if response.status_code == 200:
|
|
178
|
-
return True
|
|
179
|
-
else:
|
|
180
|
-
logger.error("代理ip不可用:{}", proxy_ip)
|
|
181
|
-
return False
|
|
182
|
-
except Exception as e:
|
|
183
|
-
logger.error("代理ip不可用:{},{}", proxy_ip, e)
|
|
184
|
-
return False
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
if __name__ == "__main__":
|
|
188
|
-
target_ip = "112.28.228.67:35528" # Google DNS
|
|
189
|
-
if check_proxy(target_ip, 2):
|
|
190
|
-
print(f"{target_ip} 可以访问")
|
|
191
|
-
else:
|
|
192
|
-
print(f"{target_ip} 无法访问")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/em/real_time/east_money_debt_api.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/em/real_time/east_money_stock_hk_api.py
RENAMED
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/em/real_time/east_money_stock_us_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/kpl/common/kpl_common_field_constant.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/kpl/selection/kpl_selection_plate_api.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/kpl/symbol/kpl_real_time_quotes_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/company/ths_company_announce_api.py
RENAMED
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/company/ths_company_info_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/concept/app/ths_concept_detail_app.py
RENAMED
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/concept/app/ths_concept_index_app.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/concept/web/ths_common_js_api.py
RENAMED
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/concept/web/ths_company_info_web.py
RENAMED
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/concept/web/ths_concept_detail_web.py
RENAMED
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/concept/web/ths_concept_index_web.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/api/ths/self_choose/ths_self_choose_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/classify/symbol_classify_api.py
RENAMED
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/classify/symbol_classify_param.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/company/company_common_service_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/cookie/cookie_info_service.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/em/em_real_time_quotes_api.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/exception/ExceptionMonitor.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/industry/ths_industry_index_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/k_line/patterns/pattern_Enum.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/price/trade_price_service_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/self_choose/black_list_service_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.9.9 → mns_common-1.4.0.1}/mns_common/component/task/real_time_data_sync_check.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|