-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLinkGetter.py
More file actions
27 lines (19 loc) · 607 Bytes
/
LinkGetter.py
File metadata and controls
27 lines (19 loc) · 607 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""LinkGetter, extracts links of a certain format from HTML source in clipboard"""
from io import StringIO
import pyperclip
import re, sys, string, base64
prependurl=base64.b64decode(b"aHR0cHM6Ly9hbmltZWJ5dGVzLnR2Lw==")
prependurl=prependurl.decode("utf-8")
text =pyperclip.paste() #get from clipboard
text =text.replace("&","&")
prefix ='.*(to\w+\.php.*)".*'
middle ='6\.1'
suffix ='.*'
term = re.compile(prefix+middle+suffix)
for line in text.splitlines():
# print(line)
m1 = term.search(line)
if m1:
print(prependurl+m1.group(1))
# print("match")
# input("Press Enter to continue...")