lumina37 / aiotieba

贴吧接口合集✨可用于工具箱/吧务管理/数据采集
https://aiotieba.cc
The Unlicense
399 stars 69 forks source link

`get_self_posts` 是只能抓自己的回复吗? #180

Closed Dilettante258 closed 7 months ago

Dilettante258 commented 7 months ago

我试着改了一下源代码,试试 get_self_posts 能不能抓别人的,但是返回数据的都是空的。

很好奇那些贴吧工具箱又是怎么抓取评论的。

lumina37 commented 7 months ago

当然只能抓自己的。我也没搞懂那些工具箱是怎么查发言的,貌似高级搜索的接口已经被ban了

Dilettante258 commented 7 months ago

好的,谢谢👌🙂

lumina37 commented 7 months ago

下午受大佬点拨把这个接口的调用方法找出来了,其实就是改个版本号的事情https://github.com/Starry-OvO/aiotieba/commit/c6d370713e91918a0a17f822cf3f449936bb3b28

Dilettante258 commented 7 months ago

麻烦啦。谢谢!🤩🤩🤩

n0099 commented 7 months ago

我也没搞懂那些工具箱是怎么查发言的

https://www.82cat.com/tieba/reply/n0099/1

下午受大佬点拨把这个接口的调用方法找出来了

不二告诉您的?

lumina37 commented 7 months ago

我也没搞懂那些工具箱是怎么查发言的

https://www.82cat.com/tieba/reply/n0099/1

下午受大佬点拨把这个接口的调用方法找出来了

不二告诉您的?

一个水友,反正不是站长

n0099 commented 7 months ago

bug吧壬?小心明天接口就失效

n0099 commented 7 months ago

貌似高级搜索的接口已经被ban了

在曾于18年7月主持血小板吧事件的某esu狗妖照 实名/张钦瑞于19年3月幕后主导的b吧事件 https://n0099.net/tbm/bilibiliVote https://moegirl.uk/User:A635683851/Bilibili吧吧务被警告及下台事件 https://web.archive.org/web/20220205061240/https://zh.moegirl.org.cn/User:A635683851/Bilibili吧吧务被警告及下台事件 有请时任esu调查员 @creeper9 及此后19年4月esuwiki出道刘慈欣 https://html-preview.github.io/?url=https://github.com/ESUAdmin/esu/blob/8f07c4ea48572d29e70949ddb98c905e669351bc/刘慈欣.html https://github.com/ESUAdmin/esu/blob/8f07c4ea48572d29e70949ddb98c905e669351bc/刘慈欣.html#L383 https://github.com/ESUAdmin/esu/blob/8f07c4ea48572d29e70949ddb98c905e669351bc/刘慈欣.html#L590 时贴吧方面关闭的网页高级搜索 https://tieba.baidu.com/f/search/res?ie=utf-8&qw=n0099 目前削弱的高搜跟上面不二工具盒的相比索引明显滞后很久

其实就是改个版本号的事情 https://github.com/Starry-OvO/aiotieba/commit/c6d370713e91918a0a17f822cf3f449936bb3b28

https://github.com/Starry-OvO/aiotieba/blob/c6d370713e91918a0a17f822cf3f449936bb3b28/aiotieba/api/get_user_contents/get_posts/_api.py#L10 我记得当年就有人在目录吧主群里声称某8.x版本客户端可以像高搜那样查用户全吧回复贴楼中楼,但没说具体版本号多少 这就像吧首页主题帖接口用远古版本6.0.2才能看到unixtimestamp的最后回复时间一样 https://github.com/search?q=repo%3An0099%2Fopen-tbm+6.0.2&type=code

以及主题帖回复贴接口8.8.8.8 https://github.com/n0099/open-tbm/blob/4f0745c64ba0b756e7e2a763b47c6e951c08e767/c%23/crawler/src/Tieba/Crawl/ThreadLateCrawlerAndSaver.cs#L44 看网页端上可见的发帖客户端类型 https://github.com/n0099/open-tbm/blob/4f0745c64ba0b756e7e2a763b47c6e951c08e767/c%23/crawler/src/Tieba/Crawl/ThreadLateCrawlerAndSaver.cs#L91 _client_type https://github.com/n0099/tbclient.protobuf/blob/e7825f56bf0ce23d528490f8e0a450c8c884929f/proto/CommonReq.proto#L4 https://github.com/TRPGEngine/Server/blob/feb08996077c2473e4a65fc3a4de28ab11544483/services/tieba-helper/index.ts#L66-L69

n0099 commented 7 months ago

我顺着昨天出现的某贴吧相关repostar狂魔 @sansiny https://web.archive.org/web/20240328160640/https://github.com/sansiny?tab=stars https://z.n0099.net/#narrow/near/103195 找到了个 https://github.com/Dilettante258/tieba-tools/blob/0e66159533518c624f4262b8ea3da329bb6e55b9/src/api/post.ts#L20 https://tb.wang1m.cc/userpost/n0099/1 但其api后端不开源看起来是直接反代protobuf接口

Dilettante258 commented 7 months ago

我顺着昨天出现的某贴吧相关repostar狂魔 @sansiny https://web.archive.org/web/20240328160640/https://github.com/sansiny?tab=stars https://z.n0099.net/#narrow/near/103195 找到了个 https://github.com/Dilettante258/tieba-tools/blob/0e66159533518c624f4262b8ea3da329bb6e55b9/src/api/post.ts#L20 https://tb.wang1m.cc/userpost/n0099/1 但其api后端不开源看起来是直接反代protobuf接口

这个就是我参考着叶灵大佬的aiotieba的接口写的。这个没有后端,protobuf序列化和反序列化都是通过js在前端完成的。api接口之所以需要反代是因为cors问题

n0099 commented 7 months ago

那么_client_version=8.9.8.5在哪儿?

Dilettante258 commented 7 months ago

那么_client_version=8.9.8.5在哪儿?

https://github.com/Dilettante258/tieba-tools/blob/0e66159533518c624f4262b8ea3da329bb6e55b9/src/api/ProtobufParser.ts#L16

export function postReqSerialize(userId:number, pn:number): Promise<Buffer> {
  return new Promise((resolve) => {
    const Proto = root.lookupType("UserPostReqIdl");

    const payload = {
      data: {
        needContent: 1,
        userId: userId,
        pn: pn,
        common: {
          clientversion: "8.9.8.5",
        }
      }
    };

    const message = Proto.create(payload);
    const buffer = Proto.encode(message).finish();

    resolve(Buffer.from(buffer));
  });
}
n0099 commented 7 months ago

12.57.0.1也能看到?

Dilettante258 commented 7 months ago

12.57.0.1也能看到?

不好意思,大早上还没醒,我复制错了。😹 已更改。