Fix YGG spam
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Michel Roux 2020-10-19 23:15:58 +02:00
parent f67c561d00
commit d2d8578c1a
4 changed files with 11 additions and 8 deletions

View File

@ -8,7 +8,7 @@ links = AnimeLink.query.all()
for link in links:
html = curl_content(link.link, debug=False)
if html['http_code'] != 200:
if html['http_code'] != 200 and html['http_code'] != 500:
print('(%d) %s %s : %s' % (html['http_code'], link.title.name, link.season, link.link))
elif 'darkgray' in str(html['output']):
print('(darkgray) %s %s : %s' % (link.title.name, link.season, link.link))

View File

@ -11,9 +11,9 @@ load_dotenv()
IS_DEBUG = environ.get('FLASK_ENV', 'production') == 'development'
ADMIN_USERNAME = environ.get('ADMIN_USERNAME', 'admin')
ADMIN_PASSWORD = generate_password_hash(environ.get('ADMIN_PASSWORD', 'secret'))
APP_PORT = environ.get('FLASK_PORT', 5000)
CACHE_TIMEOUT = environ.get('CACHE_TIMEOUT', 60 * 60)
REQUESTS_TIMEOUT = environ.get('REQUESTS_TIMEOUT', 5)
APP_PORT = int(environ.get('FLASK_PORT', 5000))
CACHE_TIMEOUT = int(environ.get('CACHE_TIMEOUT', 60 * 60))
REQUESTS_TIMEOUT = int(environ.get('REQUESTS_TIMEOUT', 5))
BLACKLIST_WORDS = environ.get('BLACKLIST_WORDS', '').split(',') if environ.get('BLACKLIST_WORDS', '') else []
MYSQL_ENABLED = False

View File

@ -75,6 +75,9 @@ class YggTorrent(ConnectorCore):
self.on_error = False
self.is_more = valid_trs and valid_trs is not len(trs) - 1
elif response['http_code'] == 500:
self.on_error = False
self.is_more = True
class YggAnimation(YggTorrent):

View File

@ -25,11 +25,11 @@
<tbody>
{% for connector in connectors %}
{% for torrent in connector.data %}
{% if not loop.index0 %}
<th colspan="8">{{ connector.title }}</th>
{% endif %}
{% if connector.data|length > 0 or connector.is_more %}
<th colspan="8">{{ connector.title }}</th>
{% endif %}
{% for torrent in connector.data %}
<tr class="{{ torrent.class }}">
<td>
{{ torrent.lang.value }}