Closed shodanwang closed 10 months ago
The most likely reason is the 'json' here https://github.com/L4cache/kemono-dl/blob/e329ef093d75706b49384f21f7ebd49451b6507f/src/main.py#L180 is expected to be a list that contains dict(s) of each post content, but if input link is post link, it produces dict only, without the list 'shell' outside. This could be a changed behavior, because I don't remember encountered this problem. Turning it into a list with single member 'fixes' the problem, I don't know if it is too crude, please comment.
Not the original issue reporter, but having the same problem, hoping these error reports can help:
Prior to this change, using b332e0ab799eafcea9b2970cee85ce70507db87b, error:
ERROR:Unable to get posts for https://coomer.party/onlyfans/user/<redacted>
Traceback (most recent call last):
File "~/kemono-dl/src/main.py", line 825, in start_download
self.get_post(url)
File "~/kemono-dl/src/main.py", line 188, in get_post
post['site']=site
TypeError: 'str' object does not support item assignment
After this change, using e329ef093d75706b49384f21f7ebd49451b6507f, different error:
ERROR:Unable to get posts for https://coomer.party/onlyfans/user/<redacted>
Traceback (most recent call last):
File "~/kemono-dl/src/main.py", line 827, in start_download
self.get_post(url)
File "~/kemono-dl/src/main.py", line 192, in get_post
if self.skip_post(post,True):
File "~/kemono-dl/src/main.py", line 658, in skip_post
if "https://{site}/{service}/user/{user}/post/{id}".format(**post) in self.archive_list:
KeyError: 'service'
Not the original issue reporter, but having the same problem, hoping these error reports can help:
Prior to this change, using b332e0a, error:
ERROR:Unable to get posts for https://coomer.party/onlyfans/user/<redacted> Traceback (most recent call last): File "~/kemono-dl/src/main.py", line 825, in start_download self.get_post(url) File "~/kemono-dl/src/main.py", line 188, in get_post post['site']=site TypeError: 'str' object does not support item assignment
After this change, using e329ef0, different error:
ERROR:Unable to get posts for https://coomer.party/onlyfans/user/<redacted> Traceback (most recent call last): File "~/kemono-dl/src/main.py", line 827, in start_download self.get_post(url) File "~/kemono-dl/src/main.py", line 192, in get_post if self.skip_post(post,True): File "~/kemono-dl/src/main.py", line 658, in skip_post if "https://{site}/{service}/user/{user}/post/{id}".format(**post) in self.archive_list: KeyError: 'service'
Is the latter of mentioned errors happens when the download is near finished? This one is probably caused by the 'chunk_size' (offset factor) has been changed to 50 as well in coomer, like in kemono some time ago. Please check the latest change.
Is the latter of mentioned errors happens when the download is near finished? This one is probably caused by the 'chunk_size' (offset factor) has been changed to 50 as well in coomer, like in kemono some time ago. Please check the latest change.
As I understand it, the errors were occurring before any download could occur (the parsing of the link/post, "unable to get posts" thus no download) so I don't think it could have been when anything was near finished.
However, now trying same after updating to 7d19bbeb5d42c2d619323c237d378caa375813fa seems to be working with no errors. Thanks!
@shodanwang you should try again too, see if this also fixes for you.
As I understand it, the errors were occurring before any download could occur (the parsing of the link/post, "unable to get posts" thus no download) so I don't think it could have been when anything was near finished.
I said 'near finished' in the pseudo-for post in user
context, not individual files.
If the total posts of the user is > 50, then it would fall under the len(json)==50
check, makes first few 'pages of posts' download flawlessly, the problem appears when the posts in the page is < 50 (which often happens in last 'page of posts', and is always the case if total posts of the user is < 50).
Even then, the 'next page' request will only occur when 'current page' is finished, which actually contains complete last posts (or all posts if total posts < 50), if the request is successful it will only return overlapped result. (so it's even 'after finished' not 'near finish', probably)
At least that's my theory.
And I think the api behavior is changed as well, I remember it would actually return the aforementioned 'overlapped results' before, but it will return {"error":"offset not multiple of 50"}
now.
Overlapped results doesn't break the mechanism, they will be skipped immediately, but can cause excessive load on the server, return error breaks things but save server, I think it's better this way.
Can confirm that updating to 7d19bbe fixes the issue. Thank you @L4cache @reasonabledoubt for helping, I'll close the issue now.
Version
Version:
2022.04.28
( b332e0ab799eafcea9b2970cee85ce70507db87b ) Version string seems not updated. The commit hash is the latest in this repo.Your Command
Description of bug
It will fail to download the post and show the following error message:
How To Reproduce
Run the above command with any kemono.party post link.
Error messages and tracebacks
Additional comments
Any idea how to fix the issue ?