From 7048a3254c3da9c5a4aa88c401a10c424926ad66 Mon Sep 17 00:00:00 2001 From: lededev Date: Thu, 15 Jul 2021 10:39:41 +0800 Subject: [PATCH] all http requests using the same user-agent --- core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core.py b/core.py index 4e16290..fe50ab5 100755 --- a/core.py +++ b/core.py @@ -362,7 +362,7 @@ def download_file_with_filename(url, filename, path, conf: config.Config, filepa os.makedirs(path) proxies = configProxy.proxies() headers = { - 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'} + 'User-Agent': G_USER_AGENT} r = requests.get(url, headers=headers, timeout=configProxy.timeout, proxies=proxies) if r == '': print('[-]Movie Data not found!') @@ -374,7 +374,7 @@ def download_file_with_filename(url, filename, path, conf: config.Config, filepa if not os.path.exists(path): os.makedirs(path) headers = { - 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'} + 'User-Agent': G_USER_AGENT} r = requests.get(url, timeout=configProxy.timeout, headers=headers) if r == '': print('[-]Movie Data not found!')