当前位置: 欣欣网 > 码农

13.5K Star,高速下载工具

2024-04-29码农

Hi,骚年,我是大 G,公众号「 GitHub 指北 」会推荐 GitHub 上有趣有用的项目,一分钟 get 一个优秀的开源项目,挖掘开源的价值,欢迎关注。

导语

今天推荐一个支持所有平台的现代下载管理器,是一款由 Golang+Flutter 开发的高速下载器,支持(HTTP、BitTorrent、Magnet)协议下载,并且支持全平台使用。除了基本的下载功能外,Gopeed 还是一款高度可定制化的下载器,支持通过对接 APIs 或者安装和开发扩展来实现更多的功能。

效果预览

开发

本项目分为前端和后端两个部分,前端使用 flutter ,后端使用 Golang ,两边通过 http 协议进行通讯,在 unix 系统下,使用的是 unix socket ,在 windows 系统下,使用的是 tcp 协议。

前端代码位于 ui/flutter 目录下。

环境要求

  1. Golang 1.21+

  2. Flutter 3.16+

克隆项目

git clone [email protected]:GopeedLab/gopeed.git

编译

桌面端

首先需要按照 flutter desktop 官网文档 进行环境配置,然后需要准备好 cgo 环境,具体可以自行搜索。

构建命令:

  • windows

  • go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/windows/libgopeed.dll github.com/GopeedLab/gopeed/bind/desktop
    cd ui/flutter
    flutter build windows

  • macos

  • go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/macos/Frameworks/libgopeed.dylib github.com/GopeedLab/gopeed/bind/desktop
    cd ui/flutter
    flutter build macos

  • linux

  • go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/linux/bundle/lib/libgopeed.so github.com/GopeedLab/gopeed/bind/desktop
    cd ui/flutter
    flutter build linux

    移动端

    同样的也是需要准备好 cgo 环境,接着安装 gomobile

    go install golang.org/x/mobile/cmd/gomobile@latest
    go get golang.org/x/mobile/bind
    gomobile init

    构建命令:

  • android

  • gomobile bind -tags nosqlite -ldflags="-w -s" -o ui/flutter/android/app/libs/libgopeed.aar -target=android -androidapi 19 -javapkg="com.gopeed" github.com/GopeedLab/gopeed/bind/mobile
    cd ui/flutter
    flutter build apk

  • ios

  • gomobile bind -tags nosqlite -ldflags="-w -s" -o ui/flutter/ios/Frameworks/Libgopeed.xcframework -target=ios github.com/GopeedLab/gopeed/bind/mobile
    cd ui/flutter
    flutter build ios --no-codesign

    Web 端

    构建命令:

    cd ui/flutter
    flutter build web
    cd ../../
    rm -rf cmd/web/dist
    cp -r ui/flutter/build/web cmd/web/dist
    go build -tags nosqlite,web -ldflags="-s -w" -o bin/ github.com/GopeedLab/gopeed/cmd/web

    源码地址

    1. 点击下方的公众号;

    2. 在后台发消息「 下载 」即可获取。

    结语

    一个高速下载工具,它支持所有平台。无论你是在 Windows、Mac 还是 Linux 上使用,Gopeed 都能为你提供快速、稳定的下载体验。它具有强大的下载加速功能,可以帮助用户以更高的速度下载文件,节省时间和带宽资源。