Closed Deses closed 2 months ago
Hi,
Hmm, this should be platform related code, change that line may break in Windows. Let me see if there are any other workarounds.
Thanks for your perfect investigation, it is caused by that line of code. Try to fix with not well-tested code, hope it won't break anything :>
Please check if works on your side.
I have a python script that calls kemono-dl. This script has all its paths defined with
__file__
, (but it also fails using the tilde~
, as in '~/user/kemono/downloads') which kemono-dl takes correctly but processes incorrectly, because it strips the first/
and writes the files to the wrong location.My simplified script:
--archive
are succesfully writen to and--cookies
are succesfully read from the correct path.The fault seems it's here:
When splitting the path, it turns
/home/user/kemono/downloads
intohome/user/kemono/downloads
, this creating a whole tree of folders and writing to the wrong path.I understand this is made to be compatible with both Windows and Linux, but I don't think this behavior is correct.
Changing the line with
cleaned_path = drive + os.path.sep if drive else ''
and adding a/
to theelse
should fix the issue.cleaned_path = drive + os.path.sep if drive else '/'