From 66f154f0749fde51c1701367d89ec4a92f5e141b Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Wed, 4 Dec 2019 00:15:44 +0100 Subject: [PATCH] Add throttling for GoComics (fixes #90) Since this was the goal of the whole throttling implementation ;) --- dosagelib/plugins/gocomics.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dosagelib/plugins/gocomics.py b/dosagelib/plugins/gocomics.py index bf1c5230c..7c7687bdb 100644 --- a/dosagelib/plugins/gocomics.py +++ b/dosagelib/plugins/gocomics.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam -# Copyright (C) 2015-2018 Tobias Gruetzmacher +# Copyright (C) 2015-2019 Tobias Gruetzmacher from __future__ import absolute_import, division, print_function @@ -10,7 +10,7 @@ from ..helpers import indirectStarter, xpath_class class GoComics(_ParserScraper): - url = 'http://www.gocomics.com/' + url = 'https://www.gocomics.com/' imageSearch = '//picture[{}]/img'.format(xpath_class('item-comic-image')) prevSearch = '//a[{}]'.format(xpath_class('js-previous-comic')) latestSearch = '//div[{}]//a'.format(xpath_class('gc-deck--cta-0')) @@ -19,7 +19,8 @@ class GoComics(_ParserScraper): def __init__(self, name, path, lang=None): super(GoComics, self).__init__('GoComics/' + name) - self.url = 'http://www.gocomics.com/' + path + self.session.add_throttle('www.gocomics.com', 1.0, 2.0) + self.url = 'https://www.gocomics.com/' + path self.shortname = name if lang: self.lang = lang