refactor: assorted: python: logger.warn -> logger.warning
the former is deprecated
This commit is contained in:
@@ -75,7 +75,7 @@ def is_valid_search_domain(domain: str) -> bool:
|
|||||||
if len(comps) >= 2:
|
if len(comps) >= 2:
|
||||||
# allow any search domain that's not a TLD.
|
# allow any search domain that's not a TLD.
|
||||||
return True
|
return True
|
||||||
logger.warn(f"invalid search domain {domain}") # if you trigger this, then whitelist the search domain here
|
logger.warning(f"invalid search domain {domain}") # if you trigger this, then whitelist the search domain here
|
||||||
# it's ok to have a search domain of any length -- i'm just hesitant to allow hijacking of very large domain spaces.
|
# it's ok to have a search domain of any length -- i'm just hesitant to allow hijacking of very large domain spaces.
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@@ -61,7 +61,7 @@ def resolve_torrent(uri: str) -> str:
|
|||||||
uri = f.name
|
uri = f.name
|
||||||
|
|
||||||
if not (uri.startswith("magnet:") or uri.endswith(".torrent")):
|
if not (uri.startswith("magnet:") or uri.endswith(".torrent")):
|
||||||
logger.warn(f"unknown type for torrent URI: {uri}")
|
logger.warning(f"unknown type for torrent URI: {uri}")
|
||||||
|
|
||||||
return uri
|
return uri
|
||||||
|
|
||||||
|
@@ -80,7 +80,7 @@ def tracker_rank(tracker: str):
|
|||||||
tracker_ = tracker.lower()
|
tracker_ = tracker.lower()
|
||||||
if tracker_ in TRACKER_RANKS:
|
if tracker_ in TRACKER_RANKS:
|
||||||
return TRACKER_RANKS.index(tracker_)
|
return TRACKER_RANKS.index(tracker_)
|
||||||
logger.warn(f"unknown tracker: {tracker_!r}")
|
logger.warning(f"unknown tracker: {tracker_!r}")
|
||||||
return len(TRACKER_RANKS)
|
return len(TRACKER_RANKS)
|
||||||
|
|
||||||
DROP_CATS = { "dvd", "hd", "misc", "other", "sd", "uhd" }
|
DROP_CATS = { "dvd", "hd", "misc", "other", "sd", "uhd" }
|
||||||
|
@@ -49,7 +49,7 @@ def get_fault_tolerant(try_upnp: bool, retry_duration: float) -> tuple[str|None,
|
|||||||
try:
|
try:
|
||||||
return try_get_once(try_upnp)
|
return try_get_once(try_upnp)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warn(e)
|
logger.warning(e)
|
||||||
if time.time() - start > retry_duration:
|
if time.time() - start > retry_duration:
|
||||||
raise
|
raise
|
||||||
time.sleep(1.0)
|
time.sleep(1.0)
|
||||||
|
Reference in New Issue
Block a user