Skip to content

feat(thunderx,pikpak): add offline download support for ThunderX; add ctx to specific PikPak functions #8491

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Nekohy
Copy link

@Nekohy Nekohy commented May 6, 2025

Copy link

Walkthrough

This PR introduces offline download support for ThunderX and adds context (ctx) to specific PikPak functions. It involves significant changes to the ThunderX driver, including new functions for handling offline downloads, task management, and integration with existing systems.

Changes

Files Summary
drivers/pikpak/driver.go Added context (ctx) to various PikPak functions for better request handling.
drivers/thunderx/driver.go, drivers/thunderx/types.go, drivers/thunderx/util.go Implemented offline download support for ThunderX, including new functions and types for managing tasks and responses.
internal/conf/const.go Added new constant for ThunderX temporary directory.
internal/offline_download/all.go, internal/offline_download/thunderx/thunderx.go, internal/offline_download/thunderx/utils.go Integrated ThunderX into the offline download system with new utilities and initialization logic.
internal/offline_download/tool/add.go, internal/offline_download/tool/download.go Updated tool logic to support ThunderX.
server/handles/offline_download.go, server/router.go Added new API endpoints and handlers for ThunderX configuration and management.

}
filtersJSON, err := json.Marshal(filters)
if err != nil {
return nil, fmt.Errorf("failed to marshal filters: %w", err)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error handling here should ensure that filtersJSON is properly marshaled before being used in the params map. If the marshaling fails, it could lead to unexpected behavior or security vulnerabilities if the error isn't handled correctly.

@ykxVK8yL5L
Copy link

要不还是参考下我的实现思路吧:https://github.com/ykxVK8yL5L/alist
迅雷X演示视频:https://youtu.be/rnzDfC6omQs

@Nekohy
Copy link
Author

Nekohy commented May 26, 2025

要不还是参考下我的实现思路吧:https://github.com/ykxVK8yL5L/alist 迅雷X演示视频:https://youtu.be/rnzDfC6omQs

基于ThunderX的功能写完了啊(还缺什么吗

@ykxVK8yL5L
Copy link

要不还是参考下我的实现思路吧:https://github.com/ykxVK8yL5L/alist 迅雷X演示视频:https://youtu.be/rnzDfC6omQs

基于ThunderX的功能写完了啊(还缺什么吗

我的意思是换下思路 把离线功能的扩展交给driver去处理 这样如果需要扩展只需要driver去实现offline的接口即可
而不是现在这样 需要迅雷x离线了 加个迅雷x的下载工具 扩展性不好 仅供参考😂

@Nekohy
Copy link
Author

Nekohy commented May 26, 2025 via email

@ykxVK8yL5L
Copy link

我是跟随官方架构改的这样,不想大动主线

好的 我之前给官方提交过 感觉官方响应太慢 所以就自己搞了 能满足需要就好😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants