You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
script_dir=os.path.dirname(os.path.abspath(__file__)) <--Thisisusedtoworkinthescript'sfolderregardlessofwhereitiscalled.
filenamePattern='\"[{id}] {title} - {index}.{ext}\"'downloadFolder=os.path.join(script_dir, 'downloads/')
archiveFolder=os.path.join(script_dir, 'archives/')
forartistURL, datainartists.items(): <-'data is a tuple of 2 elements: data[0] being the name of the folder.'outputFolder=os.path.join(downloadFolder, data[0]) <-'Here, outputFolder == /home/user/kemono/downloads''
url, cookie, artist=get_service(artistURL, data)
os.system(f'python ~/git/kemono-dl/kemono-dl.py --verbose --archive {archiveFolder}archive-{artist}.txt 'f'--cookies {cookie} --quiet --filename-pattern {filenamePattern} 'f'--dirname-pattern {outputFolder} --links {url}')
--archive are succesfully writen to and --cookies are succesfully read from the correct path.
When splitting the path, it turns /home/user/kemono/downloads into home/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 the else should fix the issue. cleaned_path = drive + os.path.sep if drive else '/'
The text was updated successfully, but these errors were encountered:
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 '/'
The text was updated successfully, but these errors were encountered: