Repository: dipu-bd/lightnovel-crawler (language: python)

Issue:
Create FUNDING.yml



Discussion / hints:

Fix patch:
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 000000000..d103a265c
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1,12 @@
+# These are supported funding model platforms
+
+github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
+patreon: # Replace with a single Patreon username
+open_collective: lightnovel-crawler
+ko_fi: # Replace with a single Ko-fi username
+tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+bitcoin: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/README.md b/README.md
index 1ff1d68a9..991bafe77 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,6 @@
 <!-- [![AppVeyor](https://img.shields.io/appveyor/build/dipu-bd/lightnovel-crawler?logo=appveyor)](https://ci.appveyor.com/project/dipu-bd/lightnovel-crawler) -->
 <!-- [![travis-ci](https://travis-ci.com/dipu-bd/lightnovel-crawler.svg?branch=master)](https://travis-ci.com/dipu-bd/lightnovel-crawler) -->
 
-
 An app to download novels from online sources and generate e-books.
 
 > **Discord: [https://discord.gg/wMECG2Q](https://discord.gg/wMECG2Q)**
diff --git a/sources/ixdzs.py b/sources/ixdzs.py
new file mode 100644
index 000000000..99b340849
--- /dev/null
+++ b/sources/ixdzs.py
@@ -0,0 +1,79 @@
+# -*- coding: utf-8 -*-
+import logging
+from lncrawl.core.crawler import Crawler
+
+logger = logging.getLogger(__name__)
+search_url = 'https://tw.m.ixdzs.com/search?k=%s'
+
+
+class IxdzsCrawler(Crawler):
+
+    base_url = ['https://tw.m.ixdzs.com/']
+
+
+    def search_novel(self, query):
+        query = query.lower().replace(' ', '+')
+        soup = self.get_soup(search_url % query)
+        results = []
+
+        for data in soup.select('ul.ix-list.ix-border-t li div.ix-list-info.ix-border-t.burl'):
+            title = data.select_one('h3 a').get_text().strip()
+            url = self.absolute_url(
+                data.select_one('h3 a')['href']
+            )
+            results.append(
+                {
+                    'title': title,
+                    'url': url,
+                }
+            )
+        return results
+    # end def
+
+    def read_novel_info(self):
+            '''Get novel title, author, cover etc'''
+            logger.debug('Visiting %s', self.novel_url)
+            soup = self.get_soup(self.novel_url)
+
+            self.novel_title = soup.select_one('header.ix-header.ix-border.ix-page h1').get_text()
+            logger.info(f'Novel title: {self.novel_title}')
+
+            self.novel_author = soup.select_one('div.ix-list-info.ui-border-t p').get_text()[3:]
+            logger.info(f'Novel Author: {self.novel_author}')
+
+            self.novel_cover = soup.select_one('div.ix-list-img-square img')['src']
+            logger.info(f'Novel Cover: {self.novel_cover}')
+            
+            logger.info('Getting chapters...')
+            for chapter in soup.select("ul.chapter li a"):       
+                title = chapter.get_text()
+                url = self.absolute_url(chapter['href'])
+
+                chap_id = len(self.chapters) + 1
+                if len(self.chapters) % 100 == 0:
+                    vol_id = chap_id//100 + 1
+                    vol_title = 'Volume ' + str(vol_id)
+                    self.volumes.append({
+                        'id': vol_id,
+                        'title': vol_title
+                    })
+
+                self.chapters.append({
+                    'id': chap_id,
+                    'title': title,
+                    'url': url,
+                    'volume': vol_id
+                })
+    # end def
+
+    def download_chapter_body(self, chapter):
+
+        logger.info(f"Downloading {chapter['url']}")
+        soup = self.get_soup(chapter['url'])
+
+        content = soup.select("article.page-content section p")
+        content = '\n'.join(str(p) for p in content)
+        
+        return content
+    # end def
+# end class


Test patch:
diff --git a/lncrawl/bots/test/test_inputs.py b/lncrawl/bots/test/test_inputs.py
index d34eb53f9..545cf67cd 100644
--- a/lncrawl/bots/test/test_inputs.py
+++ b/lncrawl/bots/test/test_inputs.py
@@ -363,5 +363,8 @@
     ],
     'https://www.wnmtl.org/': [
         'https://www.wnmtl.org/novel/the-amber-sword/'
+    ],
+    'https://tw.m.ixdzs.com/': [
+        'https://tw.m.ixdzs.com/novel/%E6%88%91%E7%95%B6%E9%99%B0%E9%99%BD%E5%85%88%E7%94%9F%E7%9A%84%E9%82%A3%E5%B9%BE%E5%B9%B4'
     ]
 }