Code Duplication    Length = 24-25 lines in 2 locations

comics.py 2 locations

@@ 1560-1584 (lines=25) @@
1557
            'title': title,
1558
            'img': [i['src'] for i in imgs],
1559
            'description': desc,
1560
        }
1561
1562
1563
class ScandinaviaAndTheWorld(GenericNavigableComic):
1564
    """Class to retrieve Scandinavia And The World comics."""
1565
    name = 'satw'
1566
    long_name = 'Scandinavia And The World'
1567
    url = 'http://satwcomic.com'
1568
1569
    @classmethod
1570
    def get_first_comic_link(cls):
1571
        """Get link to first comics."""
1572
        return {'href': 'http://satwcomic.com/sweden-denmark-and-norway'}
1573
1574
    @classmethod
1575
    def get_navi_link(cls, last_soup, next_):
1576
        return last_soup.find('a', accesskey='n' if next_ else 'p')
1577
1578
    @classmethod
1579
    def get_comic_info(cls, soup, link):
1580
        """Get information about a particular comics."""
1581
        title = soup.find('meta', attrs={'name': 'twitter:label1'})['content']
1582
        desc = soup.find('meta', property='og:description')['content']
1583
        imgs = soup.find_all('img', itemprop="image")
1584
        return {
1585
            'title': title,
1586
            'description': desc,
1587
            'img': [i['src'] for i in imgs],
@@ 2059-2082 (lines=24) @@
2056
            'img': [i['src'] for i in imgs],
2057
            'title': title,
2058
            'author': author,
2059
        }
2060
2061
2062
class DepressedAlien(GenericNavigableComic):
2063
    """Class to retrieve Depressed Alien Comics."""
2064
    name = 'depressedalien'
2065
    long_name = 'Depressed Alien'
2066
    url = 'http://depressedalien.com'
2067
    get_url_from_link = join_cls_url_to_href
2068
2069
    @classmethod
2070
    def get_first_comic_link(cls):
2071
        """Get link to first comics."""
2072
        return get_soup_at_url(cls.url).find('img', attrs={'name': 'beginArrow'}).parent
2073
2074
    @classmethod
2075
    def get_navi_link(cls, last_soup, next_):
2076
        return last_soup.find('img', attrs={'name': 'rightArrow' if next_ else 'leftArrow'}).parent
2077
2078
    @classmethod
2079
    def get_comic_info(cls, soup, link):
2080
        """Get information about a particular comics."""
2081
        title = soup.find('meta', attrs={'name': 'twitter:title'})['content']
2082
        imgs = soup.find_all('meta', property='og:image')
2083
        return {
2084
            'title': title,
2085
            'img': [i['content'] for i in imgs],