# 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
    @property
    def name(self):
        return self.json['name']


class DynastyScansChapter(BaseChapter):
    url_re = re.compile(r'https?://dynasty-scans\.com/chapters/')
    uses_pages = True

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        if not self.groups:
            self.groups = self.get_groups()

    def download(self):
        data = requests.get(self.url + '.json').json()
        pages = [urljoin('https://dynasty-scans.com',
                 u['url']) for u in data['pages']]
        files = [None] * len(pages)
        futures = []
        with self.progress_bar(pages) as bar:
            for i, page in enumerate(pages):
                r = requests.get(urljoin(self.url, page), stream=True)
                fut = download_pool.submit(self.page_download_task, i, r)
                fut.add_done_callback(partial(self.page_download_finish,
                                              bar, files))
                futures.append(fut)
            concurrent.futures.wait(futures)
            self.create_zip(files)


# 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

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


class DynastyScansChapter(BaseChapter):
    url_re = re.compile(r'https?://dynasty-scans\.com/chapters/')
    uses_pages = True

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        if not self.groups:
            self.groups = self.get_groups()

    def download(self):
        data = requests.get(self.url + '.json').json()
        pages = [urljoin('https://dynasty-scans.com',
                 u['url']) for u in data['pages']]
        files = [None] * len(pages)
        futures = []
        with self.progress_bar(pages) as bar:
            for i, page in enumerate(pages):
                r = requests.get(urljoin(self.url, page), stream=True)
                fut = download_pool.submit(self.page_download_task, i, r)
                fut.add_done_callback(partial(self.page_download_finish,
                                              bar, files))
                futures.append(fut)
            concurrent.futures.wait(futures)
            self.create_zip(files)


    def from_url(url):