initial commit

This commit is contained in:
Alex Kelly 2026-03-04 11:15:38 -05:00
commit c474b7d96d
2 changed files with 61 additions and 0 deletions

41
README.md Normal file
View file

@ -0,0 +1,41 @@
# unfurl.py
Is Avanan email protection forced on you? Do you click avanan-checked links
only to get a stupid sad document icon with an inside-out umbrella telling you
"something went wrong" when all you wanted to do was change your email
preferences from some stupid newsletter?
That's all this script does. It "unfucks" the URL that avanan wrapped in its
own rewritten link.
Conveniently, their urls use a predictable
http://url.avanan.click/___your_actual_url___/moreavananbs
This script just takes that jumbled URL, and plucks out the stuff between the
___'s.
# Usage
## interactive
```
unfurl.py
```
You'll be prompted for the url.
## As argument
```
unfurl.py "avananlink"
```
## As stdin
```
echo "avananlink" | unfurl.py
```
## directly from your clipboard, and then put the cleaned one back on your clipboard
(using wayland's wl-copy/paste commands, but you can adjust based on whatever
your clipboard manager is)
```
wl-paste | unfurl.py | wl-copyunf
```

20
unfurl.py Executable file
View file

@ -0,0 +1,20 @@
#!/usr/bin/env python
import sys
import urllib.parse
if not sys.stdin.isatty():
url = sys.stdin.read().strip()
elif len(sys.argv) > 1:
url = sys.argv[1]
else:
url = input("Paste URL: ")
# Extract between ___ markers
start = url.find("___") + 3
end = url.find("___", start)
if start > 2 and end > 0:
extracted = url[start:end]
print(urllib.parse.unquote(extracted))
else:
print("Could not find ___ markers")