sync: 环境变量配置 + 域名URL
This commit is contained in:
8
bot.py
8
bot.py
@@ -212,7 +212,7 @@ async def cb_getsub(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
|||||||
cm = gen_clash_meta([s])
|
cm = gen_clash_meta([s])
|
||||||
await send_del(q.message, f'```yaml\n{cm}\n```', parse_mode='Markdown')
|
await send_del(q.message, f'```yaml\n{cm}\n```', parse_mode='Markdown')
|
||||||
elif fmt == 'url':
|
elif fmt == 'url':
|
||||||
url = f'http://YOUR_SERVER:18888/{SUB_SECRET}/download?target=ClashMeta'
|
url = f'https://substore.mjjtop.com/{SUB_SECRET}/download?target=ClashMeta'
|
||||||
await send_del(q.message, f'📎 订阅URL:\n{url}')
|
await send_del(q.message, f'📎 订阅URL:\n{url}')
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -235,7 +235,7 @@ async def cb_getsub(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
|||||||
proto, fmt = parts[1], parts[2]
|
proto, fmt = parts[1], parts[2]
|
||||||
subs = alive if proto == 'all' else [s for s in alive if s['type'] == proto]
|
subs = alive if proto == 'all' else [s for s in alive if s['type'] == proto]
|
||||||
if fmt == 'clash':
|
if fmt == 'clash':
|
||||||
url = f'http://YOUR_SERVER:18888/{SUB_SECRET}/download?target=ClashMeta'
|
url = f'https://substore.mjjtop.com/{SUB_SECRET}/download?target=ClashMeta'
|
||||||
if proto != 'all': url += f'&type={proto}'
|
if proto != 'all': url += f'&type={proto}'
|
||||||
return await send_del(q.message, f'📎 Clash Meta 订阅链接:\n{url}')
|
return await send_del(q.message, f'📎 Clash Meta 订阅链接:\n{url}')
|
||||||
links = '\n'.join(s['link'] for s in subs)
|
links = '\n'.join(s['link'] for s in subs)
|
||||||
@@ -249,7 +249,7 @@ async def cb_getsub(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
|||||||
return
|
return
|
||||||
|
|
||||||
if action == 'get_all_clash':
|
if action == 'get_all_clash':
|
||||||
url = 'http://YOUR_SERVER:18888/{SUB_SECRET}/download?target=ClashMeta'
|
url = f'https://substore.mjjtop.com/{SUB_SECRET}/download?target=ClashMeta'
|
||||||
await send_del(q.message, f'📎 Clash Meta 订阅链接:\n{url}')
|
await send_del(q.message, f'📎 Clash Meta 订阅链接:\n{url}')
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -340,7 +340,7 @@ async def cb_multiout(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
|||||||
await send_del(q.message, f'```yaml\n{cm}\n```', parse_mode='Markdown')
|
await send_del(q.message, f'```yaml\n{cm}\n```', parse_mode='Markdown')
|
||||||
elif fmt == 'url':
|
elif fmt == 'url':
|
||||||
names = ','.join(urllib.request.quote(s['name']) for s in chosen)
|
names = ','.join(urllib.request.quote(s['name']) for s in chosen)
|
||||||
url = f'http://YOUR_SERVER:18888/{SUB_SECRET}/download?target=ClashMeta&name={names}'
|
url = f'https://substore.mjjtop.com/{SUB_SECRET}/download?target=ClashMeta&name={names}'
|
||||||
await send_del(q.message, f'📎 订阅URL:\n{url}')
|
await send_del(q.message, f'📎 订阅URL:\n{url}')
|
||||||
elif fmt == 'b64':
|
elif fmt == 'b64':
|
||||||
links = '\n'.join(s['link'] for s in chosen)
|
links = '\n'.join(s['link'] for s in chosen)
|
||||||
|
|||||||
Reference in New Issue
Block a user