parsee-mizuhashi commited on
Commit
7aa68df
1 Parent(s): ee6f13a

base64 is today's worst module

Browse files
Files changed (1) hide show
  1. app.py +10 -8
app.py CHANGED
@@ -33,13 +33,16 @@ def get_blocked_urls():
33
  raw_string = raw_string[1:-1].split(';')
34
  result = raw_string
35
  for i in range(len(result)):
 
 
36
  try:
37
- decodedurl = base64.b64decode(result[i]).decode('utf-8')
38
-
 
39
  except:
40
- decodedurl = None
41
- if decodedurl:
42
- result[i] = f"{result[i]} < {decodedurl} >[thisisb64]"
43
 
44
  if len(result) > 0:
45
  return (result)
@@ -61,11 +64,10 @@ def handle_refresh():
61
  for url in get_blocked_urls():
62
  if "[thisisb64]" in url:
63
  url = url.replace("[thisisb64]", "")
64
- # primary color [primary_100]
65
  nondecoded = url.split('<')[0]
66
  decodedurl = url.split('<')[1]
67
- decodedurl = f"<{decodedurl}>"
68
- xs += '<li><code>'+nondecoded+'</code> <font color="#4EACEF">&lt;"+decodedurl+"&gt;</font></li>'
69
  else:
70
  xs += "<li><code>"+url+"</code></li>"
71
  xs += "</ol>"
 
33
  raw_string = raw_string[1:-1].split(';')
34
  result = raw_string
35
  for i in range(len(result)):
36
+ decodedurl = result[i]
37
+ repeats = 0
38
  try:
39
+ for _ in range(10):
40
+ decodedurl = base64.b64decode(f"{decodedurl}========================================================").decode('utf-8') # this took 2 hours to figure out
41
+ repeats += 1
42
  except:
43
+ pass
44
+ if decodedurl != result[i]:
45
+ result[i] = f"{result[i]} < {decodedurl} x{repeats}>[thisisb64]"
46
 
47
  if len(result) > 0:
48
  return (result)
 
64
  for url in get_blocked_urls():
65
  if "[thisisb64]" in url:
66
  url = url.replace("[thisisb64]", "")
 
67
  nondecoded = url.split('<')[0]
68
  decodedurl = url.split('<')[1]
69
+ decodedurl = f"&lt;{decodedurl.replace('>', '&gt;')}"
70
+ xs += '<li><code>'+nondecoded+'</code>' + '<p style="color: #4EACEF">'+decodedurl+'</p></li>'
71
  else:
72
  xs += "<li><code>"+url+"</code></li>"
73
  xs += "</ol>"