<commit_before>import urllib2
import logging
from httplib import BadStatusLine
from flexget.feed import Entry
from flexget.plugin import *
from flexget.utils.soup import get_soup
from BeautifulSoup import NavigableString

log = logging.getLogger('scenereleases')

class InputScenereleases:
    """
        Uses scenereleases.info category url as input.

        Example:

        scenereleases: http://scenereleases.info/category/movies/movies-dvd-rip
    """
    def validator(self):
        from flexget import validator
        return validator.factory('url')
        

    def parse_site(self, url, feed):
        """Parse configured url and return releases array"""
        
        page = urllib2.urlopen(url)
        soup = get_soup(page)
            
        releases = []
        for entry in soup.findAll('div', attrs={'class':'entry'}):
            release = {}
            title = entry.find('h2')
            if not title:
                log.debug('No h2 entrytitle')
                continue
            release['title'] = title.a.contents[0].strip()

            log.debug('Processing title %s' % (release['title']))

            for link in entry.findAll('a'):
                link_name = link.contents[0]
                if link_name is None:<commit_msg>Fixes #329, if not re-open the ticket<commit_after>import urllib2
import logging
from httplib import BadStatusLine
from flexget.feed import Entry
from flexget.plugin import *
from flexget.utils.soup import get_soup
from BeautifulSoup import NavigableString

log = logging.getLogger('scenereleases')

class InputScenereleases:
    """
        Uses scenereleases.info category url as input.

        Example:

        scenereleases: http://scenereleases.info/category/movies/movies-dvd-rip
    """
    def validator(self):
        from flexget import validator
        return validator.factory('url')
        

    def parse_site(self, url, feed):
        """Parse configured url and return releases array"""
        
        page = urllib2.urlopen(url)
        soup = get_soup(page)
            
        releases = []
        for entry in soup.findAll('div', attrs={'class':'entry'}):
            release = {}
            title = entry.find('h2')
            if not title:
                log.debug('No h2 entrytitle')
                continue
            release['title'] = title.a.contents[0].strip()

            log.debug('Processing title %s' % (release['title']))

            for link in entry.findAll('a'):
                # no content in the link
                if not link.contents:
                    continue
                link_name = link.contents[0]
                if link_name is None:
{'fraction_non_alphanumeric': 0.09865470852017937, 'fraction_numerical': 0.005605381165919282, 'mean_word_length': 2.073478760045924, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '7644538', 'n_tokens_mistral': 762, 'n_tokens_neox': 716, 'n_words': 196}