mirror of https://gitlab.com/octospacc/bottocto
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'
|
URL = URL.removesuffix('/').removesuffix('/with_replies') + '/with_replies'
|
||||||
Usertag = f"{URL.split('/')[-2]}@{URL.split('/')[-3]}"
|
Usertag = f"{URL.split('/')[-2]}@{URL.split('/')[-3]}"
|
||||||
Pages = []
|
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:
|
if LastEntryIsNew and PageOlder:
|
||||||
Pages += [PageOlder]
|
Pages += [PageOlder]
|
||||||
while LastEntryIsNew and PageOlder and (MaxPagesRecursion <= 0 or len(Pages) < MaxPagesRecursion):
|
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:
|
if LastEntryIsNew and PageOlder:
|
||||||
Pages += [PageOlder]
|
Pages += [PageOlder]
|
||||||
Pages.reverse()
|
Pages.reverse()
|
||||||
for Page in Pages:
|
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
|
LastEntryIsNew = False
|
||||||
PageOlder = ''
|
PageOlder = ''
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue