pixivpy icon indicating copy to clipboard operation
pixivpy copied to clipboard

请问有没有取得自己收藏夹的bookmarkid的接口

Open yyxida opened this issue 9 months ago • 3 comments

Bookmark ID。你收藏的每一个作品都会有一个 Bookmark ID。收藏的时间越晚,Bookmark ID 就越大。当你下载你的收藏时,可以使用 {bmk_id} 作为排序依据。-引用自Powerful Pixiv Downloader(

web端可以用 https://www.pixiv.net/ajax/user/112161111/novels/bookmarks?tag=&offset=0&limit=30&rest=show&lang=zh&version=e11a103b148c138660cbd4085334f4e6da87a9f1

这个接口获取到bookmarkData 如果是获取的本账户的话bookmarkData会有 "bookmarkData": { "id": "3051589411", "private": false }

如果是他人的账户的话bookmarkData为null。

yyxida avatar Mar 25 '25 08:03 yyxida

可以参考下demo中这个的调用,获取自己的收藏可以传自己的user_id

https://github.com/upbit/pixivpy/blob/master/pixivpy3/aapi.py#L193C1-L203C6

    # 用户收藏作品列表
    # tag: 从 user_bookmark_tags_illust 获取的收藏标签
    def user_bookmarks_illust(
        self,
        user_id: int | str,
        restrict: _RESTRICT = "public",
        filter: _FILTER = "for_ios",
        max_bookmark_id: int | str | None = None,
        tag: str | None = None,
        req_auth: bool = True,
    )

upbit avatar Mar 29 '25 12:03 upbit

可以参考下demo中这个的调用,获取自己的收藏可以传自己的user_id

https://github.com/upbit/pixivpy/blob/master/pixivpy3/aapi.py#L193C1-L203C6

# 用户收藏作品列表
# tag: 从 user_bookmark_tags_illust 获取的收藏标签
def user_bookmarks_illust(
    self,
    user_id: int | str,
    restrict: _RESTRICT = "public",
    filter: _FILTER = "for_ios",
    max_bookmark_id: int | str | None = None,
    tag: str | None = None,
    req_auth: bool = True,
)

这个貌似是获取插画的接口,我尝试使用user_bookmarks_novel获取到的收藏数据也没有Bookmark ID(使用了本账号的token),貌似是只能在网页上获取,因为只有网页上才有给自己收藏的作品打自定义tag的功能,这个功能有用到这个值貌似。

yyxida avatar Apr 02 '25 03:04 yyxida

你好,想请问pixivpy3.utils.PixivError: [ERROR] auth() failed! check username and password. HTTP 400: {"has_error":true,"errors":{"system":{"message":"The grant type is unauthorized for this client_id","code":1508}},"error":"invalid_grant"}需要怎么解决

whiteiZ avatar May 06 '25 11:05 whiteiZ