Bulk asynchronous downloader for multiple file hosts
Python asynciobunkrcyberdropdownloaderdropboxfilestergofilegoogle-drivemediafiremegamega-nzonedrivepatreonpawchivepinterestpixeldraintransfer-ittwitchtwittervk
Update ui.py
Jacob5603fdcddcda
diff --git a/cyberdrop_dl/ui/ui.py b/cyberdrop_dl/ui/ui.pyindex f31b6c716..4e811bcdf 100644--- a/cyberdrop_dl/ui/ui.py+++ b/cyberdrop_dl/ui/ui.py@@ -1,18 +1,17 @@from __future__ import annotations+import asynciofrom pathlib import Path-from rich.markdown import Markdownfrom textwrap import dedentfrom typing import TYPE_CHECKING+import aiofilesfrom InquirerPy import inquirerfrom InquirerPy.validator import PathValidator+from aiohttp import requestfrom rich import print as rprintfrom rich.console import Console--import aiofiles-from aiohttp import request-import asyncio+from rich.markdown import Markdownfrom cyberdrop_dl import __version__from cyberdrop_dl.clients.hash_client import hash_directory_scanner@@ -209,8 +208,8 @@ def program_ui(manager: Manager):changelog_path = manager.path_manager.config_dir.parent / "CHANGELOG.md"changelog_content = asyncio.run(_get_changelog(changelog_path))- with console.pager(links = True):- console.print(Markdown(changelog_content , justify = "left"))+ with console.pager(links=True):+ console.print(Markdown(changelog_content, justify="left"))# Exitelif action == 13:@@ -219,16 +218,16 @@ def program_ui(manager: Manager):async def _get_changelog(changelog_path: Path):url = "https://raw.githubusercontent.com/jbsparrow/CyberDropDownloader/refs/heads/master/CHANGELOG.md"- _ , lastest_version = await check_latest_pypi(log_to_console = False)+ _, lastest_version = await check_latest_pypi(log_to_console=False)latest_changelog = changelog_path.with_name(f"{changelog_path.stem}_{lastest_version}{changelog_path.suffix}")if not latest_changelog.is_file():changelog_pattern = f"{changelog_path.stem}*{changelog_path.suffix}"for old_changelog in changelog_path.parent.glob(changelog_pattern):- old_changelog.unlink()+ old_changelog.unlink()try:async with request("GET", url) as response:response.raise_for_status()- async with aiofiles.open(latest_changelog, 'wb') as f:+ async with aiofiles.open(latest_changelog, 'wb') as f:await f.write(await response.read())except Exception:return "UNABLE TO GET CHANGELOG INFORMATION"@@ -236,6 +235,5 @@ async def _get_changelog(changelog_path: Path):changelog_lines = latest_changelog.read_text(encoding="utf8").splitlines()# remove keep_a_changelog disclaimerchangelog_content = "\n".join(changelog_lines[:4] + changelog_lines[6:])-+return changelog_content-\ No newline at end of file