Skip to content

Commit

Permalink
Update header timeout from 5 to 10 seconds in downloader.py
Browse files Browse the repository at this point in the history
  • Loading branch information
itsTheFae committed Feb 8, 2024
1 parent eee1d30 commit 74a3d40
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions musicbot/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def __init__(self, bot: "MusicBot") -> None:
"""
self.bot: "MusicBot" = bot
self.download_folder: pathlib.Path = bot.config.audio_cache_path
# TODO: this should probably be configurable. Perhaps via CLI args.
# TODO: max_workers should probably be configurable. Perhaps via CLI args.
# TODO: this executor may not be good for long-running downloads...
self.thread_pool = ThreadPoolExecutor(max_workers=2)

# force ytdlp and HEAD requests to use the same UA string.
Expand Down Expand Up @@ -160,7 +161,7 @@ async def _get_headers( # pylint: disable=dangerous-default-value
session: aiohttp.ClientSession,
url: str,
*,
timeout: int = 5,
timeout: int = 10, # TODO: this timeout should be configurable.
allow_redirects: bool = True,
req_headers: Dict[str, Any] = {},
) -> Union["CIMultiDictProxy[str]", None]:
Expand Down

0 comments on commit 74a3d40

Please sign in to comment.