Skip to content

Commit

Permalink
📝更新文档
Browse files Browse the repository at this point in the history
  • Loading branch information
luren-dc committed Oct 12, 2023
1 parent bacf1bd commit 9b5487e
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 78 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@ jobs:
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material pygments mkdocstrings
- run: mkdocs gh-deploy --force
- uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.6.1
- run: poetry install --only docs
- run: poetry run mkdocs gh-deploy --force
30 changes: 0 additions & 30 deletions docs/api.md

This file was deleted.

25 changes: 24 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,27 @@ theme:
toggle:
icon: material/brightness-4
name: Switch to system preference
icon:
repo: fontawesome/brands/github
features:
- search.suggest
- search.highlight
- content.tabs.link
- navigation.indexes
- content.tooltips
- navigation.top
- navigation.path
- navigation.instant
- navigation.instant.prefetch
- navigation.instant.progress
- navigation.tracking
- content.code.annotate
- content.code.copy
- content.code.select

repo_name: luren-dc/QQMusicApi
repo_url: https://github.com/luren-dc/QQMusicApi

markdown_extensions:
# Python Markdown
- abbr
Expand Down Expand Up @@ -69,4 +79,17 @@ markdown_extensions:

plugins:
- search
- mkdocstrings
- mkdocstrings:
handlers:
python:
setup_commands:
- import sys
- sys.path.insert(0, ".")
import:
# latest instead of stable
- https://installer.readthedocs.io/en/latest/objects.inv
- https://docs.python.org/3/objects.inv
- autorefs
- git-revision-date-localized:
enable_creation_date: true
- git-authors
105 changes: 104 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ aiohttp = "^3.8.5"
[tool.poetry.group.docs.dependencies]
mkdocs-material = "^9.4.4"
mkdocs = "^1.5.3"
mkdocstrings = "^0.23.0"
mkdocstrings = {extras = ["python"], version = "^0.23.0"}
pygments = "^2.16.1"
mkdocs-autorefs = "^0.5.0"
mkdocs-git-authors-plugin = "^0.7.2"
mkdocs-git-revision-date-localized-plugin = "^1.2.0"

[tool.poetry.group.dev.dependencies]
pytest = "^7.4.0"
Expand Down
33 changes: 0 additions & 33 deletions qqmusicapi/api/README.md

This file was deleted.

4 changes: 2 additions & 2 deletions qqmusicapi/api/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ async def authorize(self, code: Optional[int] = None) -> bool:
验证。
Args:
code: 验证码
code: 验证码。仅在使用手机号登录时传递。
Returns:
bool: 是否登录成功
Expand Down Expand Up @@ -425,7 +425,7 @@ def request(login_type: int = 0, phone: Optional[int] = None) -> Login:
创建登录对象。
Args:
login_type : 登录类型。0 表示 QQ 登录,1 表示微信登录,2 表示手机号登录。默认为 0
login_type : 登录类型。0=QQ 登录,1=微信登录,2=手机号登录
phone: 手机号(可选)。
Returns:
Expand Down
10 changes: 3 additions & 7 deletions qqmusicapi/api/song.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,12 @@


class SongApi:
"""歌曲Api"""
"""歌曲API"""

parent: ClassVar[QQMusic]

"""
文件类型与其对应的前缀和后缀
试听 需要拼接歌曲信息中的vs
"audition": {
"s": "RS02",
"e": ".mp3",
}
文件类
"""
FILE_TYPE = {
"AI00": ".flac",
Expand All @@ -42,6 +37,7 @@ class SongApi:
"O400": ".ogg",
"C200": ".m4a",
"C100": ".m4a",
"RS02": ".mp3",
}

@staticmethod
Expand Down
3 changes: 2 additions & 1 deletion tests/test_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ async def login(type: int):
elif state == 0:
break
await asyncio.sleep(1)
return await login.authorize()
await login.authorize()
print(login.token)


@pytest.mark.asyncio
Expand Down

0 comments on commit 9b5487e

Please sign in to comment.