chore: add useful local files

This commit is contained in:
Ubuntu 2026-06-22 20:53:06 +08:00
parent d5d235bf03
commit 29fea63d2e
2 changed files with 67 additions and 0 deletions

44
guanghuice-nginx.conf Normal file
View File

@ -0,0 +1,44 @@
server {
server_name guanghuice.com;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /code/ {
proxy_pass http://127.0.0.1:3002/;
proxy_set_header Host $host;
}
location /fanqie/ {
proxy_pass http://127.0.0.1:3916/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /orders/ {
proxy_pass http://127.0.0.1:3920/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /api/ {
proxy_pass http://193.112.126.174:3915/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/guanghuice.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/guanghuice.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
}
server {
if ($host = guanghuice.com) { return 301 https://$host$request_uri; }
listen 80;
server_name guanghuice.com;
return 404;
}

23
tools/bili_search.py Normal file
View File

@ -0,0 +1,23 @@
"""B站短剧搜索 - 公开API"""
import requests, json
url = 'https://api.bilibili.com/x/web-interface/search/type'
params = {'search_type': 'video', 'keyword': '短剧', 'page': 1}
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36',
'Referer': 'https://www.bilibili.com/'
}
r = requests.get(url, params=params, headers=headers, timeout=15)
data = r.json()
if data.get('code') == 0:
results = data.get('data', {}).get('result', [])
print(f'找到 {len(results)} 条结果')
for i, v in enumerate(results[:8], 1):
title = v.get('title', '').replace('<em class="keyword">', '').replace('</em>', '')
print(f'{i}. [{v.get("play",0)}播放] {title[:60]}')
print(f' UP: {v.get("author","")} | 时长: {v.get("duration","")}')
print()
else:
print(f'API错误: {data}')