Closed Kimbyeoungjang closed 2 years ago
note I can't find about that how {"data-media-id": True} tag works in beautiful soup's find_all method. Is this purpose for a find data-media-id tag?
So I'm only trying to get images hosted on kemono.party's servers. While this fixes it for this post it will cause errors on files that are not hosted on kemono.party. Unfortunately I really only tested getting those inline on patreon posts, on patreon posts all kemono.party hosted inline images have the tag "data-media-id". I will look into a better method of only getting only kemono.party hosted inline images.
plz fix this
plz fix this
This was already fixed
could you give me the commit link?
45dad84
ty, but now i got this error on some user on patreon
INFO:Skipping post | post already archived
Traceback (most recent call last):
File "F:\downloader\kemono.party\kemono-dl-main\kemono-dl.py", line 4, in <module>
main()
File "F:\downloader\kemono.party\kemono-dl-main\src\main.py", line 670, in main
downloader(get_args())
File "F:\downloader\kemono.party\kemono-dl-main\src\main.py", line 95, in __init__
self.start_download()
File "F:\downloader\kemono.party\kemono-dl-main\src\main.py", line 656, in start_download
self.get_favorites('kemono.party', 'artist', self.k_fav_users)
File "F:\downloader\kemono.party\kemono-dl-main\src\main.py", line 126, in get_favorites
self.get_post(f"https://{domain}/{favorite['service']}/user/{favorite['id']}")
File "F:\downloader\kemono.party\kemono-dl-main\src\main.py", line 162, in get_post
post = self.clean_post(post, user, site)
File "F:\downloader\kemono.party\kemono-dl-main\src\main.py", line 326, in clean_post
content_soup = self.get_inline_images(new_post, content_soup)
File "F:\downloader\kemono.party\kemono-dl-main\src\main.py", line 231, in get_inline_images
inline_images = [inline_image for inline_image in content_soup.find_all("img") if inline_image['src'][0] == '/']
File "F:\downloader\kemono.party\kemono-dl-main\src\main.py", line 231, in <listcomp>
inline_images = [inline_image for inline_image in content_soup.find_all("img") if inline_image['src'][0] == '/']
File "C:\Python\Python310\lib\site-packages\bs4\element.py", line 1519, in __getitem__
return self.attrs[key]
KeyError: 'src'
https://kemono.party/fanbox/user/3188698/post/420615
This link is one of the example
:Before remove arg .
in screenshot, BeautifulSoup normally parse html content but after I print inline_images, there is no data in array
:After remove arg
Now normally download inline content from link.