Code Duplication    Length = 24-24 lines in 2 locations

comics.py 2 locations

@@ 3253-3276 (lines=24) @@
3250
        }
3251
3252
3253
class TuMourrasMoinsBete(GenericNavigableComic):
3254
    """Class to retrieve Tu Mourras Moins Bete comics."""
3255
    name = 'mourrasmoinsbete'
3256
    long_name = 'Tu Mourras Moins Bete'
3257
    url = 'http://tumourrasmoinsbete.blogspot.fr'
3258
    _categories = ('FRANCAIS', )
3259
    get_first_comic_link = simulate_first_link
3260
    first_url = 'http://tumourrasmoinsbete.blogspot.fr/2008/06/essai.html'
3261
3262
    @classmethod
3263
    def get_navi_link(cls, last_soup, next_):
3264
        """Get link to next or previous comic."""
3265
        return last_soup.find('a', id='Blog1_blog-pager-newer-link' if next_ else 'Blog1_blog-pager-older-link')
3266
3267
    @classmethod
3268
    def get_comic_info(cls, soup, link):
3269
        """Get information about a particular comics."""
3270
        title = soup.find('title').string
3271
        imgs = soup.find('div', itemprop='description articleBody').find_all('img')
3272
        author = soup.find('span', itemprop='author').string
3273
        return {
3274
            'img': [i['src'] for i in imgs],
3275
            'author': author,
3276
            'title': title,
3277
        }
3278
3279
@@ 3091-3114 (lines=24) @@
3088
        }
3089
3090
3091
class EarthExplodes(GenericNavigableComic):
3092
    """Class to retrieve The Earth Explodes comics."""
3093
    name = 'earthexplodes'
3094
    long_name = 'The Earth Explodes'
3095
    url = 'http://www.earthexplodes.com'
3096
    get_url_from_link = join_cls_url_to_href
3097
    get_first_comic_link = simulate_first_link
3098
    first_url = 'http://www.earthexplodes.com/comics/000/'
3099
3100
    @classmethod
3101
    def get_navi_link(cls, last_soup, next_):
3102
        """Get link to next or previous comic."""
3103
        return last_soup.find('a', id='next' if next_ else 'prev')
3104
3105
    @classmethod
3106
    def get_comic_info(cls, soup, link):
3107
        """Get information about a particular comics."""
3108
        title = soup.find('title').string
3109
        imgs = soup.find('div', id='image').find_all('img')
3110
        alt = imgs[0].get('title', '')
3111
        return {
3112
            'img': [urljoin_wrapper(cls.url, i['src']) for i in imgs],
3113
            'title': title,
3114
            'alt': alt,
3115
        }
3116
3117