Skip to content

Commit b14f4e5

Browse files
authored
Merge pull request #170 from 1nchaos/dev
Dev
2 parents 09d6ddc + 2e90492 commit b14f4e5

File tree

5 files changed

+387
-9
lines changed

5 files changed

+387
-9
lines changed

HISTORY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ master
99

1010
专注股票量化数据,为Ai(爱)发电,向阳而生。
1111

12+
2.9.5 (2024-12-26)
13+
------------------
14+
1. 修复:ths热门概念等异常。
15+
2. 新增:26y交易日缓存。
16+
1217
2.9.0 (2024-04-02)
1318
------------------
1419
1. 又是一年清明节,两年 2k star,感谢各位老铁的支持。

adata/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
VERSION = (2, 9, 4)
3+
VERSION = (2, 9, 5)
44
PRERELEASE = None # alpha, beta or rc
55
REVISION = None
66

adata/common/utils/sunrequests.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ def __get_proxies(self, proxies):
8686
ip = requests.get(url=proxy_url).text.replace('\r\n', '') \
8787
.replace('\r', '').replace('\n', '').replace('\t', '')
8888
if is_proxy and ip:
89-
proxies = {'https': f"http://{ip}", 'http': f"http://{ip}"}
89+
if ip.startswith('http'):
90+
proxies = {'https': f"{ip}", 'http': f"{ip}"}
91+
else:
92+
proxies = {'https': f"http://{ip}", 'http': f"http://{ip}"}
9093
return proxies
9194

9295

adata/sentiment/hot.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,14 @@ def hot_rank_100_ths():
8181
data = res.json()["data"]["stock_list"]
8282
data_list = []
8383
for d in data:
84-
d["concept_tag"] = ";".join(d["tag"]["concept_tag"])
85-
if "popularity_tag" in d["tag"]:
86-
d["pop_tag"] = d["tag"]["popularity_tag"].replace("\n", "")
87-
data_list.append(d)
84+
try:
85+
if "tag" in d and "concept_tag" in d["tag"]:
86+
d["concept_tag"] = ";".join(d["tag"]["concept_tag"])
87+
if "popularity_tag" in d["tag"]:
88+
d["pop_tag"] = d["tag"]["popularity_tag"].replace("\n", "")
89+
data_list.append(d)
90+
except:
91+
pass
8892
rename = {
8993
"order": "rank",
9094
"rise_and_fall": "change_pct",
@@ -126,6 +130,6 @@ def hot_concept_20_ths(plate_type=1):
126130

127131
if __name__ == "__main__":
128132
print(Hot().hot_rank_100_ths())
129-
print(Hot().pop_rank_100_east())
130-
print(Hot().hot_concept_20_ths(plate_type=1))
131-
print(Hot().hot_concept_20_ths(plate_type=2))
133+
# print(Hot().pop_rank_100_east())
134+
# print(Hot().hot_concept_20_ths(plate_type=1))
135+
# print(Hot().hot_concept_20_ths(plate_type=2))

0 commit comments

Comments
 (0)