mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-03 17:39:42 +02:00
Merge branch 'main' of https://github.com/KeksPirates/SoftwareManager
This commit is contained in:
@@ -3,15 +3,18 @@ import asyncio
|
|||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
|
|
||||||
global url_uztracker
|
global url_uztracker
|
||||||
url_uztracker = "https://uztracker.net/tracker.php?nm=" # placeholder url for now
|
url_uztracker = "https://uztracker.net/tracker.php?nm="
|
||||||
|
|
||||||
async def init_uztracker():
|
async def init_uztracker():
|
||||||
global up
|
global up
|
||||||
global soup
|
global soup
|
||||||
try:
|
try:
|
||||||
response = requests.get(url_uztracker) # get da content from da url
|
response = requests.get(url_uztracker, timeout=10)
|
||||||
soup = BeautifulSoup(response.content, 'html.parser') # create bs object
|
if response.status_code == 200:
|
||||||
up = True
|
up = True
|
||||||
|
else:
|
||||||
|
up = False
|
||||||
|
print(f"Rutracker seems down, status code: {response.status_code}")
|
||||||
except requests.exceptions.RequestException as e:
|
except requests.exceptions.RequestException as e:
|
||||||
print(f"\nRequest Exception on {url_uztracker}:")
|
print(f"\nRequest Exception on {url_uztracker}:")
|
||||||
print(e)
|
print(e)
|
||||||
|
|||||||
Reference in New Issue
Block a user