diff options
author | rusinthread <rusinthread@cock.li> | 2016-12-23 04:27:31 +0300 |
---|---|---|
committer | rusinthread <rusinthread@cock.li> | 2016-12-23 04:32:55 +0300 |
commit | 63771feba881d8127e1a2fc0c416869ead17baf3 (patch) | |
tree | 718d424519ba3908a6d438e8a82a89a285a6c45c | |
parent | 5298146ed6a1123a342aec3633debeba0ad372b7 (diff) |
don't know what...
-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) |