Skip to content

Commit

Permalink
[common] update UA
Browse files Browse the repository at this point in the history
  • Loading branch information
soimort committed Apr 18, 2024
1 parent 0b7a91f commit 01fa324
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/you_get/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
'Accept-Charset': 'UTF-8,*;q=0.5',
'Accept-Encoding': 'gzip,deflate,sdch',
'Accept-Language': 'en-US,en;q=0.8',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.183' # Latest Edge
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/123.0.2420.97' # Latest Edge
}

if sys.stdout.isatty():
Expand Down Expand Up @@ -352,6 +352,7 @@ def getHttps(host, url, headers, debuglevel=0):
conn.set_debuglevel(debuglevel)
conn.request("GET", url, headers=headers)
resp = conn.getresponse()
logging.debug('getHttps: %s' % resp.getheaders())
set_cookie = resp.getheader('set-cookie')

data = resp.read()
Expand All @@ -362,7 +363,7 @@ def getHttps(host, url, headers, debuglevel=0):
pass

conn.close()
return str(data, encoding='utf-8'), set_cookie
return str(data, encoding='utf-8'), set_cookie # TODO: support raw data


# DEPRECATED in favor of get_content()
Expand Down

0 comments on commit 01fa324

Please sign in to comment.