parent
873dadc628
commit
06108b8b6b
@ -0,0 +1 @@ |
|||||||
|
*.json |
@ -0,0 +1,35 @@ |
|||||||
|
import json |
||||||
|
import time |
||||||
|
|
||||||
|
import requests |
||||||
|
|
||||||
|
host_uid = 207539637 |
||||||
|
cards = [] |
||||||
|
offset_dynamic_id = 0 |
||||||
|
while True: |
||||||
|
url = f"https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/space_history?visitor_uid=0&host_uid={host_uid}&offset_dynamic_id={offset_dynamic_id}&need_top=1&platform=web" |
||||||
|
print(f'url={url}') |
||||||
|
res = requests.get(url) |
||||||
|
if res.status_code == 200: |
||||||
|
res_json = json.loads(res.content) |
||||||
|
print('解析成功') |
||||||
|
try: |
||||||
|
if res_json["data"] and res_json["data"]["cards"]: |
||||||
|
for card in res_json["data"]["cards"]: |
||||||
|
if card["card"]: |
||||||
|
card_json = json.loads(card["card"]) |
||||||
|
if "item" in card_json and "description" in card_json["item"] and "弹幕彩蛋" in card_json["item"][ |
||||||
|
"description"]: |
||||||
|
print(card_json["item"]["description"]) |
||||||
|
cards.append(card_json["item"]["description"]) |
||||||
|
if res_json["data"]["cards"][-1]["desc"] and res_json["data"]["cards"][-1]["desc"]["dynamic_id_str"]: |
||||||
|
offset_dynamic_id = res_json["data"]["cards"][-1]["desc"]["dynamic_id_str"] |
||||||
|
time.sleep(3) |
||||||
|
print('添加动态') |
||||||
|
except KeyError as e: |
||||||
|
break |
||||||
|
else: |
||||||
|
raise Exception(f"status_code={res.status_code}") |
||||||
|
|
||||||
|
with open(file='test.json', mode='w', encoding='UTF-8') as f: |
||||||
|
f.write(str(cards)) |
@ -0,0 +1,4 @@ |
|||||||
|
import string |
||||||
|
from domain.checkDomain import check, colname_to_num, getKey, namesilo |
||||||
|
|
||||||
|
check(['com', 'top', 'xyz','buzz'], 'a', 'zzzz', True, namesilo) |
@ -1,14 +1,29 @@ |
|||||||
|
beautifulsoup4==4.9.1 |
||||||
|
bs4==0.0.1 |
||||||
certifi==2019.11.28 |
certifi==2019.11.28 |
||||||
chardet==3.0.4 |
chardet==3.0.4 |
||||||
deprecation==2.0.7 |
deprecation==2.0.7 |
||||||
|
et-xmlfile==1.0.1 |
||||||
huaweicloud-sdk-python==1.0.21 |
huaweicloud-sdk-python==1.0.21 |
||||||
idna==2.8 |
idna==2.8 |
||||||
iso8601==0.1.12 |
iso8601==0.1.12 |
||||||
keystoneauth1==3.4.0 |
keystoneauth1==3.4.0 |
||||||
|
lxml==4.5.2 |
||||||
|
openpyxl==3.0.7 |
||||||
packaging==20.1 |
packaging==20.1 |
||||||
pbr==5.4.4 |
pbr==5.4.4 |
||||||
|
peewee==3.13.3 |
||||||
|
pinger==0.1.3 |
||||||
|
pip==21.1.3 |
||||||
pyparsing==2.4.6 |
pyparsing==2.4.6 |
||||||
requests==2.22.0 |
requests==2.22.0 |
||||||
|
requests-toolbelt==0.9.1 |
||||||
|
setuptools==57.1.0 |
||||||
six==1.14.0 |
six==1.14.0 |
||||||
|
soupsieve==2.0.1 |
||||||
stevedore==1.32.0 |
stevedore==1.32.0 |
||||||
urllib3==1.25.8 |
urllib3==1.25.8 |
||||||
|
xbox==0.1.3 |
||||||
|
xlrd==2.0.1 |
||||||
|
xlutils==2.0.0 |
||||||
|
xlwt==1.3.0 |
||||||
|
Loading…
Reference in new issue