From 7dfc0b22598d5dcb0623104db8371edaf8627d54 Mon Sep 17 00:00:00 2001 From: ksoeasyxiaosi <40597793+ksoeasyxiaosi@users.noreply.github.com> Date: Mon, 11 Mar 2019 15:51:08 +0800 Subject: [PATCH] Update tuchong.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 图虫下载具体图片不带header容易403 --- tuchong/tuchong.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tuchong/tuchong.py b/tuchong/tuchong.py index f5bb432..d3444e9 100644 --- a/tuchong/tuchong.py +++ b/tuchong/tuchong.py @@ -76,7 +76,7 @@ def parse_imgURL(html): def download_image(url): try: urls = 'https:' + url - ir = requests.get(urls) + ir = requests.get(urls, headers=headers) if ir.status_code == 200: save_image(ir.content) return None