From 42b23c4537c99e3aff26caf541ce2d3ecb022475 Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Sat, 28 Dec 2019 00:15:46 +0100 Subject: [PATCH] Force CommitStrip to always use TLS --- dosagelib/plugins/c.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dosagelib/plugins/c.py b/dosagelib/plugins/c.py index d0fbda1f9..ee177b3e5 100644 --- a/dosagelib/plugins/c.py +++ b/dosagelib/plugins/c.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 @@ -333,7 +333,7 @@ class CommitStrip(_ParserScraper): baseUrl = 'https://www.commitstrip.com/en/' url = baseUrl + '?setLocale=1' # ensure the language cookie is set stripUrl = baseUrl + '%s/' - firstStripUrl = 'http://www.commitstrip.com/en/2012/02/22/interview/' # non-TLS! + firstStripUrl = stripUrl % '2012/02/22/interview' latestSearch = '//section//a' starter = indirectStarter @@ -345,12 +345,15 @@ class CommitStrip(_ParserScraper): parts = page_url.rstrip('/').rsplit('/')[-4:] return '-'.join(parts) + def link_modifier(self, fromurl, tourl): + return tourl.replace('http:', 'https:') + class CommitStripFr(CommitStrip): baseUrl = 'https://www.commitstrip.com/fr/' url = baseUrl + '?setLocale=1' # ensure the language cookie is set stripUrl = baseUrl + '%s/' - firstStripUrl = 'http://www.commitstrip.com/fr/2012/02/22/interview/' # non-TLS! + firstStripUrl = stripUrl % '2012/02/22/interview' lang = 'fr'