mirror of https://gitlab.com/bashrc2/epicyon
Resolving smithereen actors
parent
ca17ba9fe3
commit
1c732f5d70
|
@ -1332,7 +1332,7 @@ def getActorJson(handle: str, http: bool, gnunet: bool,
|
|||
personUrl = personUrl.replace('/u/', '/actor/')
|
||||
if not personUrl:
|
||||
# try single user instance
|
||||
personUrl = httpPrefix + '://' + domain
|
||||
personUrl = httpPrefix + '://' + domain + '/' + nickname
|
||||
headersList = (
|
||||
"ld+json", "jrd+json", "activity+json"
|
||||
)
|
||||
|
@ -1340,7 +1340,8 @@ def getActorJson(handle: str, http: bool, gnunet: bool,
|
|||
headersList = (
|
||||
"ld+json", "jrd+json", "activity+json"
|
||||
)
|
||||
|
||||
if debug:
|
||||
print('personUrl: ' + personUrl)
|
||||
for headerType in headersList:
|
||||
headerMimeType = 'application/' + headerType
|
||||
asHeader = {
|
||||
|
|
10
utils.py
10
utils.py
|
@ -851,6 +851,16 @@ def getNicknameFromActor(actor: str) -> str:
|
|||
elif '@' in actor:
|
||||
nickStr = actor.split('@')[0]
|
||||
return nickStr
|
||||
elif '://' in actor:
|
||||
domain = actor.split('://')[1]
|
||||
if '/' in domain:
|
||||
domain = domain.split('/')[0]
|
||||
if '://' + domain + '/' not in actor:
|
||||
return None
|
||||
nickStr = actor.split('://' + domain + '/')[1]
|
||||
if '/' in nickStr or '.' in nickStr:
|
||||
return None
|
||||
return nickStr
|
||||
return None
|
||||
nickStr = actor.split('/users/')[1].replace('@', '')
|
||||
if '/' not in nickStr:
|
||||
|
|
Loading…
Reference in New Issue