Skip to content

Commit

Permalink
Merge pull request #2259 from camp00000/mangabuddy
Browse files Browse the repository at this point in the history
Fix mangabuddy chapter downloading
  • Loading branch information
dipu-bd committed Feb 9, 2024
2 parents 6094e6b + 6bd2823 commit d54d43a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sources/en/m/mangabuddy.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class MangaBuddyCrawler(Crawler):
has_manga = True
base_url = "https://mangabuddy.com/"
base_url = ["https://mangabuddy.com/"]

def search_novel(self, query):
query = query.lower().replace(" ", "+")
Expand Down Expand Up @@ -76,7 +76,9 @@ def download_chapter_body(self, chapter):
server = soup.find("script", string=re.compile(r"var mainServer = "))
images = soup.find("script", string=re.compile(r"var chapImages = "))

main_server = re.search(r'var mainServer = "(.*)";', server.text).group(1)
main_server = "" # no "main server" present, in such a case img_list contains full URLs
if server:
main_server = re.search(r'var mainServer = "(.*)";', server.text).group(1)
img_list = (
re.search(r"var chapImages = \'(.*)\'", images.text).group(1).split(",")
)
Expand Down

0 comments on commit d54d43a

Please sign in to comment.