Skip to content
This repository has been archived by the owner on Jan 12, 2025. It is now read-only.

Commit

Permalink
feat: use uvloop or winloop to speed up asyncio
Browse files Browse the repository at this point in the history
  • Loading branch information
WorldObservationLog committed May 22, 2024
1 parent cc65d47 commit d5c077a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1,773 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
poetry run python -m pip install nuitka
- name: Build
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
run: |
ren main.dist AppleMusicDecrypt
Expand Down
7 changes: 7 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import asyncio
import sys

from src.cmd import NewInteractiveShell

if __name__ == '__main__':
if sys.platform in ('win32', 'cygwin', 'cli'):
import winloop
winloop.install()
else:
import uvloop
uvloop.install()
loop = asyncio.get_event_loop()
cmd = NewInteractiveShell(loop)
try:
Expand Down
Loading

0 comments on commit d5c077a

Please sign in to comment.