mirror of https://gitlab.com/bashrc2/epicyon
Handle actors with no public post feed
parent
dda607ff00
commit
dcf76f996e
13
posts.py
13
posts.py
|
@ -397,9 +397,12 @@ def _getPosts(session, outboxUrl: str, maxPosts: int,
|
|||
|
||||
if debug:
|
||||
print('Returning a human readable version of the feed')
|
||||
i = 0
|
||||
userFeed = parseUserFeed(session, outboxUrl, asHeader,
|
||||
projectVersion, httpPrefix, domain, debug)
|
||||
if not userFeed:
|
||||
return personPosts
|
||||
|
||||
i = 0
|
||||
for item in userFeed:
|
||||
if not item.get('id'):
|
||||
if debug:
|
||||
|
@ -3673,12 +3676,16 @@ def getPublicPostsOfPerson(baseDir: str, nickname: str, domain: str,
|
|||
personCache = {}
|
||||
cachedWebfingers = {}
|
||||
federationList = []
|
||||
|
||||
groupAccount = False
|
||||
if nickname.startswith('!'):
|
||||
nickname = nickname[1:]
|
||||
groupAccount = True
|
||||
domainFull = getFullDomain(domain, port)
|
||||
handle = httpPrefix + "://" + domainFull + "/@" + nickname
|
||||
|
||||
wfRequest = \
|
||||
webfingerHandle(session, handle, httpPrefix, cachedWebfingers,
|
||||
domain, projectVersion, debug, False)
|
||||
domain, projectVersion, debug, groupAccount)
|
||||
if not wfRequest:
|
||||
if debug:
|
||||
print('No webfinger result was returned for ' + handle)
|
||||
|
|
|
@ -124,7 +124,8 @@ def getJson(session, url: str, headers: {}, params: {}, debug: bool,
|
|||
else:
|
||||
print('WARN: getJson url: ' + url +
|
||||
' failed with error code ' +
|
||||
str(result.status_code))
|
||||
str(result.status_code) +
|
||||
' headers: ' + str(sessionHeaders))
|
||||
return result.json()
|
||||
except requests.exceptions.RequestException as e:
|
||||
sessionHeaders2 = sessionHeaders.copy()
|
||||
|
|
Loading…
Reference in New Issue