Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -390,38 +390,41 @@ def clear_fn():
|
|
| 390 |
return "",[(None,None)]
|
| 391 |
def itt(url):
|
| 392 |
out=[]
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
r=requests.get(f'{url}.{i}.{d}.pdf')
|
| 403 |
-
if r.status_code==429:
|
| 404 |
-
time.sleep(61)
|
| 405 |
-
else:
|
| 406 |
-
break
|
| 407 |
-
if r.status_code == 200:
|
| 408 |
-
out.append(f'{url}.{i}.{d}.pdf')
|
| 409 |
-
yield out
|
| 410 |
-
for p in range(0,10):
|
| 411 |
-
print(p)
|
| 412 |
-
r1 = requests.get(f'{url}.{i}.{d}_{p}.pdf')
|
| 413 |
-
print(f'{url}.{i}.{d}_{p}.pdf')
|
| 414 |
-
print(r1.status_code)
|
| 415 |
-
if r1.status_code == 429:
|
| 416 |
while True:
|
| 417 |
-
|
| 418 |
-
if
|
| 419 |
time.sleep(61)
|
| 420 |
else:
|
| 421 |
-
break
|
| 422 |
-
if
|
| 423 |
-
out.append(f'{url}.{i}.{d}
|
| 424 |
-
yield out
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 425 |
yield out
|
| 426 |
|
| 427 |
with gr.Blocks() as app:
|
|
|
|
| 390 |
return "",[(None,None)]
|
| 391 |
def itt(url):
|
| 392 |
out=[]
|
| 393 |
+
try:
|
| 394 |
+
for i in range(55,1500):
|
| 395 |
+
print (i)
|
| 396 |
+
for d in range(0,10):
|
| 397 |
+
print (d)
|
| 398 |
+
r = requests.get(f'{url}.{i}.{d}.pdf')
|
| 399 |
+
print(f'{url}.{i}.{d}.pdf')
|
| 400 |
+
print(r.status_code)
|
| 401 |
+
if r.status_code == 429:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 402 |
while True:
|
| 403 |
+
r=requests.get(f'{url}.{i}.{d}.pdf')
|
| 404 |
+
if r.status_code==429:
|
| 405 |
time.sleep(61)
|
| 406 |
else:
|
| 407 |
+
break
|
| 408 |
+
if r.status_code == 200:
|
| 409 |
+
out.append(f'{url}.{i}.{d}.pdf')
|
| 410 |
+
yield out
|
| 411 |
+
for p in range(0,10):
|
| 412 |
+
print(p)
|
| 413 |
+
r1 = requests.get(f'{url}.{i}.{d}_{p}.pdf')
|
| 414 |
+
print(f'{url}.{i}.{d}_{p}.pdf')
|
| 415 |
+
print(r1.status_code)
|
| 416 |
+
if r1.status_code == 429:
|
| 417 |
+
while True:
|
| 418 |
+
r1=requests.get(f'{url}.{i}.{d}.pdf')
|
| 419 |
+
if r1.status_code==429:
|
| 420 |
+
time.sleep(61)
|
| 421 |
+
else:
|
| 422 |
+
break
|
| 423 |
+
if r1.status_code == 200:
|
| 424 |
+
out.append(f'{url}.{i}.{d}_{p}.pdf')
|
| 425 |
+
yield out
|
| 426 |
+
except Exception as e:
|
| 427 |
+
print (e)
|
| 428 |
yield out
|
| 429 |
|
| 430 |
with gr.Blocks() as app:
|