mirror of
https://github.com/zhaarey/AppleMusicDecrypt.git
synced 2025-10-23 15:11:06 +00:00
feat: use uvloop or winloop to speed up asyncio
This commit is contained in:
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
|||||||
poetry run python -m pip install nuitka
|
poetry run python -m pip install nuitka
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
poetry run python -m nuitka main.py --assume-yes-for-downloads --standalone --follow-imports --include-data-dir=assets=assets --include-data-files=config.example.toml=config.toml --include-data-files=agent.js=agent.js --include-module=mitmproxy_windows
|
poetry run python -m nuitka main.py --assume-yes-for-downloads --standalone --follow-imports --include-data-dir=assets=assets --include-data-files=config.example.toml=config.toml --include-data-files=agent.js=agent.js --include-module=mitmproxy_windows --include-module=winloop
|
||||||
- name: Rename
|
- name: Rename
|
||||||
run: |
|
run: |
|
||||||
ren main.dist AppleMusicDecrypt
|
ren main.dist AppleMusicDecrypt
|
||||||
|
|||||||
7
main.py
7
main.py
@@ -1,8 +1,15 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
|
import sys
|
||||||
|
|
||||||
from src.cmd import NewInteractiveShell
|
from src.cmd import NewInteractiveShell
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
if sys.platform in ('win32', 'cygwin', 'cli'):
|
||||||
|
import winloop
|
||||||
|
winloop.install()
|
||||||
|
else:
|
||||||
|
import uvloop
|
||||||
|
uvloop.install()
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
cmd = NewInteractiveShell(loop)
|
cmd = NewInteractiveShell(loop)
|
||||||
try:
|
try:
|
||||||
|
|||||||
1772
poetry.lock
generated
1772
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -22,6 +22,9 @@ tenacity = "^8.2.3"
|
|||||||
prompt-toolkit = "^3.0.43"
|
prompt-toolkit = "^3.0.43"
|
||||||
mitmproxy = "^10.3.0"
|
mitmproxy = "^10.3.0"
|
||||||
async-lru = "^2.0.4"
|
async-lru = "^2.0.4"
|
||||||
|
winloop = {version = "^0.1.3", platform = "win32"}
|
||||||
|
uvloop = [{version = "^0.19.0", platform = "linux"},
|
||||||
|
{version = "^0.19.0", platform = "darwin"}]
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core"]
|
requires = ["poetry-core"]
|
||||||
|
|||||||
Reference in New Issue
Block a user