Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Boris-code/feapder
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris committed Mar 31, 2021
2 parents 5fd507e + 3ee9634 commit 4a89aa6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion feapder/network/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def get_response(self, save_cached=False):
self.requests_kwargs.setdefault(
"headers",
{
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
"User-Agent": setting.DEFAULT_USERAGENT
},
)

Expand Down
2 changes: 2 additions & 0 deletions feapder/setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@

# 随机headers
RANDOM_HEADERS = True
# 默认使用的浏览器头 RANDOM_HEADERS=True时不生效
DEFAULT_USERAGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
# requests 使用session
USE_SESSION = False

Expand Down

0 comments on commit 4a89aa6

Please sign in to comment.