Skip to content

Commit

Permalink
Merge pull request #3 from R0X4R/dev
Browse files Browse the repository at this point in the history
fixed `some-issues`
  • Loading branch information
R0X4R authored Dec 12, 2021
2 parents 3aaeab4 + e9c986e commit 3d8e69e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src=".github/image.png" width=30%>
<img src=".github/image.png" width=20%>
</p>
<h1 align="center">
<b>Bhedak</b>
Expand Down
12 changes: 8 additions & 4 deletions bhedak.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@
import urllib.parse as ul
from sys import stdin, stdout, argv, exit

encoded = ul.quote(str(argv[1]), safe='')
#@> TAKE INPUT FROM USER AS "sys.argv[1]"", ELSE IT WILL USE "FUZZ" AS THE VALUE
try:
encoded = ul.quote(str(argv[1]), safe='')
except IndexError:
encoded = ul.quote("FUZZ", safe='')

#@> READ URLs AS STDIN AND USE REGEX TO FILTER AND REPLACE
try:
for url in stdin.readlines():
domain = str(url.strip())
stdout.write(re.sub(r"=[^?\|&]*", '=' + str(encoded), str(domain)) + '\n')
except KeyboardInterrupt:
exit(0)
except IndexError:
exit(127)
except:
exit(127)
exit(127)

0 comments on commit 3d8e69e

Please sign in to comment.