Use id uf url is unavailable

main
Bob Mottram 2020-12-17 19:54:07 +00:00
parent 93e4ab9337
commit 3122b8b3a6
1 changed files with 10 additions and 6 deletions

View File

@ -547,9 +547,11 @@ def getPostsForBlockedDomains(baseDir: str,
if isinstance(item['object']['inReplyTo'], str):
postDomain, postPort = \
getDomainFromActor(item['object']['inReplyTo'])
if isBlockedDomain(baseDir, postDomain) and \
item['object'].get('url'):
if isBlockedDomain(baseDir, postDomain):
if item['object'].get('url'):
url = item['object']['url']
else:
url = item['object']['id']
if not blockedPosts.get(postDomain):
blockedPosts[postDomain] = [url]
else:
@ -563,9 +565,11 @@ def getPostsForBlockedDomains(baseDir: str,
if tagItem.get('href'):
postDomain, postPort = \
getDomainFromActor(tagItem['href'])
if isBlockedDomain(baseDir, postDomain) and \
item['object'].get('url'):
if isBlockedDomain(baseDir, postDomain):
if item['object'].get('url'):
url = item['object']['url']
else:
url = item['object']['id']
if not blockedPosts.get(postDomain):
blockedPosts[postDomain] = [url]
else: