-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
`Update to v2.0.0`. A replacement of qsreplace, accepts URLs as standard input, replaces all query string values with user-supplied values and stdout. Works on every OS. Made with python
- Loading branch information
Showing
3 changed files
with
28 additions
and
29 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env python3 | ||
''' | ||
Author: R0X4R (Eshan Singh) | ||
Version: 2.0.0 | ||
''' | ||
import re | ||
import urllib.parse as ul | ||
from sys import stdin, stdout, argv, exit | ||
|
||
encoded = ul.quote(str(argv[1]), safe='') | ||
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) |