Use single quotes inside f-strings

This commit is contained in:
Jeffrey Serio 2024-07-08 19:31:48 -05:00
parent 5906ca9afe
commit 0ef8d09119

View File

@ -23,9 +23,9 @@ def add_torrents_from_html(webpage_url: str, torrent_substring: str):
soup = BeautifulSoup(reqs.text, "html.parser")
for link in soup.find_all("a"):
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")
print(f"Added {link.get("href")}")
print(f"Added {link.get('href')}")
def remove_torrents(distro_substring: str):
@ -33,7 +33,7 @@ def remove_torrents(distro_substring: str):
for torrent in torrents:
if distro_substring in torrent["name"]:
qb.delete_permanently(torrent["hash"])
print(f"Removed {torrent["name"]}")
print(f"Removed {torrent['name']}")
def add_almalinux(relver: str):
@ -98,7 +98,7 @@ def add_freebsd(relver: str):
for line in data:
if line.startswith("magnet:"):
qb.download_from_link(line, category="distro")
print(f"Added {line.split("=")[2]}")
print(f"Added {line.split('=')[2]}")
def remove_freebsd(relver: str):
@ -131,7 +131,7 @@ def add_nixos():
json_data = json.loads(reqs.text)
for item in json_data["assets"]:
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():