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:
|
if debug:
|
||||||
print('Returning a human readable version of the feed')
|
print('Returning a human readable version of the feed')
|
||||||
i = 0
|
|
||||||
userFeed = parseUserFeed(session, outboxUrl, asHeader,
|
userFeed = parseUserFeed(session, outboxUrl, asHeader,
|
||||||
projectVersion, httpPrefix, domain, debug)
|
projectVersion, httpPrefix, domain, debug)
|
||||||
|
if not userFeed:
|
||||||
|
return personPosts
|
||||||
|
|
||||||
|
i = 0
|
||||||
for item in userFeed:
|
for item in userFeed:
|
||||||
if not item.get('id'):
|
if not item.get('id'):
|
||||||
if debug:
|
if debug:
|
||||||
|
@ -3673,12 +3676,16 @@ def getPublicPostsOfPerson(baseDir: str, nickname: str, domain: str,
|
||||||
personCache = {}
|
personCache = {}
|
||||||
cachedWebfingers = {}
|
cachedWebfingers = {}
|
||||||
federationList = []
|
federationList = []
|
||||||
|
groupAccount = False
|
||||||
|
if nickname.startswith('!'):
|
||||||
|
nickname = nickname[1:]
|
||||||
|
groupAccount = True
|
||||||
domainFull = getFullDomain(domain, port)
|
domainFull = getFullDomain(domain, port)
|
||||||
handle = httpPrefix + "://" + domainFull + "/@" + nickname
|
handle = httpPrefix + "://" + domainFull + "/@" + nickname
|
||||||
|
|
||||||
wfRequest = \
|
wfRequest = \
|
||||||
webfingerHandle(session, handle, httpPrefix, cachedWebfingers,
|
webfingerHandle(session, handle, httpPrefix, cachedWebfingers,
|
||||||
domain, projectVersion, debug, False)
|
domain, projectVersion, debug, groupAccount)
|
||||||
if not wfRequest:
|
if not wfRequest:
|
||||||
if debug:
|
if debug:
|
||||||
print('No webfinger result was returned for ' + handle)
|
print('No webfinger result was returned for ' + handle)
|
||||||
|
|
|
@ -124,7 +124,8 @@ def getJson(session, url: str, headers: {}, params: {}, debug: bool,
|
||||||
else:
|
else:
|
||||||
print('WARN: getJson url: ' + url +
|
print('WARN: getJson url: ' + url +
|
||||||
' failed with error code ' +
|
' failed with error code ' +
|
||||||
str(result.status_code))
|
str(result.status_code) +
|
||||||
|
' headers: ' + str(sessionHeaders))
|
||||||
return result.json()
|
return result.json()
|
||||||
except requests.exceptions.RequestException as e:
|
except requests.exceptions.RequestException as e:
|
||||||
sessionHeaders2 = sessionHeaders.copy()
|
sessionHeaders2 = sessionHeaders.copy()
|
||||||
|
|
Loading…
Reference in New Issue