Single user instance when getting actor

main2
Bob Mottram 2019-10-21 00:01:12 +01:00
parent 5dc1f3db0d
commit 49b0a2de45
2 changed files with 7 additions and 3 deletions

View File

@ -907,8 +907,9 @@ if args.actor:
if nickname==domain:
personUrl=personUrl.replace('/users/','/actor/').replace('/channel/','/actor/').replace('/profile/','/actor/')
if not personUrl:
print('Failed to get actor url')
sys.exit()
# try single user instance
personUrl=httpPrefix+'://'+domain
asHeader = {'Accept': 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'}
if '/channel/' in personUrl:
asHeader = {'Accept': 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'}
personJson = getJson(session,personUrl,asHeader,None,__version__,httpPrefix,None)

View File

@ -167,7 +167,10 @@ def getPersonBox(baseDir: str,session,wfRequest: {},personCache: {}, \
else:
personUrl = httpPrefix+'://'+domain+'/users/'+nickname
if not personUrl:
return None,None,None,None,None,None,None,None
# try single user instance
personUrl = httpPrefix+'://'+domain
asHeader = {'Accept': 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'}
#return None,None,None,None,None,None,None,None
personJson = getPersonFromCache(baseDir,personUrl,personCache)
if not personJson:
if '/channel/' in personUrl: