From 79a01bc478bc9bfda467612928d3be8646f2cf8d Mon Sep 17 00:00:00 2001 From: xyve Date: Wed, 18 Jun 2025 23:12:47 -0500 Subject: [PATCH 1/2] socialscan: added --exclude command line option --- socialscan/cli.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/socialscan/cli.py b/socialscan/cli.py index b7c2c39..ff16d57 100644 --- a/socialscan/cli.py +++ b/socialscan/cli.py @@ -51,6 +51,13 @@ def init_parser(): nargs="*", help="list of platforms to query " "(default: all platforms)", ) + parser.add_argument( + "--exclude", + "-e", + metavar="exclude", + nargs="*", + help="list of platforms to exclude " "(default: no platforms)", + ) parser.add_argument( "--view-by", dest="view_key", @@ -183,6 +190,15 @@ async def main(): raise ValueError(p + " is not a valid platform") else: platforms = [p for p in Platforms] + + if args.exclude: + for e in args.exclude: + if e.upper() in Platforms.__members__: + platform_found = Platforms[e.upper()] + platforms.remove(platform_found); + else: + raise ValueError(e + " is not a valid platform") + proxy_list = [] if args.proxy_list: with open(args.proxy_list, "r") as f: From 56c3168b77485615e6594462818c5a598b3140cc Mon Sep 17 00:00:00 2001 From: xyve Date: Thu, 19 Jun 2025 12:09:41 -0500 Subject: [PATCH 2/2] socialscan: check if the excluded platform is even in the platforms array --- socialscan/cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/socialscan/cli.py b/socialscan/cli.py index ff16d57..8433b48 100644 --- a/socialscan/cli.py +++ b/socialscan/cli.py @@ -195,7 +195,8 @@ async def main(): for e in args.exclude: if e.upper() in Platforms.__members__: platform_found = Platforms[e.upper()] - platforms.remove(platform_found); + if platform_found in platforms: + platforms.remove(platform_found); else: raise ValueError(e + " is not a valid platform")