forked from indymedia/epicyon
Use handles
parent
b1672fb9d5
commit
549c531442
45
posts.py
45
posts.py
|
@ -3369,32 +3369,41 @@ def checkDomains(session, baseDir: str,
|
||||||
if singleCheck:
|
if singleCheck:
|
||||||
# checks a single random non-mutual
|
# checks a single random non-mutual
|
||||||
index = random.randrange(0, len(nonMutuals))
|
index = random.randrange(0, len(nonMutuals))
|
||||||
domainName = nonMutuals[index]
|
handle = nonMutuals[index]
|
||||||
blockedDomains = \
|
if '@' in handle:
|
||||||
getPublicPostDomainsBlocked(session, baseDir,
|
nonMutualNickname = handle.split('@')[0]
|
||||||
nickname, domain,
|
nonMutualDomain = handle.split('@')[1].strip()
|
||||||
proxyType, port, httpPrefix,
|
|
||||||
debug, projectVersion, [])
|
|
||||||
if blockedDomains:
|
|
||||||
if len(blockedDomains) > maxBlockedDomains:
|
|
||||||
followerWarningStr += domainName + '\n'
|
|
||||||
updateFollowerWarnings = True
|
|
||||||
else:
|
|
||||||
# checks all non-mutuals
|
|
||||||
for domainName in nonMutuals:
|
|
||||||
if domainName in followerWarningStr:
|
|
||||||
continue
|
|
||||||
blockedDomains = \
|
blockedDomains = \
|
||||||
getPublicPostDomainsBlocked(session, baseDir,
|
getPublicPostDomainsBlocked(session, baseDir,
|
||||||
nickname, domain,
|
nonMutualNickname,
|
||||||
|
nonMutualDomain,
|
||||||
proxyType, port, httpPrefix,
|
proxyType, port, httpPrefix,
|
||||||
debug, projectVersion, [])
|
debug, projectVersion, [])
|
||||||
if blockedDomains:
|
if blockedDomains:
|
||||||
print(domainName)
|
if len(blockedDomains) > maxBlockedDomains:
|
||||||
|
followerWarningStr += handle + '\n'
|
||||||
|
updateFollowerWarnings = True
|
||||||
|
else:
|
||||||
|
# checks all non-mutuals
|
||||||
|
for handle in nonMutuals:
|
||||||
|
if '@' not in handle:
|
||||||
|
continue
|
||||||
|
if handle in followerWarningStr:
|
||||||
|
continue
|
||||||
|
nonMutualNickname = handle.split('@')[0]
|
||||||
|
nonMutualDomain = handle.split('@')[1].strip()
|
||||||
|
blockedDomains = \
|
||||||
|
getPublicPostDomainsBlocked(session, baseDir,
|
||||||
|
nonMutualNickname,
|
||||||
|
nonMutualDomain,
|
||||||
|
proxyType, port, httpPrefix,
|
||||||
|
debug, projectVersion, [])
|
||||||
|
if blockedDomains:
|
||||||
|
print(handle)
|
||||||
for d in blockedDomains:
|
for d in blockedDomains:
|
||||||
print(' ' + d)
|
print(' ' + d)
|
||||||
if len(blockedDomains) > maxBlockedDomains:
|
if len(blockedDomains) > maxBlockedDomains:
|
||||||
followerWarningStr += domainName + '\n'
|
followerWarningStr += handle + '\n'
|
||||||
updateFollowerWarnings = True
|
updateFollowerWarnings = True
|
||||||
|
|
||||||
if updateFollowerWarnings and followerWarningStr:
|
if updateFollowerWarnings and followerWarningStr:
|
||||||
|
|
Loading…
Reference in New Issue