Code Duplication    Length = 16-17 lines in 2 locations

comics.py 2 locations

@@ 4940-4956 (lines=17) @@
4937
4938
4939
class ItFoolsAMonster(GenericTumblrV1):
4940
    """Class to retrieve It Fools A Monster comics."""
4941
    name = 'itfoolsamonster'
4942
    long_name = 'It Fools A Monster'
4943
    url = 'http://itfoolsamonster.com'
4944
4945
4946
class BoumeriesTumblr(GenericTumblrV1):
4947
    """Class to retrieve Boumeries comics."""
4948
    # Also on http://bd.boumerie.com
4949
    # Also on http://comics.boumerie.com
4950
    name = 'boumeries-tumblr'
4951
    long_name = 'Boumeries (from Tumblr)'
4952
    url = 'http://boumeries.tumblr.com/'
4953
    _categories = ('BOUMERIES', )
4954
4955
4956
class InfiniteImmortalBensTumblr(GenericTumblrV1):
4957
    """Class to retrieve Infinite Immortal Bens comics."""
4958
    # Also on http://www.webtoons.com/en/challenge/infinite-immortal-bens/list?title_no=32847
4959
    # Also on https://tapas.io/series/Infinite-Immortal-Bens
@@ 782-797 (lines=16) @@
779
    get_navi_link = get_link_rel_next
780
    get_url_from_link = join_cls_url_to_href
781
782
    @classmethod
783
    def get_comic_info(cls, soup, link):
784
        """Get information about a particular comics."""
785
        short_url_re = re.compile('^%s/\\?p=([0-9]*)' % cls.url)
786
        short_url = cls.get_url_from_link(soup.find('link', rel='shortlink'))
787
        num = int(short_url_re.match(short_url).groups()[0])
788
        imgs = soup.find('div', id='comic').find_all('img')
789
        assert len(imgs) == 1, imgs
790
        title = imgs[0]['alt']
791
        title2 = imgs[0]['title']
792
        return {
793
            'short_url': short_url,
794
            'title': title,
795
            'title2': title2,
796
            'img': [urljoin_wrapper(cls.url, i['src']) for i in imgs],
797
            'num': num,
798
        }
799
800