gpchelkin / scdlbot

Invalid envvar default PYL-W1508
Bug risk
Major
6 months agoa year old
os.getenv default type is builtins.int. Expected str or None.
  82# https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ProcessPoolExecutor
  83EXECUTOR = concurrent.futures.ProcessPoolExecutor(max_workers=WORKERS, mp_context=get_context(method=mp_method))
  84DL_TIMEOUT = int(os.getenv("DL_TIMEOUT", 300))
  85CHECK_URL_TIMEOUT = int(os.getenv("CHECK_URL_TIMEOUT", 30))  86# Timeouts: https://www.python-httpx.org/advanced/
  87COMMON_CONNECTION_TIMEOUT = int(os.getenv("COMMON_CONNECTION_TIMEOUT", 10))
  88MAX_TG_FILE_SIZE = int(os.getenv("MAX_TG_FILE_SIZE", "45_000_000"))
os.getenv default type is builtins.int. Expected str or None.
  71scdl_bin = local[os.path.join(BIN_PATH, "scdl")]
  72bcdl_bin = local[os.path.join(BIN_PATH, "bandcamp-dl")]
  73BCDL_ENABLE = False
  74WORKERS = int(os.getenv("WORKERS", 2))  75# TODO try to change to spawn or forkserver to save RAM
  76mp_method = "fork"
  77if platform.system() == "Windows":
os.getenv default type is builtins.int. Expected str or None.
  81# https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods
  82# https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ProcessPoolExecutor
  83EXECUTOR = concurrent.futures.ProcessPoolExecutor(max_workers=WORKERS, mp_context=get_context(method=mp_method))
  84DL_TIMEOUT = int(os.getenv("DL_TIMEOUT", 300))  85CHECK_URL_TIMEOUT = int(os.getenv("CHECK_URL_TIMEOUT", 30))
  86# Timeouts: https://www.python-httpx.org/advanced/
  87COMMON_CONNECTION_TIMEOUT = int(os.getenv("COMMON_CONNECTION_TIMEOUT", 10))
os.getenv default type is builtins.int. Expected str or None.
  84DL_TIMEOUT = int(os.getenv("DL_TIMEOUT", 300))
  85CHECK_URL_TIMEOUT = int(os.getenv("CHECK_URL_TIMEOUT", 30))
  86# Timeouts: https://www.python-httpx.org/advanced/
  87COMMON_CONNECTION_TIMEOUT = int(os.getenv("COMMON_CONNECTION_TIMEOUT", 10))  88MAX_TG_FILE_SIZE = int(os.getenv("MAX_TG_FILE_SIZE", "45_000_000"))
  89MAX_CONVERT_FILE_SIZE = int(os.getenv("MAX_CONVERT_FILE_SIZE", "80_000_000"))
  90NO_FLOOD_CHAT_IDS = list(map(int, os.getenv("NO_FLOOD_CHAT_IDS", "0").split(",")))