diff --git a/ofscraper/actions/actions/download/batch/downloadbatch.py b/ofscraper/actions/actions/download/batch/downloadbatch.py index 7c9e797a5..8c0f26cff 100644 --- a/ofscraper/actions/actions/download/batch/downloadbatch.py +++ b/ofscraper/actions/actions/download/batch/downloadbatch.py @@ -50,9 +50,10 @@ async def process_dicts(username, model_id, filtered_medialist,posts): log = logging.getLogger("shared") log.info("Downloading in batch mode") log_text_array=[] - if read_args.retriveArgs().download_text: - log_text_array.append(await textDownloader(posts, username=username)) - if len(get_download_area())==0: + log_text_array.append(await textDownloader(posts, username=username) or []) + if read_args.retriveArgs().text_only: + return log_text_array,(0,0,0,0,0) + elif len(get_download_area())==0: return log_text_array,(0,0,0,0,0) elif len(filtered_medialist)==0: empty_log=final_log_text(username,0,0,0,0,0,0) diff --git a/ofscraper/actions/actions/download/normal/downloadnormal.py b/ofscraper/actions/actions/download/normal/downloadnormal.py index 3fb678269..99fa360f3 100644 --- a/ofscraper/actions/actions/download/normal/downloadnormal.py +++ b/ofscraper/actions/actions/download/normal/downloadnormal.py @@ -40,9 +40,10 @@ async def process_dicts(username, model_id, medialist,posts): log_text_array=[] download_log_clear_helper() - if read_args.retriveArgs().download_text: - log_text_array.append(await textDownloader(posts, username=username)) - if len(get_download_area())==0: + log_text_array.append(await textDownloader(posts, username=username)or []) + if read_args.retriveArgs().text_only: + return log_text_array,(0,0,0,0,0) + elif len(get_download_area())==0: return log_text_array,(0,0,0,0,0) elif len(medialist)==0: empty_log=final_log_text(username,0,0,0,0,0,0) diff --git a/ofscraper/actions/actions/download/utils/text.py b/ofscraper/actions/actions/download/utils/text.py index 9a3542634..2fb4acc2a 100644 --- a/ofscraper/actions/actions/download/utils/text.py +++ b/ofscraper/actions/actions/download/utils/text.py @@ -34,4 +34,4 @@ async def textDownloader(objectdicts, username=None): return logs.text_log(username, count, fails, exists, log=log) except Exception as E: log.debug(f"Issue with text {E}") - log.debug(f"Issue with text {traceback.format_exc()}") + log.debug(f"Issue with text {traceback.format_exc()}") \ No newline at end of file diff --git a/ofscraper/commands/runners/check.py b/ofscraper/commands/runners/check.py index e48f10909..2866ecd57 100644 --- a/ofscraper/commands/runners/check.py +++ b/ofscraper/commands/runners/check.py @@ -122,17 +122,10 @@ def process_item(): f"Downloading individual media ({media.filename}) to disk for {username}" ) operations.table_init_create(model_id=model_id, username=username) - if read_args.retriveArgs().text_only: - output=textDownloader(post,username) - - else: - output,values = downloadnormal.process_dicts(username, model_id, [media]) - if values is None or values[-1] == 1: - raise Exception("Download is marked as skipped") - else: - raise Exception("Issue getting download") - - + + output,values = downloadnormal.process_dicts(username, model_id, [media],[post]) + if values is None or values[-1] == 1: + raise Exception("Download is marked as skipped") log.info("Download Finished") update_globals(model_id,username,post,media,output) table.app.update_cell(key, "download_cart", "[downloaded]")