From c3b29421a9b3928d7cf2dd89707f90e8568fa74e Mon Sep 17 00:00:00 2001 From: simon987 Date: Sat, 28 Dec 2019 10:46:49 -0500 Subject: [PATCH] Use proxy w/ cloudscraper --- chan/lynx.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chan/lynx.py b/chan/lynx.py index 4dc149d..ce87f75 100644 --- a/chan/lynx.py +++ b/chan/lynx.py @@ -4,6 +4,7 @@ from json import JSONDecodeError from urllib.parse import urljoin import cloudscraper +import sys from chan.helper import ChanHelper from util import logger @@ -16,6 +17,10 @@ class LynxChanHelper(ChanHelper): super().__init__(db_id, base_url, image_url, thread_path, image_path, boards, rps) scraper = cloudscraper.create_scraper() + if len(sys.argv) > 3: + proxy = sys.argv[3] + scraper.proxies = {"http": proxy, "https": proxy} + scraper.verify = False self.get_method = scraper.get @staticmethod