Put CURL's user-agent for DDG

CURL so far always works for getting response from DDG engine when testing from server. Putting CURL’s user-agent for the DDG engine apparently fix the 403 issue as well.
This commit is contained in:
ahmad-alkadri 2023-03-13 01:05:29 +01:00 committed by Ahmad Alkadri
parent abd2d8605e
commit df41ecb23f

View file

@ -74,6 +74,7 @@ def request(query, params):
params['headers']['Content-Type'] = 'application/x-www-form-urlencoded' params['headers']['Content-Type'] = 'application/x-www-form-urlencoded'
params['headers']['Referer'] = 'https://google.com/' params['headers']['Referer'] = 'https://google.com/'
params['headers']['User-Agent'] = 'curl/7.81.0'
# initial page does not have an offset # initial page does not have an offset
if params['pageno'] == 2: if params['pageno'] == 2: