Spaces:
Running
Running
Commit
·
c620f9f
1
Parent(s):
e676aa7
Update main.py
Browse files
main.py
CHANGED
@@ -21,7 +21,7 @@ with open('active_urls.pkl', 'rb') as f:
|
|
21 |
from io import BytesIO
|
22 |
url = 'https://storage.googleapis.com/bmllc-data-bucket/exceptions.pkl'
|
23 |
response = requests.get(url)
|
24 |
-
exceptions =
|
25 |
|
26 |
live_urls = [i for i in live_urls if i not in exceptions]
|
27 |
|
@@ -71,7 +71,7 @@ def proxy(url):
|
|
71 |
print(f'Redirecting')
|
72 |
exceptions.append(url)
|
73 |
byte_stream = BytesIO()
|
74 |
-
|
75 |
byte_stream.seek(0)
|
76 |
url = 'https://storage.googleapis.com/bmllc-data-bucket/exceptions.pkl'
|
77 |
response = requests.put(url, data=byte_stream.read())
|
|
|
21 |
from io import BytesIO
|
22 |
url = 'https://storage.googleapis.com/bmllc-data-bucket/exceptions.pkl'
|
23 |
response = requests.get(url)
|
24 |
+
exceptions = pkl.loads(BytesIO(response.content).read())
|
25 |
|
26 |
live_urls = [i for i in live_urls if i not in exceptions]
|
27 |
|
|
|
71 |
print(f'Redirecting')
|
72 |
exceptions.append(url)
|
73 |
byte_stream = BytesIO()
|
74 |
+
pkl.dump(exceptions, byte_stream)
|
75 |
byte_stream.seek(0)
|
76 |
url = 'https://storage.googleapis.com/bmllc-data-bucket/exceptions.pkl'
|
77 |
response = requests.put(url, data=byte_stream.read())
|