File: rhjunior.py

package info (click to toggle)
dosage 3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,400 kB
  • sloc: python: 12,703; sh: 55; makefile: 6
file content (37 lines) | stat: -rw-r--r-- 1,469 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# SPDX-License-Identifier: MIT
# Copyright (C) 2019-2022 Tobias Gruetzmacher
# Copyright (C) 2019-2020 Daniel Ring
from ..scraper import ParserScraper


class RHJunior(ParserScraper):
    stripUrl = 'https://www.rhjunior.com/%s/'
    imageSearch = '//div[contains(@class, "entry-content")]//img'
    multipleImagesPerStrip = True

    def __init__(self, name, sub, prev, first, last=None):
        super().__init__('RHJunior/' + name)
        self.prevSearch = ('//a[@rel="prev"]', '//a[@title="' + prev + '"]')
        self.url = self.stripUrl % ('comics/' + sub)
        self.firstStripUrl = self.stripUrl % (sub + '-' + first)

        if last:
            self.url = self.stripUrl % (sub + '-' + last)
            self.endOfLife = True

    @classmethod
    def getmodules(cls):
        return (
            cls('GoblinHollow', 'goblin-hollow',
                '', '0001', last='7'),
            cls('NipAndTuck', 'nip-and-tuck',
                'Nip and Tuck', '0000'),
            cls('QuentynQuinnSpaceRanger', 'quentyn-quinn-space-ranger',
                'Quentyn Quinn, Space Ranger', '0001'),
            cls('TalesOfTheQuestor', 'tales-of-the-questor',
                'Tales of the Questor', 'cover'),
            cls('TheJournalOfEnniasLongscript', 'the-journal-of-ennias-longscript',
                '', '0001', last='0111'),
            cls('TheProbabilityBomb', 'the-probability-bomb',
                'the Probability Bomb', 'kickstarter'),
        )