Beispiel #1
0
def start(urls, output_dir=None, cover_path=None, out_format='epub'):
    """
    start the job using url

    Args:
        urls: A string represent the urls which was input by user
        output_dir: A string represent the path of the output EPUB file
        cover_path: A string represent the path of the EPUB cover
        out_format: A string represent the output file format
    """
    for url in urls:
        for cls in [OldLinovel, Dxs, Wenku]:
            if cls.check_url(url):
                novel = cls(url, _SINGLE_THREAD)
                novel.extract_novel_information()
                books = novel.get_novel_information()
                for book in books:
                    epub = Epub(output_dir=output_dir,
                                cover_path=cover_path,
                                out_format=out_format,
                                **book)
                    epub.generate_file()
                break
        else:
            print('URL "{}" is invalid'.format(url))
Beispiel #2
0
def start(url, output_dir=None, cover_path=None):
    s = Series(url=url)
    s.getInfo()
    volumes = s.selectVolumes()
    volumeInfos = s.info(volumes)
    
    for volumeInfo in volumeInfos:  
        epub = Epub(output_dir=None, cover_path=None, **volumeInfo)
        epub.generate_file()
        print 'Generating Epub'
Beispiel #3
0
def grab_volume(url, output_dir, cover_path, out_format):
    """
    grab volume
    
    Args:
        url: A string represent the url which was input by user
        output_dir: A string represent the path of the output EPUB file
        cover_file: A string represent the path of the EPUB cover
        out_format: A string represent the output format
    """
    try:
        print('Getting:' + url)
        novel = Novel(url=url, single_thread=_SINGLE_THREAD)
        novel.get_novel_information()
        epub = Epub(output_dir=output_dir, cover_path=cover_path, out_format=out_format, **novel.novel_information())
        epub.generate_file()

    except Exception as e:
        print('错误', str(e) + '\nAt:' + url)
        raise e
Beispiel #4
0
def start(urls, output_dir=None, cover_path=None, out_format='epub'):
    """
    start the job using url

    Args:
        urls: A string represent the urls which was input by user
        output_dir: A string represent the path of the output EPUB file
        cover_path: A string represent the path of the EPUB cover
        out_format: A string represent the output file format
    """
    for url in urls:
        for cls in [OldLinovel]:
            if cls.check_url(url):
                novel = cls(url, _SINGLE_THREAD)
                novel.extract_novel_information()
                books = novel.get_novel_information()
                for book in books:
                    epub = Epub(output_dir=output_dir, cover_path=cover_path, out_format=out_format, **book)
                    epub.generate_file()
                break
        else:
            print('URL "{}" is invalid'.format(url))