Skip to content

Commit

Permalink
Feature: Updated available 'User-Agent'
Browse files Browse the repository at this point in the history
  • Loading branch information
rfc-st committed Jan 17, 2025
1 parent 319bbca commit 862608c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
29 changes: 21 additions & 8 deletions additional/user_agents.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,25 @@
# Below are real User-Agents (associated with real browsers). In case
# the "-ua" parameter is not specified, the first User-Agent will be selected
# by default in the request.
#
# 1: Chrome on Windows
# 2: Firefox on Windows
# 3: Edge on Windows
# 4: Internet-Explorer on Windows
# 5: Chrome on Linux
# 6: Firefox on Linux
# 7: Safari on macOS
# 8: Firefox on macOS
# 9: Chrome on macOS
# 10: Edge on macOS

1.- Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
2.- Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0
3.- Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.2535.51
4.- Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
5.- Mozilla/5.0 (X11; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0
6.- Mozilla/5.0 (Macintosh; Intel Mac OS X 14_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4.1 Safari/605.1.15
7.- Mozilla/5.0 (Macintosh; Intel Mac OS X 14.5; rv:126.0) Gecko/20100101 Firefox/126.0
8.- Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
1.- Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
2.- Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0
3.- Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/131.0.2903.86
4.- Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko
5.- Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
6.- Mozilla/5.0 (X11; Linux x86_64; rv:133.0) Gecko/20100101 Firefox/133.0
7.- Mozilla/5.0 (Macintosh; Intel Mac OS X 14_7_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4.1 Safari/605.1.15
8.- Mozilla/5.0 (Macintosh; Intel Mac OS X 14.7; rv:134.0) Gecko/20100101 Firefox/134.0
9.- Mozilla/5.0 (Macintosh; Intel Mac OS X 14_7_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
10.- Mozilla/5.0 (Macintosh; Intel Mac OS X 14_7_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/131.0.2903.86
6 changes: 5 additions & 1 deletion humble.py
Original file line number Diff line number Diff line change
Expand Up @@ -1092,11 +1092,15 @@ def get_user_agent(user_agent_id):
encoding='utf8') as ua_source:
user_agents = [line.strip() for line in islice(ua_source, SLICE_INT[1],
None)]

if user_agent_id == str(0):
print_user_agents(user_agents)
for line in user_agents:
if line.startswith(f"{user_agent_id}.-"):
return line[4:]
offset = len(user_agent_id) + 3 if len(user_agent_id) == 1 else \
len(user_agent_id) + 2
return line[offset:].strip()

print_error_detail('[ua_invalid]')
sys.exit()

Expand Down

0 comments on commit 862608c

Please sign in to comment.