-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add bgm Access Token parameter #14
Conversation
更改内容以符合规范
格式化代码,现在应该不会有错误了吧🤔
Use httpx for asynchrony and coroutine pool instead of multithreading Add separate file test code
Trying to solve asyncio.run lifecycle issue
modified: tests/test_bangumi.py modified: tests/test_llm.py modified: tests/test_sub.py modified: yuisub/bangumi.py modified: yuisub/sub.py
modified: yuisub/sub.py
modified: yuisub/bangumi.py modified: yuisub/sub.py
Reviewer's Guide by SourceryThis PR adds support for an access token parameter in the Bangumi API integration. The implementation adds a new optional parameter for the access token across multiple files, which is then used to add Bearer token authentication to API requests when provided. Sequence diagram for Bangumi API request with Access TokensequenceDiagram
actor User
participant Main as __main__.py
participant Sub as sub.py
participant Bangumi as bangumi.py
User->>Main: Provide BANGUMI_URL and BANGUMI_ACCESS_TOKEN
Main->>Sub: Call translate(bangumi_url, bangumi_access_token)
Sub->>Bangumi: Call bangumi(url, token)
Bangumi->>Bangumi: Add Authorization header if token is provided
Bangumi->>Sub: Return bangumi info
Sub->>Main: Return translated subtitles
Main->>User: Display subtitles
Updated class diagram for Bangumi functionclassDiagram
class Bangumi {
+async bangumi(url: Optional[str], token: Optional[str]) BGM
}
note for Bangumi "Added token parameter for Bearer authentication"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @NULL204 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Add Access Token parameter
Summary by Sourcery
Add an optional 'Access Token' parameter to the 'bangumi' function and update the CLI to accept this token, enabling authenticated requests to the Anime Bangumi API.
New Features:
Enhancements: