Skip to content

Commit

Permalink
Merge pull request #49 from Johnserf-Seed/main
Browse files Browse the repository at this point in the history
main -> v0.0.1.5-pw2 24/Feb/21- 24/Feb/27
  • Loading branch information
Johnserf-Seed committed Feb 27, 2024
2 parents 7ec9bce + 6bf5df3 commit 9ff2f61
Show file tree
Hide file tree
Showing 12 changed files with 376 additions and 138 deletions.
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/ask-question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Ask question
about: 和项目有关的提问
title: "[QUESTION]"
labels: 提问(question)
assignees: ''

---

- [ ] ~~*在提问时请注意不要包含个人敏感信息*~~
- [ ] 我明白我的提问可能不会得到明确回复或解决。

**问题描述**
简要描述你想要获取支持或询问的内容。

**其他细节**
提供任何相关的细节或背景信息,例如你要询问的函数或与项目相关的具体内容。

**截图/代码示例**
如果有必要,可以提供截图或代码示例以更好地说明问题或询问的内容。

**期望的支持**
简要说明你期望从社区或项目维护者那里得到的支持或回答。

**其他**
如果有其他需要补充的内容,请在此处添加。
72 changes: 72 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
name: Bug report
about: 创建详细错误报告帮助解决你遇到的问题
title: "[BUG]"
labels: 故障(bug)
assignees: ''

---

- [ ] 我查看了 [文档](https://johnserf-seed.github.io/f2/quick-start.html) 以及 [已关闭的问题](https://github.com/Johnserf-Seed/f2/issues?q=is%3Aissue+is%3Aclosed) 以寻找可能的解决方案。
- [ ] 我在 [常见的问题与解决办法](https://johnserf-seed.github.io/f2/question-answer/qa.html) 中找不到我的问题。
- [ ] ~~*你的问题是公开的,请注意删除个人敏感内容再上传*~~
- [ ] 不按照模板填写的问题将不会得到优先的处理。

- 如果错误问题是可视化的,请在**屏幕截图**贴截图。如果你是开发者请在**错误重现**提供一个最小的代码示例来演示该问题。
- 相同的问题将会被标记`重复(duplicate)`,如果你的问题被标记为`已确认(confirmed)`则会在后续的推送中修复,请时刻留意。
- 退订邮件提醒请点击邮件的底部`unsubscribe`


**详细描述错误**
简明扼要地描述遇到的错误。

**系统平台**
<details>
<summary>单击展开</summary>
Q:你在哪个平台(Win/Linux/Mac)上运行?你使用的是什么浏览器?你使用的是什么终端软件?你使用的F2是什么版本?

A:

- 操作系统: [e.g. Win10 x64 22H2 19045.4046]
- 浏览器 [e.g. Edge 122.0.2365.52]
- 终端 [e.g. WT 1.18.10301.0]
- F2版本 [e.g. 0.0.1.4]

</details>

**错误重现**
<details>
<summary>单击展开</summary>
Q: 请你复制并粘贴出错时运行的命令和配置文件内容,以及重现该行为的步骤。如果你一次性就提供完整信息,就会节省很多解决问题的时间。

A:

1.
2.
3.

Q: 请添加调试命令`f2 -d DEBUG`重新运行出错的命令并提供日志目录下的日志文件。

A:

Q: 如果是开发者请提供最小的代码示例

A:

```python

```

</details>

**预期行为**
简明扼要地描述期望发生的事情。

**屏幕截图**
请添加截图以帮助解释你的问题。

**日志文件**
请添加调试日志文件以帮助解释你的问题。

**其他**
如有,可以添加有关问题的其他信息。
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Feature request
about: 为此项目提出建议
title: "[FEATRUE / REQUEST]"
labels: 需求建议(enhancement)
assignees: ''

---

在提出功能请求之前,请考虑在 https://github.com/Johnserf-Seed/f2/discussions 上发布反馈或在Discord中讨论。

**Q: 你有检查过类似建议的问题吗?**
在所有的问题列表里检查是否有类似的建议。
- [ ]
- [ ]

**Q: 你将如何改进 F2?**
请尽可能详细地说明。请提供你希望它如何工作的示例代码或流程。
A:

**Q: 它能为你解决什么问题?**
该功能能解决你的什么问题?我也许可以建议一种现有的解决方法。
A:

**其他**
如有,请添加有关功能请求的任何其他内容或截图。
2 changes: 1 addition & 1 deletion docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const require = createRequire(import.meta.url)

const pkg = require('vitepress/package.json')

const version = "v0.0.1.3-pw.1"
const version = "v0.0.1.4-pw.1"

// https://vitepress.dev/reference/site-config
export default defineConfig({
Expand Down
106 changes: 106 additions & 0 deletions docs/cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# 命令行

`F2` 配置文件独立于 CLI 命令参数且`最低优先`

## CLI临时配置

CLI 参数命令优先级最高,所以在不修改配置文件的情况下就可以使用 CLI 参数更改为下载「抖音」用户`喜欢`的所有作品。因此也可以在 CLI 中临时下载A的直播,B的作品与C的喜欢。

::: code-group

```bash [用户A]
$ f2 -d dy -c C:\Users\JohnserfSeed\Desktop\A.yaml -M live -u https://live.douyin.com/xxxxxxxxx
```

```bash [用户B]
$ f2 -d dy -c C:\Users\JohnserfSeed\Desktop\B.yaml -M post
```

```bash [用户C]
$ f2 -d dy -c C:\Users\JohnserfSeed\Desktop\C.yaml -M like
```
:::

赶快试试吧!

::: tip 说明
之后的版本会简化操作。不需要再指定该用户的直播间就可以切换下载该用户直播的模式。
更多的 CLI 命令请查阅 [CLI 参考](/cli)
:::

::: warning 重要
- 命名方式也不受限制,你可以设置`dy-A.yaml``dy-B.yaml``tk-A.yaml``tk-B.ymal`用以区分不同app的用户配置。
- 配置的操作是通用的,举例用的是douyin的配置文件,tiktok与其他 F2 应用的配置文件的操作是一模一样的。
:::


## 拓展

如果不想设置很多配置文件,那就使用主配置。

下载「抖音」用户`发布`的所有作品,只需要在主配置文件中设置`mode: post`即可。

::: code-group

```sh [Windows]
$ f2 dy -c f2/conf/app.yaml
```

```sh [Linux]
$ f2 dy -c f2/conf/app.yaml
```

```sh [MacOS]
$ f2 dy -c f2/conf/app.yaml
```
:::

下载「抖音」用户`喜欢`的所有作品,CLI 中设置`mode: like`即可。

::: code-group

```sh [Windows]
$ f2 dy -M like -c f2/conf/app.yaml
```

```sh [Linux]
$ f2 dy -M like -c f2/conf/app.yaml
```

```sh [MacOS]
$ f2 dy -M like -c f2/conf/app.yaml
```
:::

下载「抖音」用户`单个`的作品:

::: code-group

```sh [Windows]
$ f2 dy -M one -u https://v.douyin.com/iRNBho6u/ -c conf/app.yaml
```

```sh [Linux]
$ f2 dy -M one -u https://v.douyin.com/iRNBho6u/ -c conf/app.yaml
```

```sh [MacOS]
$ f2 dy -M one -u https://v.douyin.com/iRNBho6u/ -c conf/app.yaml
```
:::

F2 会智能的识别出混乱文本中的链接,同时也支持长短链的输入。

::: details 支持的链接格式

<<< @/snippets/douyin/support-link.md
:::

::: tip 需要注意的是
在CLI模式下,带有其他信息的文本需要用英文引号将其完整包裹:

```sh [Windows]
$ f2 dy -M one -u '7.64 gOX:/ [email protected] 05/14 世界这本书 又多读了一页。冰岛????旅行记# 冰岛 https://v.douyin.com/iR2syBRn/ 复制此链接,打开Dou音搜索,直接观看视!
' -c conf/app.yaml
```
:::
9 changes: 2 additions & 7 deletions docs/guide/what-is-f2.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ f2 dy -c conf/app.yaml
```
也可以在代码中指定配置文件的路径,例如:

```python
import f2

f2.APP_CONFIG_FILE_PATH = "conf/app.yaml"
```
<<< @/snippets/set-debug.py#set-config-snippet{3}

## 设置调试日志级别

Expand All @@ -27,7 +23,6 @@ f2.APP_CONFIG_FILE_PATH = "conf/app.yaml"

![set-debug](/douyin/set-debug.png)


## 日志输出到控制台

<<< @/snippets/set-debug.py#log-2-console-snippet{5}
Expand All @@ -36,4 +31,4 @@ f2.APP_CONFIG_FILE_PATH = "conf/app.yaml"

::: tip 提示
如果你想要输出到控制台的日志更加详细,可以使用 `DEBUG` 级别。并且后续必须使用该logger对象来输出日志,否则日志将不会输出到控制台。
:::
:::
53 changes: 42 additions & 11 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,38 @@
- [Windows Terminal](https://aka.ms/terminal) 终端,通过命令行界面(CLI)访问。
- 支持[Python](https://en.wikipedia.org/wiki/python) 语法的文本编辑器。
- 推荐使用[VSCode](https://code.visualstudio.com/)[VSCode在线](https://vscode.dev)
- [Git](https://git-scm.com/) ,用于开发者从GitHub上克隆项目。

`F2` 可单独使用,也可安装到现有项目中。在这两种情况下,你都可以使用以下命令选择不同版本安装:
## 包管理器安装

`F2` 可单独使用,也可安装到现有项目中。在这两种情况下,你都可以使用以下命令选择不同版本安装:

::: code-group

```sh [Windows]
$ pip install f2 # 最新版本
$ pip install f2==x.x.x # 指定版本
$ pip install 'f2>=x.x.x' # 最小版本
$ pip install f2 # 最新版本
$ pip install f2==x.x.x.x # 指定版本
$ pip install -U f2 # 更新版本
$ pip uninstall f2 # 卸载版本
```

```sh [Linux]
$ pip3 install f2 # 最新版本
$ pip3 install f2==x.x.x # 指定版本
$ pip3 install 'f2>=x.x.x' # 最小版本
$ pip3 install f2 # 最新版本
$ pip3 install f2==x.x.x.x # 指定版本
$ pip3 install -U f2 # 更新版本
$ pip3 uninstall f2 # 卸载版本
```

```sh [MacOS]
$ pip3 install f2 # 最新版本
$ pip3 install f2==x.x.x # 指定版本
$ pip3 install 'f2>=x.x.x' # 最小版本
$ pip3 install f2 # 最新版本
$ pip3 install f2==x.x.x.x # 指定版本
$ pip3 install -U f2 # 更新版本
$ pip3 uninstall f2 # 卸载版本
```
:::

::: details 收到依赖或其他警告?
如果提示python或pip版本错误,请尝试更新到必备条件的版本
如果提示python或pip版本错误,请务必更新到必备条件的版本

如果你的网络环境缓慢,无法正常访问官方镜像。请使用可以正常访问的第三方镜像源。
::: code-group
Expand All @@ -49,6 +55,31 @@ $ pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple f2
```
:::

## 编译安装

如果你是开发者需要修改代码编译安装项目,可以使用以下命令:

::: code-group

```sh [Windows]
$ git clone https://github.com/Johnserf-Seed/f2.git
$ cd f2
$ pip install -e . #注意点前面有一个空格
```

```sh [Linux]
$ git clone https://github.com/Johnserf-Seed/f2.git
$ cd f2
$ pip3 install -e . #注意点前面有一个空格
```

```sh [MacOS]
$ git clone https://github.com/Johnserf-Seed/f2.git
$ cd f2
$ pip3 install -e . #注意点前面有一个空格
```
:::

::: tip 提示

`F2` 是一个异步库,开发者在调用方法前请仔细`阅读相关文档`
Expand Down
6 changes: 5 additions & 1 deletion docs/question-answer/qa.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@

## f2: command not found

<<< @/snippets/QA.md#f2-command-not-found
<<< @/snippets/QA.md#f2-command-not-found

## WARNING 没有找到符合条件的作品

<<< @/snippets/QA.md#no-matching-videos-found
2 changes: 1 addition & 1 deletion docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

## 启动和运行

`F2` 设计的初衷是方便用户与开发者一键采集多平台的`异步`库。支持 CLI 命令调用与接口调用。
`F2` 是一个灵活的`异步`下载库。`F2` 设计的初衷是方便用户与开发者一键采集多平台的`异步`库。支持 CLI 命令调用与接口调用。

![cli-start](/f2-help.png)

Expand Down
Loading

0 comments on commit 9ff2f61

Please sign in to comment.