Code Duplication    Length = 24-24 lines in 3 locations

comics.py 3 locations

@@ 3419-3442 (lines=24) @@
3416
            'img': [urljoin_wrapper(cls.url, i['src']) for i in imgs],
3417
        }
3418
3419
3420
class GloryOwlComix(GenericNavigableComic):
3421
    """Class to retrieve Glory Owl comics."""
3422
    name = 'gloryowl'
3423
    long_name = 'Glory Owl'
3424
    url = 'http://gloryowlcomix.blogspot.fr'
3425
    _categories = ('NSFW', 'FRANCAIS')
3426
    get_first_comic_link = simulate_first_link
3427
    first_url = 'http://gloryowlcomix.blogspot.fr/2013/02/1_7.html'
3428
3429
    @classmethod
3430
    def get_navi_link(cls, last_soup, next_):
3431
        """Get link to next or previous comic."""
3432
        return last_soup.find('a', id='Blog1_blog-pager-newer-link' if next_ else 'Blog1_blog-pager-older-link')
3433
3434
    @classmethod
3435
    def get_comic_info(cls, soup, link):
3436
        """Get information about a particular comics."""
3437
        title = soup.find('title').string
3438
        imgs = soup.find_all('link', rel='image_src')
3439
        author = soup.find('a', rel='author').string
3440
        return {
3441
            'img': [i['href'] for i in imgs],
3442
            'author': author,
3443
            'title': title,
3444
        }
3445
@@ 3352-3375 (lines=24) @@
3349
            'year': day.year,
3350
        }
3351
3352
3353
class TuMourrasMoinsBete(GenericNavigableComic):
3354
    """Class to retrieve Tu Mourras Moins Bete comics."""
3355
    name = 'mourrasmoinsbete'
3356
    long_name = 'Tu Mourras Moins Bete'
3357
    url = 'http://tumourrasmoinsbete.blogspot.fr'
3358
    _categories = ('FRANCAIS', )
3359
    get_first_comic_link = simulate_first_link
3360
    first_url = 'http://tumourrasmoinsbete.blogspot.fr/2008/06/essai.html'
3361
3362
    @classmethod
3363
    def get_navi_link(cls, last_soup, next_):
3364
        """Get link to next or previous comic."""
3365
        return last_soup.find('a', id='Blog1_blog-pager-newer-link' if next_ else 'Blog1_blog-pager-older-link')
3366
3367
    @classmethod
3368
    def get_comic_info(cls, soup, link):
3369
        """Get information about a particular comics."""
3370
        title = soup.find('title').string
3371
        imgs = soup.find('div', itemprop='description articleBody').find_all('img')
3372
        author = soup.find('span', itemprop='author').string
3373
        return {
3374
            'img': [i['src'] for i in imgs],
3375
            'author': author,
3376
            'title': title,
3377
        }
3378
@@ 3162-3185 (lines=24) @@
3159
            'day': day.day,
3160
        }
3161
3162
3163
class EarthExplodes(GenericNavigableComic):
3164
    """Class to retrieve The Earth Explodes comics."""
3165
    name = 'earthexplodes'
3166
    long_name = 'The Earth Explodes'
3167
    url = 'http://www.earthexplodes.com'
3168
    get_url_from_link = join_cls_url_to_href
3169
    get_first_comic_link = simulate_first_link
3170
    first_url = 'http://www.earthexplodes.com/comics/000/'
3171
3172
    @classmethod
3173
    def get_navi_link(cls, last_soup, next_):
3174
        """Get link to next or previous comic."""
3175
        return last_soup.find('a', id='next' if next_ else 'prev')
3176
3177
    @classmethod
3178
    def get_comic_info(cls, soup, link):
3179
        """Get information about a particular comics."""
3180
        title = soup.find('title').string
3181
        imgs = soup.find('div', id='image').find_all('img')
3182
        alt = imgs[0].get('title', '')
3183
        return {
3184
            'img': [urljoin_wrapper(cls.url, i['src']) for i in imgs],
3185
            'title': title,
3186
            'alt': alt,
3187
        }
3188