diff options
Diffstat (limited to 'main.py')
-rwxr-xr-x | main.py | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -98,7 +98,8 @@ def clean_string(s, remove_junk=False): 'WITH A PASSWORD', 'ANT', 'YEAR', - 'RECOGNIZED' + 'RECOGNIZED', + #'SEARCHED' #'LEGAL', #'FIGHTING' ] @@ -124,7 +125,7 @@ def clean_string(s, remove_junk=False): return s -def decode(s): +def decode(s, is_url=False): buf = '' for word in s.split(' '): word = word.strip() @@ -133,7 +134,7 @@ def decode(s): if re.match(r'^\d+\%$', word): buf += word - elif word.endswith('://'): + elif is_url and word.endswith('://'): buf += word[0] buf += '://' else: @@ -148,6 +149,7 @@ def main(): parser.add_argument('--stats', action='store_true') parser.add_argument('--decode-string') parser.add_argument('--with-junk', action='store_true') + parser.add_argument('--is-url', action='store_true') args = parser.parse_args() data = load_data() @@ -178,7 +180,7 @@ def main(): print(args.decode_string) print_colored(text, 'green', fallback_prefix='[CLEANED] ') - print_colored(decode(text), 'cyan', fallback_prefix='[DECODED] ') + print_colored(decode(text, is_url=args.is_url), 'cyan', fallback_prefix='[DECODED] ') elif args.stats: count = len(data) |