mirror of
https://github.com/simon987/chan_feed.git
synced 2025-04-19 18:16:44 +00:00
Use proxy w/ cloudscraper
This commit is contained in:
parent
0d12a2325d
commit
c3b29421a9
@ -4,6 +4,7 @@ from json import JSONDecodeError
|
|||||||
from urllib.parse import urljoin
|
from urllib.parse import urljoin
|
||||||
|
|
||||||
import cloudscraper
|
import cloudscraper
|
||||||
|
import sys
|
||||||
|
|
||||||
from chan.helper import ChanHelper
|
from chan.helper import ChanHelper
|
||||||
from util import logger
|
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)
|
super().__init__(db_id, base_url, image_url, thread_path, image_path, boards, rps)
|
||||||
|
|
||||||
scraper = cloudscraper.create_scraper()
|
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
|
self.get_method = scraper.get
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
Loading…
x
Reference in New Issue
Block a user