mirror of
https://codeberg.org/hyperreal/admin-scripts
synced 2024-11-25 09:03:41 +01:00
Check for availability of libgen.rs
This commit is contained in:
parent
426d8de0e3
commit
1b81d47b71
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.direnv
|
@ -166,14 +166,22 @@ if __name__ == "__main__":
|
||||
# If it's a dry run, only print the knapsack's contents. Otherwise,
|
||||
# add the knapsack's contents to the qBittorrent instance.
|
||||
# When finished, print the number of items and the combined weight of all
|
||||
# items in the knapsack.
|
||||
if args["--dry-run"]:
|
||||
# items in the knapsack. Before attempting to add items to the qBittorrent
|
||||
# instance, check to see if libgen.rs is even working. If libgen.rs is down
|
||||
# no torrents can be added to the qBittorrent instance, so exit with an
|
||||
# notice.
|
||||
if dry_run:
|
||||
for torrent in knapsack:
|
||||
print(torrent["name"])
|
||||
print(torrent["link"])
|
||||
else:
|
||||
response = requests.get("https://libgen.rs")
|
||||
if not response.ok:
|
||||
exit(
|
||||
"It appears https://libgen.rs is currently down. Please try again later."
|
||||
)
|
||||
for torrent in knapsack:
|
||||
qb.download_from_link(torrent["link"], category="scihub")
|
||||
print(f"Added {torrent["name"]}")
|
||||
print(f"Added {torrent['name']}")
|
||||
|
||||
print("----------------")
|
||||
print(f"Count: {len(knapsack)} torrents")
|
||||
|
@ -22,10 +22,15 @@ in pkgs.python312.buildEnv.override rec {
|
||||
|
||||
extraLibs = [
|
||||
pkgs.python312Packages.beautifulsoup4
|
||||
pkgs.python312Packages.black
|
||||
pkgs.python312Packages.bpython
|
||||
pkgs.python312Packages.docopt
|
||||
pkgs.python312Packages.isort
|
||||
pkgs.python312Packages.nose
|
||||
pkgs.python312Packages.pytest
|
||||
pkgs.python312Packages.requests
|
||||
pkgs.python312Packages.rich
|
||||
pyright
|
||||
python-qbittorrent
|
||||
];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user