mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-05-27 11:10:41 +08:00
add action templates
This commit is contained in:
33
app/actions/fetch_rss.py
Normal file
33
app/actions/fetch_rss.py
Normal file
@@ -0,0 +1,33 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
from app.actions import BaseAction
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
|
||||
|
||||
class FetchRssParams(ActionParams):
|
||||
"""
|
||||
获取RSS资源列表参数
|
||||
"""
|
||||
url: str = Field(None, description="RSS地址")
|
||||
proxy: Optional[bool] = Field(False, description="是否使用代理")
|
||||
timeout: Optional[int] = Field(15, description="超时时间")
|
||||
headers: Optional[dict] = Field(None, description="请求头")
|
||||
recognize: Optional[bool] = Field(False, description="是否识别")
|
||||
|
||||
|
||||
class FetchRssAction(BaseAction):
|
||||
"""
|
||||
获取RSS资源列表
|
||||
"""
|
||||
@property
|
||||
def name(self) -> str:
|
||||
return "获取RSS资源列表"
|
||||
|
||||
@property
|
||||
def description(self) -> str:
|
||||
return "请求RSS地址获取数据,并解析为资源列表"
|
||||
|
||||
async def execute(self, params: FetchRssParams, context: ActionContext) -> ActionContext:
|
||||
pass
|
||||
Reference in New Issue
Block a user