File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -28,9 +28,17 @@ def __init__(self, last_id=None):
28
28
def update (self ):
29
29
'''update(self) - Fill Queue with new Pastebin IDs'''
30
30
logging .info ('Retrieving Pastebin ID\' s' )
31
- results = BeautifulSoup (helper .download (self .BASE_URL + '/archive' )).find_all (
32
- lambda tag : tag .name == 'td' and tag .a and '/archive/' not in tag .a ['href' ] and tag .a ['href' ][1 :])
33
31
new_pastes = []
32
+ raw = None
33
+ while not raw :
34
+ try :
35
+ raw = self .session .get (self .BASE_URL + '/archive' ).text
36
+ except :
37
+ logging .info ('Error with pastebin' )
38
+ raw = None
39
+ sleep (5 )
40
+ results = BeautifulSoup (raw ).find_all (
41
+ lambda tag : tag .name == 'td' and tag .a and '/archive/' not in tag .a ['href' ] and tag .a ['href' ][1 :])
34
42
if not self .ref_id :
35
43
results = results [:60 ]
36
44
for entry in results :
You can’t perform that action at this time.
0 commit comments