Code Duplication    Length = 12-13 lines in 2 locations

comics.py 2 locations

@@ 2920-2932 (lines=13) @@
2917
        """Get link to first comics."""
2918
        return get_soup_at_url(cls.url).find('a', class_='webcomic-link webcomic1-link first-webcomic-link first-webcomic1-link')
2919
2920
    @classmethod
2921
    def get_comic_info(cls, soup, link):
2922
        """Get information about a particular comics."""
2923
        title = soup.find('meta', property='og:title')['content']
2924
        imgs = soup.find('div', class_='webcomic-image').find_all('img')
2925
        date_str = soup.find('meta', property='article:published_time')['content'][:10]
2926
        day = string_to_date(date_str, "%Y-%m-%d")
2927
        return {
2928
            'title': title,
2929
            'day': day.day,
2930
            'month': day.month,
2931
            'year': day.year,
2932
            'img': [i['src'] for i in imgs],
2933
        }
2934
2935
@@ 2628-2639 (lines=12) @@
2625
    get_first_comic_link = simulate_first_link
2626
    first_url = NotImplemented
2627
2628
    @classmethod
2629
    def get_comic_info(cls, soup, link):
2630
        """Get information about a particular comics."""
2631
        desc = soup.find('meta', property='og:description')['content']
2632
        title = soup.find('meta', property='og:title')['content']
2633
        imgs = soup.find('div', class_='entry-content').find_all('img')
2634
        title2 = ' '.join(i.get('title', '') for i in imgs)
2635
        return {
2636
            'title': title,
2637
            'title2': title2,
2638
            'description': desc,
2639
            'img': [urljoin_wrapper(cls.url, convert_iri_to_plain_ascii_uri(i['src'])) for i in imgs],
2640
        }
2641
2642