Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions linkfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# Regex used
regex_str = r"""

(?:"|') # Start newline delimiter
(?:"|'|=) # Start newline delimiter

(
((?:[a-zA-Z]{1,10}://|//) # Match a scheme [a-Z]*1-10 or //
Expand All @@ -38,8 +38,8 @@
|

((?:/|\.\./|\./) # Start with /,../,./
[^"'><,;| *()(%%$^/\\\[\]] # Next character can't be...
[^"'><,;|()]{1,}) # Rest of the characters can't be
[^"'><,;|\ *()(%%$^/\\\[\]] # Next character can't be...
[^"'><,;|\ ()]{1,}) # Rest of the characters can't be

|

Expand All @@ -63,7 +63,7 @@

)

(?:"|') # End newline delimiter
(?:"|'|\ ) # End newline delimiter

"""

Expand Down Expand Up @@ -130,11 +130,11 @@ def send_request(url):
q.add_header('Cookie', args.cookies)

try:
sslcontext = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
response = urlopen(q, timeout=args.timeout, context=sslcontext)
except:
response = urlopen(q, timeout=args.timeout, context=ssl._create_unverified_context())
except Exception as e:
print(e)
sslcontext = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
response = urlopen(q, timeout=args.timeout, context=sslcontext)
response = urlopen(q, timeout=args.timeout, context=ssl._create_unverified_context())

if response.info().get('Content-Encoding') == 'gzip':
data = GzipFile(fileobj=readBytesCustom(response.read())).read()
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
jsbeautifier
pytest