mirror of
https://github.com/lifekiller/rarbg.git
synced 2025-06-01 23:30:19 -07:00
update ttl to 15 minutes
This commit is contained in:
parent
ce5867d9c7
commit
85a5afb2fd
5
rarbg.py
5
rarbg.py
@ -23,7 +23,7 @@ TEMPLATE = Template('''
|
|||||||
<channel>
|
<channel>
|
||||||
<title>{{title}}</title>
|
<title>{{title}}</title>
|
||||||
<link>https://torrentapi.org/apidocs_v2.txt</link>
|
<link>https://torrentapi.org/apidocs_v2.txt</link>
|
||||||
<ttl>3600</ttl>
|
<ttl>15</ttl>
|
||||||
{% for entry in entries %}
|
{% for entry in entries %}
|
||||||
<item>
|
<item>
|
||||||
<title>{{entry.title}} ({{entry.hsize}})</title>
|
<title>{{entry.title}} ({{entry.hsize}})</title>
|
||||||
@ -85,8 +85,9 @@ async def api(params):
|
|||||||
query_text = pretty(params)
|
query_text = pretty(params)
|
||||||
secho('[{}] {}'.format(request_id, query_text), fg='cyan')
|
secho('[{}] {}'.format(request_id, query_text), fg='cyan')
|
||||||
|
|
||||||
|
await update_token()
|
||||||
|
|
||||||
async with api_rate_limit:
|
async with api_rate_limit:
|
||||||
await update_token()
|
|
||||||
params.update(token=app.token, format='json_extended')
|
params.update(token=app.token, format='json_extended')
|
||||||
resp = await get(API_ENDPOINT, params=params)
|
resp = await get(API_ENDPOINT, params=params)
|
||||||
data = await resp.json()
|
data = await resp.json()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user