Spaces:
Running
Running
Commit
·
0ed19f1
1
Parent(s):
327d1ae
experimental b64 decode
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import requests
|
| 2 |
from bs4 import BeautifulSoup
|
| 3 |
import re
|
| 4 |
import gradio as gr
|
|
@@ -32,6 +32,14 @@ def get_blocked_urls():
|
|
| 32 |
# trim 1 char front and back, split the text with ';' into array
|
| 33 |
raw_string = raw_string[1:-1].split(';')
|
| 34 |
result = raw_string
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
if len(result) > 0:
|
| 37 |
return (result)
|
|
|
|
| 1 |
+
import requests, base64
|
| 2 |
from bs4 import BeautifulSoup
|
| 3 |
import re
|
| 4 |
import gradio as gr
|
|
|
|
| 32 |
# trim 1 char front and back, split the text with ';' into array
|
| 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}"
|
| 43 |
|
| 44 |
if len(result) > 0:
|
| 45 |
return (result)
|