mirror of
https://gitlab.com/octospacc/bottocto
synced 2024-12-30 02:20:55 +01:00
aaaa I keep forgetting :(( I'm so R today
This commit is contained in:
parent
6df053305c
commit
d90ae0da00
@ -53,18 +53,21 @@ def HandleFeed(URLs, IncludeRetoots, IncludeReplies, LocalSave, SendMail, MailTo
|
||||
URL = URL.removesuffix('/').removesuffix('/with_replies') + '/with_replies'
|
||||
Usertag = f"{URL.split('/')[-2]}@{URL.split('/')[-3]}"
|
||||
Pages = []
|
||||
LastEntryIsNew, PageOlder = HandleURL(True, URL, Usertag, IncludeRetoots, IncludeReplies, LocalSave, SendMail, MailTo)
|
||||
LastEntryIsNew, PageOlder = HandleURL(True, URL, Usertag, IncludeRetoots, IncludeReplies, LocalSave, SendMail, MailTo, 1)
|
||||
if LastEntryIsNew and PageOlder:
|
||||
Pages += [PageOlder]
|
||||
while LastEntryIsNew and PageOlder and (MaxPagesRecursion <= 0 or len(Pages) < MaxPagesRecursion):
|
||||
LastEntryIsNew, PageOlder = HandleURL(True, PageOlder, Usertag, IncludeRetoots, IncludeReplies, LocalSave, SendMail, MailTo)
|
||||
LastEntryIsNew, PageOlder = HandleURL(True, PageOlder, Usertag, IncludeRetoots, IncludeReplies, LocalSave, SendMail, MailTo, 1)
|
||||
if LastEntryIsNew and PageOlder:
|
||||
Pages += [PageOlder]
|
||||
Pages.reverse()
|
||||
for Page in Pages:
|
||||
HandleURL(False, Page, Usertag, IncludeRetoots, IncludeReplies, LocalSave, SendMail, MailTo)
|
||||
TryCount, Try0, Try1 = 0, False, False
|
||||
while not Try0 and not Try1: # Handle retries
|
||||
TryCount += 1
|
||||
Try0, Try1 = HandleURL(False, Page, Usertag, IncludeRetoots, IncludeReplies, LocalSave, SendMail, MailTo, TryCount)
|
||||
|
||||
def HandleURL(IsFirstRun, URL, Usertag, IncludeRetoots, IncludeReplies, LocalSave, SendMail, MailTo):
|
||||
def HandleURL(IsFirstRun, URL, Usertag, IncludeRetoots, IncludeReplies, LocalSave, SendMail, MailTo, TryCount):
|
||||
LastEntryIsNew = False
|
||||
PageOlder = ''
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user