docs(README): 更新配置文件参数说明

This commit is contained in:
2025-03-23 16:50:09 +08:00
parent 3b4f23c670
commit 54e197e0fd
4 changed files with 30 additions and 11 deletions

View File

@@ -288,6 +288,12 @@ async def example():
</thead>
<tbody>
<tr>
<td align="center">mapping_data</td>
<td align="center">str: str</td>
<td align="center"><sup><a href="#author_archive">#</a></sup>作者别名映射表,格式:<code>作者ID: 作者别名</code></td>
<td align="center"></td>
</tr>
<tr>
<td align="center">work_path</td>
<td align="center">str</td>
<td align="center">作品数据 / 文件保存根路径</td>
@@ -386,7 +392,7 @@ async def example():
<tr>
<td align="center">author_archive</td>
<td align="center">bool</td>
<td align="center">是否将每个作者的作品储存至单独的文件夹;文件夹名称为 <code>作者ID_作者昵称</code></td>
<td align="center"><sup><a href="#author_archive">#</a></sup>是否将每个作者的作品储存至单独的文件夹;文件夹名称为 <code>作者ID_作者昵称</code></td>
<td align="center">false</td>
</tr>
<tr>
@@ -397,6 +403,12 @@ async def example():
</tr>
</tbody>
</table>
<hr>
<div id="author_archive">
<p>如果 <code>author_archive</code> 参数设置为 <code>true</code>,程序会把每个作者的作品储存至单独的文件夹;当作者的昵称发生变化时,程序会自动更新已下载作品文件名称中的作者昵称部分!</p>
<p>除此之外,你还可以通过设置 <code>mapping_data</code> 参数为某个作者设置别名;如果对某个作者设置了别名,程序会使用你设置的作者别名去替代作者昵称!</p>
</div>
<hr>
<p><b>其他说明:<code>user_agent</code>参数获取示例;强烈建议根据实际浏览器信息进行设置!</b></p>
<img src="static/screenshot/请求头示例图.png" alt="">
<h1>🌐 Cookie</h1>

View File

@@ -292,6 +292,12 @@ async def example():
</thead>
<tbody>
<tr>
<td align="center">mapping_data</td>
<td align="center">str: str</td>
<td align="center"><sup><a href="#author_archive">#</a></sup>Author alias mapping data, format: <code>author ID: author alias</code></td>
<td align="center">null</td>
</tr>
<tr>
<td align="center">work_path</td>
<td align="center">str</td>
<td align="center">Root path for saving works data/files</td>
@@ -390,7 +396,7 @@ async def example():
<tr>
<td align="center">author_archive</td>
<td align="center">bool</td>
<td align="center">Whether to save each author's works into a separate folder; The folder name is <code>authorID_nickname</code></td>
<td align="center"><sup><a href="#author_archive">#</a></sup>Whether to save each author's works into a separate folder; The folder name is <code>authorID_nickname</code></td>
<td align="center">false</td>
</tr>
<tr>
@@ -401,6 +407,7 @@ async def example():
</tr>
</tbody>
</table>
<hr>
<div id="fields">
<p>name_format instructions (Currently only supports Chinese values) :</p>
<ul>
@@ -419,6 +426,12 @@ async def example():
<li><code>作者ID</code>: Author ID</li>
</ul>
</div>
<hr>
<div id="author_archive">
<p>When <code>author_archive</code> is set to <code>true</code>, the program will store each author's works in dedicated folders. If an author's nickname changes, the program automatically updates the nickname portion in existing downloaded filenames!</p>
<p>Additionally, you can configure author aliases through the <code>mapping_data</code> parameter. When an alias is set, the program will use your custom alias instead of the original nickname in filenames!</p>
</div>
<hr>
<p><b>Additional Notes: The parameters <code>user_agent</code> examples are provided for reference; Strongly recommend setting according to actual browser information!</b></p>
<img src="static/screenshot/请求头示例图.png" alt="">
<h1>🌐 Cookie</h1>

View File

@@ -39,10 +39,7 @@ class Mapping:
a,
log,
)
await self.database.add(
id_,
alias,
)
await self.database.add(id_, alias)
async def has_mapping(self, id_: str) -> str:
return d[0] if (d := await self.database.select(id_)) else ""

View File

@@ -33,6 +33,7 @@ class IDRecorder:
async def add(
self,
id_: str,
name: str,
*args,
**kwargs,
) -> None:
@@ -151,11 +152,7 @@ class MapRecorder(IDRecorder):
)
return await self.cursor.fetchone()
async def add(
self,
id_: str,
name: str,
) -> None:
async def add(self, id_: str, name: str, *args, **kwargs) -> None:
if self.switch:
await self.database.execute(
"REPLACE INTO mapping_data VALUES (?, ?);",