Code Duplication    Length = 24-24 lines in 2 locations

comics.py 2 locations

@@ 3292-3315 (lines=24) @@
3289
        }
3290
3291
3292
class TuMourrasMoinsBete(GenericNavigableComic):
3293
    """Class to retrieve Tu Mourras Moins Bete comics."""
3294
    name = 'mourrasmoinsbete'
3295
    long_name = 'Tu Mourras Moins Bete'
3296
    url = 'http://tumourrasmoinsbete.blogspot.fr'
3297
    _categories = ('FRANCAIS', )
3298
    get_first_comic_link = simulate_first_link
3299
    first_url = 'http://tumourrasmoinsbete.blogspot.fr/2008/06/essai.html'
3300
3301
    @classmethod
3302
    def get_navi_link(cls, last_soup, next_):
3303
        """Get link to next or previous comic."""
3304
        return last_soup.find('a', id='Blog1_blog-pager-newer-link' if next_ else 'Blog1_blog-pager-older-link')
3305
3306
    @classmethod
3307
    def get_comic_info(cls, soup, link):
3308
        """Get information about a particular comics."""
3309
        title = soup.find('title').string
3310
        imgs = soup.find('div', itemprop='description articleBody').find_all('img')
3311
        author = soup.find('span', itemprop='author').string
3312
        return {
3313
            'img': [i['src'] for i in imgs],
3314
            'author': author,
3315
            'title': title,
3316
        }
3317
3318
@@ 3134-3157 (lines=24) @@
3131
        }
3132
3133
3134
class EarthExplodes(GenericNavigableComic):
3135
    """Class to retrieve The Earth Explodes comics."""
3136
    name = 'earthexplodes'
3137
    long_name = 'The Earth Explodes'
3138
    url = 'http://www.earthexplodes.com'
3139
    get_url_from_link = join_cls_url_to_href
3140
    get_first_comic_link = simulate_first_link
3141
    first_url = 'http://www.earthexplodes.com/comics/000/'
3142
3143
    @classmethod
3144
    def get_navi_link(cls, last_soup, next_):
3145
        """Get link to next or previous comic."""
3146
        return last_soup.find('a', id='next' if next_ else 'prev')
3147
3148
    @classmethod
3149
    def get_comic_info(cls, soup, link):
3150
        """Get information about a particular comics."""
3151
        title = soup.find('title').string
3152
        imgs = soup.find('div', id='image').find_all('img')
3153
        alt = imgs[0].get('title', '')
3154
        return {
3155
            'img': [urljoin_wrapper(cls.url, i['src']) for i in imgs],
3156
            'title': title,
3157
            'alt': alt,
3158
        }
3159
3160