-
-
Save gopinath6/37b9fca895e8f62b07b1783a2c337c3b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import sys | |
urls=[] | |
try: | |
file_name=sys.argv[1] | |
replacement=sys.argv[2] | |
except: | |
print("[!] Enter urls file name") | |
else: | |
try: | |
with open(file_name,'r') as fh: | |
for line in fh: | |
urls.append(line) | |
except: | |
print("File not Found") | |
else: | |
regex2=r'=(.*)$' | |
final=[] | |
for line in urls: | |
params=[] | |
if '?' in line: | |
params.append(line.split('?')[0]) | |
x=line.split('?')[1] | |
z=x.split('&') | |
for a in z: | |
params.append(re.sub(regex2, '='+replacement+'&', a)) | |
final.append('?'.join(params).replace('&?','&').rstrip('\n&')) | |
for a in final: | |
if 'http' in a: | |
print(a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment