L4cache / kemono-dl

(personal fork of) A simple kemono.party downloader using python.
93 stars 14 forks source link

Inline images won't be displayed in the content HTML #13

Closed donmerendolo closed 1 year ago

donmerendolo commented 1 year ago

Version

Version: 2022.04.28 (commit 8e64273ee)

Your Command


python kemono-dl.py --links https://kemono.party/patreon/user/37159802/post/72681481 --cookies ../cookies.txt --content --inline

Description of bug

Inline images won't be displayed in the content HTML of a post due to an incorrect path. Take this post for example: the path of the first image is Downloads\patreon\stuffmadehere [37159802]\[20221002] [72681481] Operation tiny box\inline\1_9f3330bd3d47883e403a2d9f9ebea0f7ac189d6414143e8375fa912d50e61504.jpg which doesn't show it. Changing it to the relative path .\inline\1_9f3330bd3d47883e403a2d9f9ebea0f7ac189d6414143e8375fa912d50e61504.jpg fixes it.

How To Reproduce

Download a post that has inline images with the --inline and --content options and open the generated HTML file.

donmerendolo commented 1 year ago

I've changed inline_image['src'] = file['file_path'] for inline_image['src'] = os.path.join(*re.split(r'\\|/', file['file_path'])[-2:]) in get_inline_images() in src/main.py. It works for me but it's not a general fix, as it doesn't take into account the pattern, right?

L4cache commented 1 year ago

i'll investigate this.

L4cache commented 1 year ago

fixed (probably), please check

donmerendolo commented 1 year ago

Working well here. Thank you 😄