Add User-Agent header when fetching sources

This commit is contained in:
monosans
2022-07-07 13:03:05 +03:00
parent 2fba31c06a
commit 853194bd7e
2 changed files with 11 additions and 1 deletions
+4
View File
@@ -1,5 +1,9 @@
# YYYY-MM-DD
## 2022-07-07
- Add `User-Agent` header when fetching sources.
## 2022-06-16
- Edit uvloop marker.
+7 -1
View File
@@ -255,7 +255,13 @@ class ProxyScraperChecker:
)
for proto, sources in self.sources.items()
}
async with ClientSession() as session:
headers = {
"User-Agent": (
"Mozilla/5.0 (Windows NT 10.0; rv:102.0)"
+ " Gecko/20100101 Firefox/102.0"
)
}
async with ClientSession(headers=headers) as session:
coroutines = (
self.fetch_source(
session, source, proto, progress, tasks[proto]