python水一篇查看bilibili三体真实评分
```import requests
import json
import threading
from tqdm import tqdm
from functools import lru_cache
import queue
q = queue.Queue()
COOKIES = {
'buvid3': 'A9D9FD41-2F2F-F3CF-97C5-542B29E0987660281infoc',
'b_nut': '1668477260',
'i-wanna-go-back': '-1',
'b_ut': '7',
'_uuid': 'D2EC4D61-E4BE-3C64-38102-9FE1988447C161515infoc',
'buvid4': '75898C1F-9A03-059F-BABE-A245AC20E09D38213-022060821-VGouk5e+pYiR45pgchAoBw%3D%3D',
'buvid_fp': '8882ffafd2e8f96a039dd6cdf729ad22',
'CURRENT_FNVAL': '4048',
'rpdid': "|(u))umm)~JJ0J'uY~|)kk)YJ",
'CURRENT_QUALITY': '32',
}
HEADERS = {
'authority': 'api.bilibili.com',
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'accept-language': 'zh-CN,zh;q=0.9',
'cache-control': 'max-age=0',
'sec-ch-ua': '"Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'document',
'sec-fetch-mode': 'navigate',
'sec-fetch-site': 'none',
'sec-fetch-user': '?1',
'upgrade-insecure-requests': '1',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36',
}
def get_score(type, media_id=4315402, ps=20, sort=0, cursor='', **kwargs):
params = {
'media_id': media_id,
'ps': ps,
'sort': sort,
'cursor': cursor,
**kwargs,
}
scores = 0
# @lru_cache()
def fetch_data(params_tuple):
params = dict(params_tuple)
response = requests.get(f'https://api.bilibili.com/pgc/review/{type}/list', params=params, cookies=COOKIES, headers=HEADERS)
data = json.loads(response.text)
return data['data']['list'], data['data']['next']
total = 0
pbar = tqdm(total=total)
while True:
reviews, cursor = fetch_data(tuple(sorted(params.items())))
if not reviews:
break
total += len(reviews)
for review in reviews:
scores += review["score"]
params['cursor'] = cursor
pbar.update(len(reviews))
pbar.close()
return scores, total
def get_short_scores(q):
short_scores, short_total = get_score('short')
q.put((short_scores, short_total))
def get_long_scores(q):
long_scores, long_total = get_score('long')
q.put((long_scores, long_total))
def test_get_score():
# short_scores, short_total = get_score('short')
# long_scores, long_total = get_score('long')
# avg = (short_scores + long_scores) / (short_total + long_total)
# print(avg)
thread1 = threading.Thread(target=get_short_scores, args=(q,))
thread2 = threading.Thread(target=get_long_scores, args=(q,))
thread1.start()
thread2.start()
thread1.join()
thread2.join()
short_scores, short_total = q.get()
long_scores, long_total = q.get()
scores = short_scores + long_scores
total = short_total + long_total
avg = scores / total
print("真实评分:", avg)
test_get_score()
```
![](https://files.catbox.moe/9phixs.png)
![](https://files.catbox.moe/30y9qk.png)
bilibili:控分成功 弱弱问一句,算出来的评分为什么会超过5分呢?不是最高就5颗星吗。
不过有一说一,我觉得三体很好看,制作也很精良,
虽然引入得太快,但红岸那部分要顾及大环境,本来就拍起来就束手束脚的,
古筝行动其实算是一个很有想法的小高潮,拿来开篇还是可以,只是因为前情交待的太快,对非小说粉不太友好
至于弹舌头啊之类的问题,是不够好,但瑕不掩瑜吧
我们的文化输出是要拿出东西来的,好不容易有东西,却很多人骂,总是不好,除非骂的人自身有做贡献。否则和和气气的讨论才是正道吧。 2193056758 发表于 2023-1-30 08:18
你要不看看现在三体的弹幕是啥?啪啪打脸的声真响啊? 一部大投资的动画资产复用已经高到一个频率了
确实打脸了哈哈,那是之前没看电视剧的时候,就看了前面一点动画
现在越来越扯,又多了比较,自然是加入骂方阵营啦{:1_918:} 善于学习的人{:1_921:} COOKIES 暴露了,建议隐藏下 技术牛逼,可以的 所以到底多少分 这个我喜欢,感谢:lol 跑了一分多钟一直没有出结果,手动暂停止了 技术牛逼,可以的 6,但是有些账号被某站操纵评分,这坨答辩应该5分都不到 傻逼导演,拍得这么烂,还粉饰太平,依托答辩
页:
[1]
2