1
0
Fork 0

Remove predb.ovh

https://github.com/predbdotovh/pre-api/issues/31
This commit is contained in:
Casper V. Kristensen 2023-02-11 01:18:10 +01:00
parent fa1754f70b
commit 526d07296b

View file

@ -18,7 +18,7 @@ def get_pres() -> List[Pre]:
logger.info("Getting pres from predbs") logger.info("Getting pres from predbs")
# PreDBs in order of preference # PreDBs in order of preference
predbs = (get_xrel, get_xrel_p2p, get_predbde, get_predbovh) predbs = (get_xrel, get_xrel_p2p, get_predbde)
pres = {} pres = {}
for get in reversed(predbs): for get in reversed(predbs):
try: try:
@ -100,24 +100,3 @@ def get_predbde(categories=("GAMES", "0DAY"), num_pages=5) -> List[Pre]:
for page in range(1, num_pages) for page in range(1, num_pages)
for rls in get_releases_in_category(category, page) for rls in get_releases_in_category(category, page)
] ]
def get_predbovh() -> List[Pre]:
logger.debug("Getting pres from predb.ovh")
r = cache.get(
"https://predb.ovh/api/v1/",
params={
"q": "@cat GAMES|0DAY",
"count": 100,
},
)
return [
Pre(
dirname=rls["name"],
nfo_link="https://duckduckgo.com/?q={}".format(rls["name"]),
timestamp=datetime.fromtimestamp(rls["preAt"]),
)
for rls in r.json["data"]["rows"]
]