请问进行登陆之后有获得已收藏本子的方法吗? #235
-
请问有模块能帮助获得账号下已收藏本子的id序列吗?想通过这个来对收藏的内容进行批量下载 |
Beta Was this translation helpful? Give feedback.
Replies: 11 comments
-
v2.4.1 已实现,参考如下代码: from jmcomic import *
op = create_option('xxx')
cl = op.new_jm_client()
# 登录,可以使用插件或配置AVS等其他方式
cl.login('username', 'password')
# 遍历收藏页
for page in cl.favorite_folder_gen(username='username'): # 指定username参数,api Client 可以不传
# 遍历收藏页下的每个结果
for aid, atitle in page:
# aid: 本子的album_id
print(aid) |
Beta Was this translation helpful? Give feedback.
-
非常感谢您的工作,另外请问cl.favorite_folder(username='xxx')这个获取收藏夹信息功能是在完善中吗?我无法通过它获得我的文件夹信息。当然也有可能是我使用错误 |
Beta Was this translation helpful? Give feedback.
-
这个方法是完全可用的。 |
Beta Was this translation helpful? Give feedback.
-
贴一个favorite_folder最简单的使用方式,无option配置,直接运行代码即可。 from jmcomic import JmOption, JmApiClient
cl = JmOption.default().new_jm_client(impl=JmApiClient)
cl.login('你的用户名', '你的密码')
# 获取收藏夹 (第一页)
for aid, atitle in cl.favorite_folder():
print(aid) |
Beta Was this translation helpful? Give feedback.
-
是的,这个方法完全能够正确地返回atittle以及aid,但是当我尝试传递参数folder = 'folder_name'进去时它仍然会返回所有的收藏内容而不是特定收藏夹下的内容 |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
你也可以使用代码来获取目标文件夹的id from jmcomic import *
cl = JmOption.default().new_jm_client(impl=JmApiClient)
cl.login('xxx', 'yyy')
page = cl.favorite_folder()
for folder_info in page.folder_list:
fname, fid = folder_info['name'], folder_info['FID']
print(f'文件夹名: {fname},文件夹id: {fid}') |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
十分感谢您迅速的回复,完全解决了我的问题。
|
Beta Was this translation helpful? Give feedback.
-
噢是的,问题在于jmcomic的setup漏了这个库,导致在安装jmcomic时没有自动装上这个库依赖,感谢你的补充 |
Beta Was this translation helpful? Give feedback.
v2.4.1 已实现,参考如下代码: