ludoux / ngapost2md

艾泽拉斯国家地理论坛/NGA玩家社区/NGA单帖爬虫/牛国安一键存贴,不怕冲水
MIT License
98 stars 10 forks source link

修改页码检测部分免受论坛吞楼影响 #32

Closed crella6 closed 2 years ago

crella6 commented 2 years ago

tid=20363301,页码=416,当本页的最后一楼的内容被吞掉的时候,恒有int(tdict['replies']) > totalfloor[len(totalfloor)-1][0],然后程序会不断增加页码

"__R":{"0":{"pid":563445812,"fid":-39223361,"tid":20363301,"authorid":1277654,"type":0,"score":0,"score_2":0,"recommend":0,"postdate":"2021-11-03 22:49","subject":"","alterinfo":"","content":"从没见过这么高的楼!<br/><br/>有总结吗??","lou":82302,"content_length":32,"from_client":"8 Android","postdatetimestamp":1635950958}},"__T":{"fid":-39223361,"tid":20363301,"topic_misc":"AQAAAAQ","subject":"NGA肖战粉仙人跳AO3贴+魔道祖师相关","locked":0,"recommend":10,"quote_to":"","quote_from":0,"type":8420,"replies":82304,"authorid":35329383,"postdate":1581501134,"lastpost":1635951028,"author":"a116128544","lastposter":"京都看花天","digest":0,"lastmodify":1635951028,"tpid":0,"}
ludoux commented 2 years ago

对的这个确实一直存在。最好解决方式就是看看nga开源版那个是怎么判断最大页数的

oarinv commented 2 years ago

以tid=29105694帖子为例 页数为 ROWS/R__ROWS_PAGE 78/20=3.9 往大取整就是4页

  "this_visit_rows": 78  
        },
        "__F": {
            "name": "生活万象"
        },
        "__R__ROWS": 20,
        "__R__ROWS_PAGE": 20,
        "__ROWS": 78,
        "__PAGE": 1
    },
    "encode": "GBK",
    "time": 1636113482
}