Changed user-agent to 'fediverse's stats (fediverse@mastodont.cat)'
This commit is contained in:
pare
213bd73cbe
commit
1636e86b6d
S'han modificat 3 arxius amb 4 adicions i 4 eliminacions
|
@ -72,7 +72,7 @@ class Server:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
user_agent = {'User-agent': 'Mozilla/5.0'}
|
user_agent = {'User-agent': "fediverse's servers stats (fediverse@mastodont.cat)"}
|
||||||
|
|
||||||
data = requests.get('https://' + server + api, headers = user_agent, timeout=3)
|
data = requests.get('https://' + server + api, headers = user_agent, timeout=3)
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ async def getsoft(server):
|
||||||
|
|
||||||
url = 'https://' + server
|
url = 'https://' + server
|
||||||
|
|
||||||
user_agent = {'User-agent': 'Mozilla/5.0'}
|
user_agent = {'User-agent': "fediverse's stats (fediverse@mastodont.cat)"}
|
||||||
|
|
||||||
timeout = aiohttp.ClientTimeout(total=3)
|
timeout = aiohttp.ClientTimeout(total=3)
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ def get_peers(peer):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
user_agent = {'User-agent': 'Mozilla/5.0'}
|
user_agent = {'User-agent': "fediverse's stats (fediverse@mastodont.cat)"}
|
||||||
|
|
||||||
response = requests.get('https://' + peer + peers_api, headers = user_agent, timeout=3)
|
response = requests.get('https://' + peer + peers_api, headers = user_agent, timeout=3)
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
world_peers = []
|
world_peers = []
|
||||||
|
|
||||||
user_agent = {'User-agent': 'Mozilla/5.0'}
|
user_agent = {'User-agent': "fediverse's stats (fediverse@mastodont.cat)"}
|
||||||
|
|
||||||
res = requests.get('https://' + mastodon_hostname + peers_api, headers = user_agent, timeout=3)
|
res = requests.get('https://' + mastodon_hostname + peers_api, headers = user_agent, timeout=3)
|
||||||
|
|
||||||
|
|
Loading…
Referencia en una nova incidència