Code Duplication    Length = 16-17 lines in 2 locations

comics.py 2 locations

@@ 4666-4682 (lines=17) @@
4663
    """Class to retrieve Brooklyn Cartoons."""
4664
    # Also on https://www.brooklyncartoons.com
4665
    # Also on https://www.instagram.com/brooklyncartoons
4666
    name = 'brooklyn-tumblr'
4667
    long_name = 'Brooklyn Cartoons (from Tumblr)'
4668
    url = 'http://brooklyncartoons.tumblr.com'
4669
4670
4671
class GemmaCorrellTumblr(GenericTumblrV1):
4672
    # Also on http://www.gemmacorrell.com/portfolio/comics/
4673
    name = 'gemma-tumblr'
4674
    long_name = 'Gemma Correll (from Tumblr)'
4675
    url = 'http://gemmacorrell.tumblr.com'
4676
4677
4678
class RobotatertotTumblr(GenericTumblrV1):
4679
    """Class to retrieve Robotatertot comics."""
4680
    # Also on https://www.instagram.com/robotatertotcomics
4681
    name = 'robotatertot-tumblr'
4682
    long_name = 'Robotatertot (from Tumblr)'
4683
    url = 'https://robotatertot.tumblr.com'
4684
4685
@@ 763-778 (lines=16) @@
760
    get_first_comic_link = get_div_navfirst_a
761
    get_navi_link = get_link_rel_next
762
    get_url_from_link = join_cls_url_to_href
763
764
    @classmethod
765
    def get_comic_info(cls, soup, link):
766
        """Get information about a particular comics."""
767
        short_url_re = re.compile('^%s/\\?p=([0-9]*)' % cls.url)
768
        short_url = cls.get_url_from_link(soup.find('link', rel='shortlink'))
769
        num = int(short_url_re.match(short_url).groups()[0])
770
        imgs = soup.find('div', id='comic').find_all('img')
771
        assert len(imgs) == 1
772
        title = imgs[0]['alt']
773
        title2 = imgs[0]['title']
774
        return {
775
            'short_url': short_url,
776
            'title': title,
777
            'title2': title2,
778
            'img': [urljoin_wrapper(cls.url, i['src']) for i in imgs],
779
            'num': num,
780
        }
781