Fix Qwantz

This commit is contained in:
Tobias Gruetzmacher 2020-01-09 23:36:05 +01:00
parent 290f4167d9
commit e393ccdce1

View file

@ -1,13 +1,12 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam # Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2017 Tobias Gruetzmacher # Copyright (C) 2015-2020 Tobias Gruetzmacher
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
from re import compile, escape from ..scraper import _ParserScraper
from ..scraper import _BasicScraper, _ParserScraper from ..helpers import xpath_class
from ..util import tagre
class QuantumVibe(_ParserScraper): class QuantumVibe(_ParserScraper):
@ -35,12 +34,10 @@ class QuestionableContent(_ParserScraper):
help = 'Index format: n (unpadded)' help = 'Index format: n (unpadded)'
class Qwantz(_BasicScraper): class Qwantz(_ParserScraper):
baseUrl = 'http://www.qwantz.com/' url = 'http://www.qwantz.com/index.php'
url = baseUrl + 'index.php'
rurl = escape(baseUrl)
stripUrl = url + '?comic=%s' stripUrl = url + '?comic=%s'
firstStripUrl = stripUrl % '1' firstStripUrl = stripUrl % '1'
imageSearch = compile(tagre("img", "src", r'(%scomics/[^"]+)' % rurl)) imageSearch = '//img[{}]'.format(xpath_class('comic'))
prevSearch = compile(tagre("a", "href", r'(%sindex\.php\?comic=\d+)' % rurl, before="prev")) prevSearch = '//a[@rel="prev"]'
help = 'Index format: n' help = 'Index format: n'