<commit_before>import re

import requests
from bs4 import BeautifulSoup


class Anime1Me:
    def getData(self, url):
        data = {
            'episodes': 0
        }
        text = requests.get(url).text
        soup = BeautifulSoup(text, 'html.parser')
        title = soup.find('h1', {'class': 'page-title'}).text

        # print('title', title)
        text = requests.get('https://anime1.me').text
        m = re.search(r'>{}</a></td><td class=\"column-2\">(.+?)</td>'.format(re.escape(title)), text)
        if m:
            episodes = m.group(1)
            data['episodes'] = self._parse_episodes(episodes)
        else:
            # print('Not match')
            pass

        return data

    def _parse_episodes(self, episodes):
        if episodes == '劇場版':
            return 1

        m = re.match(r'^連載中\((\d+)\)$', episodes)
        if m:
            return int(m.group(1))

        m = re.match(r'^1-(\d+)$', episodes)
        if m:
            return int(m.group(1))

        raise Exception('Unknwon episodes format: {}'.format(episodes))<commit_msg>Add new episodes format<commit_after>import re

import requests
from bs4 import BeautifulSoup


class Anime1Me:
    def getData(self, url):
        data = {
            'episodes': 0
        }
        text = requests.get(url).text
        soup = BeautifulSoup(text, 'html.parser')
        title = soup.find('h1', {'class': 'page-title'}).text

        # print('title', title)
        text = requests.get('https://anime1.me').text
        m = re.search(r'>{}</a></td><td class=\"column-2\">(.+?)</td>'.format(re.escape(title)), text)
        if m:
            episodes = m.group(1)
            data['episodes'] = self._parse_episodes(episodes)
        else:
            # print('Not match')
            pass

        return data

    def _parse_episodes(self, episodes):
        if episodes == '劇場版':
            return 1

        m = re.match(r'^連載中\((\d+)\)$', episodes)
        if m:
            return int(m.group(1))

        m = re.match(r'^1-(\d+)$', episodes)
        if m:
            return int(m.group(1))

        m = re.match(r'^1-(\d+)\+(\d+)$', episodes)
        if m:
            if int(m.group(1)) + 1 == int(m.group(2)):
                return int(m.group(2))

        raise Exception('Unknwon episodes format: {}'.format(episodes))
{'fraction_non_alphanumeric': 0.17017619252256125, 'fraction_numerical': 0.011602922217447357, 'mean_word_length': 1.8847583643122676, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6240522', 'n_tokens_mistral': 790, 'n_tokens_neox': 769, 'n_words': 157}