<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re

import globalFunctions
import os


class Manganelo():
    def __init__(self, manga_url, download_directory, chapter_range, **kwargs):
        current_directory = kwargs.get("current_directory")
        conversion = kwargs.get("conversion")
        keep_files = kwargs.get("keep_files")
        self.logging = kwargs.get("log_flag")
        self.sorting = kwargs.get("sorting_order")
        self.manga_url = manga_url
        self.print_index = kwargs.get("print_index")

        if "/chapter/" in manga_url:
            self.single_chapter(manga_url=manga_url, download_directory=download_directory,
                                conversion=conversion, keep_files=keep_files)
        else:
            self.full_series(comic_url=self.manga_url, sorting=self.sorting,
                             download_directory=download_directory, chapter_range=chapter_range, conversion=conversion,
                             keep_files=keep_files)

    def single_chapter(self, manga_url, download_directory, conversion, keep_files):
        source, cookies = globalFunctions.GlobalFunctions().page_downloader(manga_url=manga_url)

        if "mangakakalot" in manga_url:
            breadcrumb = source.find('div', {'class': 'breadcrumb'})
            breadcrumb_parts = breadcrumb.findAll('a')
            comic_name = (breadcrumb_parts[1])['title']
            chapter_number = (breadcrumb_parts[2]).find('span').text
        else:  # manganelo.com, manganato.com, readmanganato.com
            breadcrumb = source.find('div', {'class': 'panel-breadcrumb'})
            breadcrumb_parts = breadcrumb.findAll('a')<commit_msg>readmanganato: fix for chapters<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re

import globalFunctions
import os


class Manganelo():
    def __init__(self, manga_url, download_directory, chapter_range, **kwargs):
        current_directory = kwargs.get("current_directory")
        conversion = kwargs.get("conversion")
        keep_files = kwargs.get("keep_files")
        self.logging = kwargs.get("log_flag")
        self.sorting = kwargs.get("sorting_order")
        self.manga_url = manga_url
        self.print_index = kwargs.get("print_index")

        url_split = str(manga_url).split("/")

        if "/chapter/" in manga_url or ("readmanganato" in manga_url and len(url_split) >= 5):
            self.single_chapter(manga_url=manga_url, download_directory=download_directory,
                                conversion=conversion, keep_files=keep_files)
        else:
            self.full_series(comic_url=self.manga_url, sorting=self.sorting,
                             download_directory=download_directory, chapter_range=chapter_range, conversion=conversion,
                             keep_files=keep_files)

    def single_chapter(self, manga_url, download_directory, conversion, keep_files):
        source, cookies = globalFunctions.GlobalFunctions().page_downloader(manga_url=manga_url)

        if "mangakakalot" in manga_url:
            breadcrumb = source.find('div', {'class': 'breadcrumb'})
            breadcrumb_parts = breadcrumb.findAll('a')
            comic_name = (breadcrumb_parts[1])['title']
            chapter_number = (breadcrumb_parts[2]).find('span').text
        else:  # manganelo.com, manganato.com, readmanganato.com
            breadcrumb = source.find('div', {'class': 'panel-breadcrumb'})
            breadcrumb_parts = breadcrumb.findAll('a')
{'fraction_non_alphanumeric': 0.11285266457680251, 'fraction_numerical': 0.001994870333428327, 'mean_word_length': 2.961625282167043, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '635302', 'n_tokens_mistral': 1065, 'n_tokens_neox': 1031, 'n_words': 171}