Skip to content

Commit

Permalink
Changed default user agent to emulate firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
ksharinarayanan committed Feb 26, 2021
1 parent a932c29 commit bd153e7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</p>

<p align="center">
<img src="https://img.shields.io/badge/Release-v1.5-brightgreen">
<img src="https://img.shields.io/badge/Release-v1.7-brightgreen">
<img src="https://img.shields.io/github/issues-closed/micha3lb3n/SourceWolf">
<img src="https://img.shields.io/github/issues-pr-closed/micha3lb3n/SourceWolf">
<img src="https://img.shields.io/github/contributors/micha3lb3n/SourceWolf">
Expand Down
6 changes: 3 additions & 3 deletions helpers/sourcewolf-version.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version: 1.6
bug-fixes:
- "Fixed a bug which occured while extracting the javascript variables"
version: 1.7
new-features:
- "SourceWolf now sends requests using the firefox's user agent to emulate browsers behaviour!馃敟"
11 changes: 9 additions & 2 deletions sourcewolf.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,19 @@ def getResponse(url, delay):

if url[-1] == '\n' or url[-1] == ' ':
url = url[:-1]

headers = {}
if args.headers is None:
headers = {'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0'}
else:
headers = args.headers

try:
if args.timeout != None:
response = session.get(url, headers=args.headers,
response = session.get(url, headers=headers,
cookies=args.cookies, timeout=(float(args.timeout), 30))
else:
response = session.get(url, headers=args.headers,
response = session.get(url, headers=headers,
cookies=args.cookies)

if os.name == "nt" or args.no_colors == True:
Expand Down

0 comments on commit bd153e7

Please sign in to comment.