Handle actors with no public post feed

main
Bob Mottram 2021-08-02 21:43:53 +01:00
parent dda607ff00
commit dcf76f996e
2 changed files with 12 additions and 4 deletions

View File

@ -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)

View File

@ -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()