# Path: cum/scrapers/base.py
# class BaseSeries(metaclass=ABCMeta):
# class BaseChapter(metaclass=ABCMeta):
#     def __init__(self, url, **kwargs):
#     def alias(self):
#     def follow(self, ignore=False):
#     def get_chapters(self):
#     def name(self):
#     def update(self):
#     def __init__(self, *args, **kwargs):
#     def _strip_unwanted_characters(self, path):
#     def _windows_name_directory(self, directory):
#     def available(self):
#     def create_directory(self, directory):
#     def create_zip(self, files):
#     def db_remove(self):
#     def download(self):
#     def filename(self):
#     def from_url(url):
#     def get(self, use_db=True):
#     def guess_extension(mime_type):
#     def ignore(self):
#     def mark_downloaded(self):
#     def mark_new(self):
#     def page_download_finish(bar, files, fs):
#     def page_download_task(page_num, r):
#     def progress_bar(self, arg):
#     def save(self, series, ignore=False):
#         KEEP_CHARACTERS = [' ', '.', '-', '_', '[', ']', '/', "'"]


from cum.scrapers.base import BaseChapter, BaseSeries, download_pool
from functools import partial
from urllib.parse import urljoin
import concurrent.futures
import re
import requests
        jurl = url + '.json'
        self.json = requests.get(jurl).json()
        self.chapters = self.get_chapters()

    def get_chapters(self):
        chapters = []
        for t in self.json['taggings']:
            if 'permalink' in t and 'title' in t:
                name_parts = re.search(name_re, t['title'])
                if not name_parts:
                    name_parts = re.search(fallback_re, t['title'])
                    chapter = name_parts.group('num')
                elif name_parts.group('type') == 'Special':
                    chapter = 'Special ' + name_parts.group('num')
                else:
                    chapter = name_parts.group('num')
                title = name_parts.group('title')
                url = urljoin('https://dynasty-scans.com/chapters/',
                              t['permalink'])
                c = DynastyScansChapter(name=self.name, alias=self.alias,
                                        chapter=chapter, url=url, title=title)
                chapters.append(c)
        return chapters

    @property
    def name(self):
        return self.json['name']


class DynastyScansChapter(BaseChapter):

# Path: cum/scrapers/base.py
# class BaseSeries(metaclass=ABCMeta):
# class BaseChapter(metaclass=ABCMeta):
#     def __init__(self, url, **kwargs):
#     def alias(self):
#     def follow(self, ignore=False):
#     def get_chapters(self):
#     def name(self):
#     def update(self):
#     def __init__(self, *args, **kwargs):
#     def _strip_unwanted_characters(self, path):
#     def _windows_name_directory(self, directory):
#     def available(self):
#     def create_directory(self, directory):
#     def create_zip(self, files):
#     def db_remove(self):
#     def download(self):
#     def filename(self):
#     def from_url(url):
#     def get(self, use_db=True):
#     def guess_extension(mime_type):
#     def ignore(self):
#     def mark_downloaded(self):
#     def mark_new(self):
#     def page_download_finish(bar, files, fs):
#     def page_download_task(page_num, r):
#     def progress_bar(self, arg):
#     def save(self, series, ignore=False):
#         KEEP_CHARACTERS = [' ', '.', '-', '_', '[', ']', '/', "'"]


# Path: cum/scrapers/dynastyscans.py
from cum.scrapers.base import BaseChapter, BaseSeries, download_pool
from functools import partial
from urllib.parse import urljoin
import concurrent.futures
import re
import requests

        jurl = url + '.json'
        self.json = requests.get(jurl).json()
        self.chapters = self.get_chapters()

    def get_chapters(self):
        chapters = []
        for t in self.json['taggings']:
            if 'permalink' in t and 'title' in t:
                name_parts = re.search(name_re, t['title'])
                if not name_parts:
                    name_parts = re.search(fallback_re, t['title'])
                    chapter = name_parts.group('num')
                elif name_parts.group('type') == 'Special':
                    chapter = 'Special ' + name_parts.group('num')
                else:
                    chapter = name_parts.group('num')
                title = name_parts.group('title')
                url = urljoin('https://dynasty-scans.com/chapters/',
                              t['permalink'])
                c = DynastyScansChapter(name=self.name, alias=self.alias,
                                        chapter=chapter, url=url, title=title)
                chapters.append(c)
        return chapters

    @property
    def name(self):
        return self.json['name']


class DynastyScansChapter(BaseChapter):

    url_re = re.compile(r'https?://dynasty-scans\.com/chapters/')