fix(novelpia): attribute error

This commit is contained in:
Ryu juheon 2022-04-06 22:52:47 +09:00 committed by GitHub
parent b9eccc70c4
commit f9cf582a69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ import requests
@Downloader.register
class Downloader_novelpia(Downloader):
type = "novelpia"
type = "test_novelpia"
URLS = ["novelpia.com"]
def __get_number(self, url: str) -> str:
@ -88,7 +88,7 @@ class Downloader_novelpia(Downloader):
# Maybe NavigableString here too?
assert isinstance(img, Tag)
src = img.attrs["src"]
filename = img.attrs["data-filename"]
filename = img.get("data-filename") or "cover.jpg"
f.write(f"[{filename}]".encode("UTF-8"))
self.urls.append(f"https:{src}")
else: