Bulk asynchronous downloader for multiple file hosts
Python asynciobunkrcyberdropdownloaderdropboxfilestergofilegoogle-drivemediafiremegamega-nzonedrivepatreonpawchivepinterestpixeldraintransfer-ittwitchtwittervk
fix link arg, add db-file arg
Jules-WinnfieldX2961ec7c13fa
diff --git a/README.md b/README.mdindex 68d0125a7..21cd6dbee 100644--- a/README.md+++ b/README.md@@ -71,6 +71,7 @@ optional arguments:-i INPUT_FILE, --input-file INPUT_FILE file containing links to download-o OUTPUT_FOLDER, --output-folder OUTPUT_FOLDER folder to download files to--log-file LOG_FILE log file to write to+ --db-file history DB file to write to--threads THREADS number of threads to use (0 = max)--attempts ATTEMPTS number of attempts to download each file--disable-attempt-limit disables stopping the program based on attempt limitsdiff --git a/cyberdrop_dl/__init__.py b/cyberdrop_dl/__init__.pyindex 72a682579..a75afc5f9 100644--- a/cyberdrop_dl/__init__.py+++ b/cyberdrop_dl/__init__.py@@ -1 +1 @@-__version__ = "2.14.13"+__version__ = "2.14.14"diff --git a/cyberdrop_dl/main.py b/cyberdrop_dl/main.pyindex 5131249f4..d68a12687 100644--- a/cyberdrop_dl/main.py+++ b/cyberdrop_dl/main.py@@ -17,6 +17,7 @@ def parse_args():parser.add_argument("-i", "--input-file", help="file containing links to download", default="URLs.txt")parser.add_argument("-o", "--output-folder", help="folder to download files to", default="Downloads")parser.add_argument("--log-file", help="log file to write to", default="downloader.log")+ parser.add_argument("--db-file", help="history database file to write to", default="download_history_size_based.sqlite")parser.add_argument("--threads", type=int, help="number of threads to use (0 = max)", default=0)parser.add_argument("--attempts", type=int, help="number of attempts to download each file", default=10)parser.add_argument("--disable-attempt-limit", help="disables the attempt limitation", action="store_true")@@ -42,15 +43,17 @@ async def download_all(args: argparse.Namespace):await log(f"{input_file} created. Populate it and retry.")exit(1)- conn, curr = await sql_initialize()+ conn, curr = await sql_initialize(args.db_file)links = args.links+ links = map(URL, links)+with open(input_file, "r") as f:links += await regex_links(f.read())content_object = await scrape(links, args.include_id, args.thotsbay_username, args.thotsbay_password)if await content_object.is_empty():logging.error(f'ValueError No links')- await log('No links found, check the URL.txt\nIf the link works in your web browser, please open an issue ticket with me.', Fore.RED)+ await log("No links found, check the URL.txt\nIf the link works in your web browser, please open an issue ticket with me.", Fore.RED)await log("This program does not currently support password protected albums.", Fore.RED)exit(0)await clear()diff --git a/cyberdrop_dl/utils/base_functions.py b/cyberdrop_dl/utils/base_functions.pyindex 9c983369a..561e484b4 100644--- a/cyberdrop_dl/utils/base_functions.py+++ b/cyberdrop_dl/utils/base_functions.py@@ -52,9 +52,7 @@ async def sanitize(input: str) -> str:return re.sub(r'[<>:"/\\|?*\']', "", input)-async def sql_initialize():- download_history = "download_history_size_based.sqlite"-+async def sql_initialize(download_history):conn = sqlite3.connect(download_history)curr = conn.cursor()create_table_query = """CREATE TABLE IF NOT EXISTS downloads (