Code Duplication    Length = 24-24 lines in 2 locations

comics.py 2 locations

@@ 3456-3479 (lines=24) @@
3453
        }
3454
3455
3456
class TuMourrasMoinsBete(GenericNavigableComic):
3457
    """Class to retrieve Tu Mourras Moins Bete comics."""
3458
    name = 'mourrasmoinsbete'
3459
    long_name = 'Tu Mourras Moins Bete'
3460
    url = 'http://tumourrasmoinsbete.blogspot.fr'
3461
    _categories = ('FRANCAIS', )
3462
    get_first_comic_link = simulate_first_link
3463
    first_url = 'http://tumourrasmoinsbete.blogspot.fr/2008/06/essai.html'
3464
3465
    @classmethod
3466
    def get_navi_link(cls, last_soup, next_):
3467
        """Get link to next or previous comic."""
3468
        return last_soup.find('a', id='Blog1_blog-pager-newer-link' if next_ else 'Blog1_blog-pager-older-link')
3469
3470
    @classmethod
3471
    def get_comic_info(cls, soup, link):
3472
        """Get information about a particular comics."""
3473
        title = soup.find('title').string
3474
        imgs = soup.find('div', itemprop='description articleBody').find_all('img')
3475
        author = soup.find('span', itemprop='author').string
3476
        return {
3477
            'img': [i['src'] for i in imgs],
3478
            'author': author,
3479
            'title': title,
3480
        }
3481
3482
@@ 3242-3265 (lines=24) @@
3239
        }
3240
3241
3242
class EarthExplodes(GenericNavigableComic):
3243
    """Class to retrieve The Earth Explodes comics."""
3244
    name = 'earthexplodes'
3245
    long_name = 'The Earth Explodes'
3246
    url = 'http://www.earthexplodes.com'
3247
    get_url_from_link = join_cls_url_to_href
3248
    get_first_comic_link = simulate_first_link
3249
    first_url = 'http://www.earthexplodes.com/comics/000/'
3250
3251
    @classmethod
3252
    def get_navi_link(cls, last_soup, next_):
3253
        """Get link to next or previous comic."""
3254
        return last_soup.find('a', id='next' if next_ else 'prev')
3255
3256
    @classmethod
3257
    def get_comic_info(cls, soup, link):
3258
        """Get information about a particular comics."""
3259
        title = soup.find('title').string
3260
        imgs = soup.find('div', id='image').find_all('img')
3261
        alt = imgs[0].get('title', '')
3262
        return {
3263
            'img': [urljoin_wrapper(cls.url, i['src']) for i in imgs],
3264
            'title': title,
3265
            'alt': alt,
3266
        }
3267
3268