Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

部分帖子会出现某一页请求超出范围的问题,但实际上后面还有楼层 #158

Closed
adk23333 opened this issue Jan 28, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@adk23333
Copy link

复现可用如下代码

await client.get_posts(3669356387, 44)
报错如下
<2024-01-28 17:32:45.457> [WARN] [get_posts] list assignment index out of range. tid=3669356387

而43页的has_more是true的,44页本身has_more则是false,然后45页可以请求到有内容,直至帖子结束。

在贴吧app上,在该楼内往下拉,直到正序43页最后一楼或者倒序45页第一楼的楼层后就会无法加载后续的楼层
在网页版则是这些楼层之间缺了一大片楼层。

吧和帖子可以由以上post获取了,就不发了
目前只在该贴遇到此问题

应该是官方的问题?

@lumina37
Copy link
Owner

不知道为什么这一页完全没有任何信息,包括page.total_page。我觉得应该是官方的问题,可能一整页都被删了就会出现这种情况

@adk23333
Copy link
Author

adk23333 commented Jan 28, 2024

不知道为什么这一页完全没有任何信息,包括page.total_page。我觉得应该是官方的问题,可能一整页都被删了就会出现这种情况

说实话,一删删整页是非常难以理解的,楼层和楼层之间一般都没什么联系。不过这个帖子是水贴,或许谁真的发了一片违规内容的楼层。。。

可以创建一个有很多楼的帖子,然后删掉一整页的楼层试试复现。

还有这种情况下,has_more其实并不准确了,最准确的遍历整个楼层的方法只能是一开始使用total_page了

@n0099
Copy link

n0099 commented Jan 28, 2024

rn多少?
https://github.com/Starry-OvO/aiotieba/blob/96ffd607efd0c068bc6af04017c24bc95dd182ed/aiotieba/client.py#L398
而网页端也是30 F12-Console $('.l_post').length有真相

在网页版则是这些楼层之间缺了一大片楼层。

https://tieba.baidu.com/p/3669356387 960回复贴,共31页
最新回复贴1015Lpid149147705471 1015/30=33.83...
所以哪来的pn=44
不过注意到pn=29只有14个回复贴而pn=30只有1个,这类分页错误在16年挺常见
显然贴吧不想用cursor/keyset pagination坚守offset pagination n0099/open-tbm#24 而为了优化性能提前生成了每页有哪些pid而当年有些pid被删(亦或当年的另一套主客态早期实现如18年时引入的fold)后没有更新缓存至今

最准确的遍历整个楼层的方法只能是一开始使用total_page了

pn=1page.total_page

@n0099 n0099 mentioned this issue Jan 28, 2024
@lumina37 lumina37 added the bug Something isn't working label Jan 28, 2024
@adk23333
Copy link
Author

所以哪来的pn=44

我说的pn仅对于aiotieba内设置rn=30而言,网页端我说的是楼层了,不是页码

@n0099
Copy link

n0099 commented Jan 28, 2024

最新回复贴1015Lpid149147705471 1015/30=33.83...

就算1~1015L是连续的中间没有被删在rn=30下也只有至多CEIL()到34页

另外像这种以前的贴吧bugfeature您也可以致电05年起贴吧客户端内测用户老id吃miss吧候补吧主云南贵族556神 https://z.n0099.net/#narrow/near/70909 https://tieba.baidu.com/p/8813888428?pid=149432733310#149432733310 亦或bug吧常委武汉台大EE昌维 https://z.n0099.net/#narrow/near/79467 https://twitter.com/changwei1006/status/1749870820309258745

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants