Skip to content
This repository was archived by the owner on Apr 26, 2026. It is now read-only.

Commit abedf58

Browse files
committed
Add option to start processing from specific case number
Introduces a --start-from-case argument to process_compromised_accounts, allowing processing to begin from a specified case number. This helps resume or segment processing of compromised accounts more efficiently.
1 parent 75ab90d commit abedf58

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

Tool-14-URL-Redirect-Tracer.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ def save_data(data, filename, backup=False):
765765

766766

767767
# Main function to process the JSON file using a multithreaded approach
768-
def process_compromised_accounts(max_workers=10, batch_size=20, max_accounts=None):
768+
def process_compromised_accounts(max_workers=10, batch_size=20, max_accounts=None, start_from_case=None):
769769
logger.info("Starting to process compromised Discord accounts...")
770770
start_time = time.time()
771771

@@ -810,6 +810,19 @@ def process_compromised_accounts(max_workers=10, batch_size=20, max_accounts=Non
810810
# Create a backup of the original data
811811
save_data(data, "Compromised-Discord-Accounts", backup=True)
812812

813+
# Filter accounts if start_from_case is specified
814+
if start_from_case is not None:
815+
filtered_data = {}
816+
start_processing = False
817+
for account_key, account_info in data.items():
818+
case_num = int(account_info.get("CASE_NUMBER", "0"))
819+
if case_num >= start_from_case:
820+
start_processing = True
821+
if start_processing:
822+
filtered_data[account_key] = account_info
823+
data = filtered_data
824+
logger.info(f"Starting processing from case number {start_from_case}, {len(data)} accounts remaining")
825+
813826
# Limit the number of accounts to process if specified
814827
if max_accounts and len(data) > max_accounts:
815828
logger.info(f"Limiting processing to {max_accounts} accounts")
@@ -942,14 +955,24 @@ def process_compromised_accounts(max_workers=10, batch_size=20, max_accounts=Non
942955
default=None,
943956
help="Maximum number of accounts to process",
944957
)
958+
parser.add_argument(
959+
"--start-from-case",
960+
type=int,
961+
default=None,
962+
help="Case number to start processing from",
963+
)
945964

946965
args = parser.parse_args()
947966

948967
logger.info(
949968
f"Starting with {args.max_workers} workers, batch size {args.batch_size}"
950969
)
970+
if args.start_from_case:
971+
logger.info(f"Starting processing from case number {args.start_from_case}")
972+
951973
process_compromised_accounts(
952974
max_workers=args.max_workers,
953975
batch_size=args.batch_size,
954976
max_accounts=args.max_accounts,
977+
start_from_case=args.start_from_case,
955978
)

0 commit comments

Comments
 (0)