Code Duplication    Length = 24-24 lines in 2 locations

comics.py 2 locations

@@ 3191-3214 (lines=24) @@
3188
            'img': [urljoin_wrapper(cls.url, i['src']) for i in imgs],
3189
        }
3190
3191
3192
class GloryOwlComix(GenericNavigableComic):
3193
    """Class to retrieve Glory Owl comics."""
3194
    name = 'gloryowl'
3195
    long_name = 'Glory Owl'
3196
    url = 'http://gloryowlcomix.blogspot.fr'
3197
    _categories = ('NSFW', 'FRANCAIS')
3198
    get_first_comic_link = simulate_first_link
3199
    first_url = 'http://gloryowlcomix.blogspot.fr/2013/02/1_7.html'
3200
3201
    @classmethod
3202
    def get_navi_link(cls, last_soup, next_):
3203
        """Get link to next or previous comic."""
3204
        return last_soup.find('a', id='Blog1_blog-pager-newer-link' if next_ else 'Blog1_blog-pager-older-link')
3205
3206
    @classmethod
3207
    def get_comic_info(cls, soup, link):
3208
        """Get information about a particular comics."""
3209
        title = soup.find('title').string
3210
        imgs = soup.find_all('link', rel='image_src')
3211
        author = soup.find('a', rel='author').string
3212
        return {
3213
            'img': [i['href'] for i in imgs],
3214
            'author': author,
3215
            'title': title,
3216
        }
3217
@@ 3124-3147 (lines=24) @@
3121
            'img': [i['src'] for i in imgs],
3122
        }
3123
3124
3125
class TuMourrasMoinsBete(GenericNavigableComic):
3126
    """Class to retrieve Tu Mourras Moins Bete comics."""
3127
    name = 'mourrasmoinsbete'
3128
    long_name = 'Tu Mourras Moins Bete'
3129
    url = 'http://tumourrasmoinsbete.blogspot.fr'
3130
    _categories = ('FRANCAIS', )
3131
    get_first_comic_link = simulate_first_link
3132
    first_url = 'http://tumourrasmoinsbete.blogspot.fr/2008/06/essai.html'
3133
3134
    @classmethod
3135
    def get_navi_link(cls, last_soup, next_):
3136
        """Get link to next or previous comic."""
3137
        return last_soup.find('a', id='Blog1_blog-pager-newer-link' if next_ else 'Blog1_blog-pager-older-link')
3138
3139
    @classmethod
3140
    def get_comic_info(cls, soup, link):
3141
        """Get information about a particular comics."""
3142
        title = soup.find('title').string
3143
        imgs = soup.find('div', itemprop='description articleBody').find_all('img')
3144
        author = soup.find('span', itemprop='author').string
3145
        return {
3146
            'img': [i['src'] for i in imgs],
3147
            'author': author,
3148
            'title': title,
3149
        }
3150