mirror of
https://github.com/myned/modufur.git
synced 2024-12-24 14:27:27 +00:00
Merge branch 'dev'
This commit is contained in:
commit
80a736a481
1 changed files with 6 additions and 1 deletions
|
@ -557,6 +557,11 @@ class MsG:
|
||||||
raise exc.TagBlacklisted(tag)
|
raise exc.TagBlacklisted(tag)
|
||||||
|
|
||||||
# Checks for blacklisted tags in endpoint blacklists - try/except is for continuing the parent loop
|
# Checks for blacklisted tags in endpoint blacklists - try/except is for continuing the parent loop
|
||||||
|
order = False
|
||||||
|
for tag in tags:
|
||||||
|
if 'order:' in tag:
|
||||||
|
order = True
|
||||||
|
tags = ','.join(['order:random'] + tags) if not order else ','.join(tags)
|
||||||
posts = {}
|
posts = {}
|
||||||
temposts = len(posts)
|
temposts = len(posts)
|
||||||
empty = 0
|
empty = 0
|
||||||
|
@ -564,7 +569,7 @@ class MsG:
|
||||||
while len(posts) < limit:
|
while len(posts) < limit:
|
||||||
if c == limit * 5 + self.LIMIT:
|
if c == limit * 5 + self.LIMIT:
|
||||||
raise exc.Timeout
|
raise exc.Timeout
|
||||||
request = await u.fetch('https://{}.net/post/index.json'.format(booru), params={'tags': ','.join(['order:random'] + tags), 'limit': int(self.LIMIT * limit)}, json=True)
|
request = await u.fetch('https://{}.net/post/index.json'.format(booru), params={'tags': tags, 'limit': int(self.LIMIT * limit)}, json=True)
|
||||||
if len(request) == 0:
|
if len(request) == 0:
|
||||||
raise exc.NotFound(formatter.tostring(tags))
|
raise exc.NotFound(formatter.tostring(tags))
|
||||||
if len(request) < limit:
|
if len(request) < limit:
|
||||||
|
|
Loading…
Reference in a new issue