Skip to content
This repository has been archived by the owner on Dec 7, 2024. It is now read-only.

Commit

Permalink
u
Browse files Browse the repository at this point in the history
  • Loading branch information
lgc2333 committed Feb 1, 2024
1 parent 7cc94ec commit 5f18599
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ plugins = [

| 配置项 | 必填 | 默认值 | 说明 |
| :-------------------: | :--: | :-----: | :-------------------------------------: |
| `PROXY` || `None` | 插件请求 API 使用的代理地址 |
| `RIFFUSION_TIMEOUT` || `30` | 插件请求接口超时,单位秒 |
| `RIFFUSION_BREAK_URL` || `False` | 是否破坏插件消息中的 URL 以降低风控概率 |

Expand Down Expand Up @@ -143,6 +144,10 @@ Telegram:[@lgc2333](https://t.me/lgc2333)

## 📝 更新日志

### 0.1.2

- 添加 `PROXY` 配置项

### 0.1.1

- 修复 `-h` 参数无效的问题
2 changes: 1 addition & 1 deletion nonebot_plugin_riffusion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from . import __main__ as __main__ # noqa: E402
from .config import ConfigModel # noqa: E402

__version__ = "0.1.1"
__version__ = "0.1.2"
__plugin_meta__ = PluginMetadata(
name="Riffusion",
description="你给歌词,AI 作曲",
Expand Down
4 changes: 4 additions & 0 deletions nonebot_plugin_riffusion/config.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
from typing import Optional

from nonebot import get_driver
from pydantic import BaseModel


class ConfigModel(BaseModel):
proxy: Optional[str] = None

riffusion_timeout: float = 30
riffusion_break_url: bool = False

Expand Down
2 changes: 1 addition & 1 deletion nonebot_plugin_riffusion/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def get_random_lyrics() -> str:


async def generate_single(lyrics: str, prompt: str, tag: str) -> SingleGeneratedResult:
async with AsyncClient() as cli:
async with AsyncClient(proxies=config.proxy) as cli:
resp = await cli.post(
"https://www.riffusion.com/api/trpc/inference.singleTextToAudio",
headers={
Expand Down

0 comments on commit 5f18599

Please sign in to comment.