mirror of
https://codeberg.org/hyperreal/admin-scripts
synced 2024-11-25 09:03:41 +01:00
Use single quotes inside f-strings
This commit is contained in:
parent
5906ca9afe
commit
0ef8d09119
10
bin/qbth
10
bin/qbth
@ -23,9 +23,9 @@ def add_torrents_from_html(webpage_url: str, torrent_substring: str):
|
|||||||
soup = BeautifulSoup(reqs.text, "html.parser")
|
soup = BeautifulSoup(reqs.text, "html.parser")
|
||||||
for link in soup.find_all("a"):
|
for link in soup.find_all("a"):
|
||||||
if torrent_substring in link.get("href"):
|
if torrent_substring in link.get("href"):
|
||||||
url = f"{webpage_url}/{link.get("href")}"
|
url = f"{webpage_url}/{link.get('href')}"
|
||||||
qb.download_from_link(url, category="distro")
|
qb.download_from_link(url, category="distro")
|
||||||
print(f"Added {link.get("href")}")
|
print(f"Added {link.get('href')}")
|
||||||
|
|
||||||
|
|
||||||
def remove_torrents(distro_substring: str):
|
def remove_torrents(distro_substring: str):
|
||||||
@ -33,7 +33,7 @@ def remove_torrents(distro_substring: str):
|
|||||||
for torrent in torrents:
|
for torrent in torrents:
|
||||||
if distro_substring in torrent["name"]:
|
if distro_substring in torrent["name"]:
|
||||||
qb.delete_permanently(torrent["hash"])
|
qb.delete_permanently(torrent["hash"])
|
||||||
print(f"Removed {torrent["name"]}")
|
print(f"Removed {torrent['name']}")
|
||||||
|
|
||||||
|
|
||||||
def add_almalinux(relver: str):
|
def add_almalinux(relver: str):
|
||||||
@ -98,7 +98,7 @@ def add_freebsd(relver: str):
|
|||||||
for line in data:
|
for line in data:
|
||||||
if line.startswith("magnet:"):
|
if line.startswith("magnet:"):
|
||||||
qb.download_from_link(line, category="distro")
|
qb.download_from_link(line, category="distro")
|
||||||
print(f"Added {line.split("=")[2]}")
|
print(f"Added {line.split('=')[2]}")
|
||||||
|
|
||||||
|
|
||||||
def remove_freebsd(relver: str):
|
def remove_freebsd(relver: str):
|
||||||
@ -131,7 +131,7 @@ def add_nixos():
|
|||||||
json_data = json.loads(reqs.text)
|
json_data = json.loads(reqs.text)
|
||||||
for item in json_data["assets"]:
|
for item in json_data["assets"]:
|
||||||
qb.download_from_link(item["browser_download_url"], category="distro")
|
qb.download_from_link(item["browser_download_url"], category="distro")
|
||||||
print(f"Added {os.path.basename(item["browser_download_url"])}")
|
print(f"Added {os.path.basename(item['browser_download_url'])}")
|
||||||
|
|
||||||
|
|
||||||
def remove_nixos():
|
def remove_nixos():
|
||||||
|
Loading…
Reference in New Issue
Block a user