-
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
Add Access Token parameter #13
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 Bangumi access token authentication by introducing a new optional parameter across multiple files. The token is used to authenticate API requests by adding a Bearer token to the request headers. 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 with bangumi_url and bangumi_access_token
Sub->>Bangumi: Call bangumi with url and 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])
}
note for Bangumi "Added token parameter to support access token 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 data fetching function to support authenticated requests, and update the CLI to accept this token as an argument.
New Features:
Enhancements: