ludoux / ngapost2md

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

[设定Cookie] 24409319这个pid的帖子无法保存 #19

Closed DarrenIce closed 3 years ago

DarrenIce commented 3 years ago
❯ python nga.py
tid:24409319
24409319
localmaxpage1
localmaxfloor-1
trypage1
Oops! 'NoneType' object has no attribute 'group'
press to exit.

以上是输出,看了一下代码没找到group,还是把Bug抛给你吧23333

ludoux commented 3 years ago

好的。我先确认一下您改了代码里的cookie值,并且这个帖子是能够访问(而不是403什么的)的么。假如都是的话我晚上回去看一下。


From: DarrenIce notifications@github.com Sent: Thursday, January 21, 2021 2:47:42 PM To: ludoux/ngapost2md ngapost2md@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [ludoux/ngapost2md] 24409319这个pid的帖子无法保存 (#19)

❯ python nga.py

tid:24409319

24409319

localmaxpage1

localmaxfloor-1

trypage1

Oops! 'NoneType' object has no attribute 'group'

press to exit.

以上是输出,看了一下代码没找到group,还是把Bug抛给你吧23333

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/ludoux/ngapost2md/issues/19, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADGWKTFXTYHVNYKCIE6ZJ5TS27EY5ANCNFSM4WMKUYPQ.

DarrenIce commented 3 years ago

好的。我先确认一下您改了代码里的cookie值,并且这个帖子是能够访问(而不是403什么的)的么。假如都是的话我晚上回去看一下。 ____ From: DarrenIce notifications@github.com Sent: Thursday, January 21, 2021 2:47:42 PM To: ludoux/ngapost2md ngapost2md@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [ludoux/ngapost2md] 24409319这个pid的帖子无法保存 (#19) ❯ python nga.py tid:24409319 24409319 localmaxpage1 localmaxfloor-1 trypage1 Oops! 'NoneType' object has no attribute 'group' press to exit. 以上是输出,看了一下代码没找到group,还是把Bug抛给你吧23333 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub<#19>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADGWKTFXTYHVNYKCIE6ZJ5TS27EY5ANCNFSM4WMKUYPQ.

改了,别的帖子可以正常保存,这个不可以~

DarrenIce commented 3 years ago

而且,我发现还是有一些表情会被下载,是因为在线表情不全嘛

ludoux commented 3 years ago

这一些 应该是用开源版的高清表情包,实质上是一个个图片来着的


From: DarrenIce notifications@github.com Sent: Thursday, January 21, 2021 3:00:56 PM To: ludoux/ngapost2md ngapost2md@noreply.github.com Cc: Lu Chang chinaluchang@live.com; Comment comment@noreply.github.com Subject: Re: [ludoux/ngapost2md] 24409319这个pid的帖子无法保存 (#19)

而且,我发现还是有一些表情会被下载,是因为在线表情不全嘛

― You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/ludoux/ngapost2md/issues/19#issuecomment-764429547, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADGWKTCPVIIM45MEO2YD5STS27GKRANCNFSM4WMKUYPQ.

DarrenIce commented 3 years ago

我知道为啥了。。这帖子被冲水了,因为我收藏了所以能看到第一页,实际上已经没了= =

xpsair commented 3 years ago

我知道为啥了。。这帖子被冲水了,因为我收藏了所以能看到第一页,实际上已经没了= =

有的帖子用网页还是能正常看所有的页,但爬的时候就1楼的这个问题。。。

ludoux commented 3 years ago

https://github.com/ludoux/ngapost2md/issues/19#issuecomment-783450726 @xpsair 你好。方不方便提供一个tid我看一下,多谢

xpsair commented 3 years ago

#19 (comment) @xpsair 你好。方不方便提供一个tid我看一下,多谢

比如这个tid:25621364,还有这个tid:25617341 要是issue也有AC娘表情直接用就好了 (:哭)

ludoux commented 3 years ago

手动 refer: https://github.com/ludoux/ngapost2md/commit/ad8a363bb4cebdad47ebba1047879194de6ff6e9 可能返回服务器忙,就没有group

#19 (comment) @xpsair 你好。方不方便提供一个tid我看一下,多谢

比如这个tid:25621364,还有这个tid:25617341 要是issue也有AC娘表情直接用就好了 (:哭)

这个我今早看了一下,好像可以保存…?就是不是100%复现的那种

xpsair commented 3 years ago

手动 refer: ad8a363 可能返回服务器忙,就没有group

#19 (comment) @xpsair 你好。方不方便提供一个tid我看一下,多谢

比如这个tid:25621364,还有这个tid:25617341 要是issue也有AC娘表情直接用就好了 (:哭)

这个我今早看了一下,好像可以保存…?就是不是100%复现的那种

我在windows和macOS上试了这2上个tid,都不能保存。。。

Please edit cookies info in the code file first...
tid:25617341
25617341
localmaxpage1
localmaxfloor-1
trypage1
Oops! 'NoneType' object has no attribute 'group'
press to exit.

问一下,nga.py里的ngaPassportUid可以在网页的源码里通过uid搜索到,那个ngaPassportCidapp-id吗?

ludoux commented 3 years ago

你好像没有改cookie,改了cookie应该就不会报错了。 那个应该就是ngaPassportCid,你试一下开无痕后按F12抓包登录后查一下cookie中有没有这个键值对。它的值应该是小写字母和数字混杂的一个字符串


From: xpsair notifications@github.com Sent: Tuesday, February 23, 2021 4:15:39 PM To: ludoux/ngapost2md ngapost2md@noreply.github.com Cc: Lu Chang chinaluchang@live.com; State change state_change@noreply.github.com Subject: Re: [ludoux/ngapost2md] 24409319这个pid的帖子无法保存 (#19)

手动 refer: ad8a363https://github.com/ludoux/ngapost2md/commit/ad8a363bb4cebdad47ebba1047879194de6ff6e9 可能返回服务器忙,就没有group

19 (comment)https://github.com/ludoux/ngapost2md/issues/19#issuecomment-783450726

@xpsairhttps://github.com/xpsair 你好。方不方便提供一个tid我看一下,多谢

比如这个tid:25621364,还有这个tid:25617341 要是issue也有AC娘表情直接用就好了 (:哭)

这个我今早看了一下,好像可以保存…?就是不是100%复现的那种

我在windows和macOS上试了这2上个tid,都不能保存。。。

Please edit cookies info in the code file first...

tid:25617341

25617341

localmaxpage1

localmaxfloor-1

trypage1

Oops! 'NoneType' object has no attribute 'group'

press to exit.

问一下,nga.py里的ngaPassportUid可以在网页的源码里通过uid搜索到,那个ngaPassportCid是app-id吗?

― You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/ludoux/ngapost2md/issues/19#issuecomment-783995344, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADGWKTFOAMZM2HNEQNTULZ3TANP2XANCNFSM4WMKUYPQ.

ludoux commented 3 years ago

@xpsair 简单来说就是你cookie没有填/填对,访问的时候不是登录状态。游客是无法看这个帖子的。之后更新的时候会加一下相应文本提示。 编辑: 你好像没有改cookie,改了cookie应该就不会报错了。 那个应该就是ngaPassportCid,你试一下开无痕后打开登录页面按F12切换到NETWORK/网络 选项卡并开始记录,之后登录,再直接搜索这个键名,看看历史请求中的cookie中有没有这个键值对。它的值应该是小写字母和数字混杂的一个字符串

xpsair commented 3 years ago

@xpsair 简单来说就是你cookie没有填/填对,访问的时候不是登录状态。游客是无法看这个帖子的。之后更新的时候会加一下相应文本提示。 编辑: 你好像没有改cookie,改了cookie应该就不会报错了。 那个应该就是ngaPassportCid,你试一下开无痕后打开登录页面按F12切换到NETWORK/网络 选项卡并开始记录,之后登录,再直接搜索这个键名,看看历史请求中的cookie中有没有这个键值对。它的值应该是小写字母和数字混杂的一个字符串

原来ngaPassportCid是指cookie的意思 :sweat_smile:。

用你的那个方法,还是没有找到ngaPassportCid :cold_sweat:。 我是用下面的步骤找到ngaPassportCid的:

  1. 首先要保证浏览器允许nga的cookie。
  2. 以Chrome为例,登录nga。
  3. 随便打开一个nga的帖子,按F12-然后选Application选项卡-左侧的Storage-Cookies列表,再选中nga的网页,就可以看到右边的ngaPassportCid(过一段时间会过期)以及ngaPassportUid了。

填好ngaPassportCidngaPassportUid如果帖子有多页、还可以在网页上翻到第2页的话, 那么用这个工具基本都能保存下帖子的。