Permanent file hosting — files never expire. A Go library for uploading files to MeowBox.
Run this inside your Go project:
go get github.com/Badmunda05/MeowBoxGo@v1.0.2import "github.com/Badmunda05/MeowBoxGo"require github.com/Badmunda05/MeowBoxGo v1.0.2Note: The GitHub repository must be public and the module path must match.
package main
import (
"bytes"
"fmt"
"os"
"time"
"github.com/Badmunda05/meowbox"
)
func main() {
file, err := os.Open("photo.jpg")
if err != nil {
fmt.Println("Error opening file:", err)
return
}
defer file.Close()
var buf bytes.Buffer
buf.ReadFrom(file)
url, err := meowbox.UploadFile(&buf, "photo.jpg", 30*time.Second)
if err != nil {
fmt.Println("Upload failed:", err)
return
}
fmt.Println("Uploaded:", url)
// https://files.tgvibes.online/AbCdEfGh.jpg
}entries := []meowbox.FileEntry{
{Buffer: &buf1, FileName: "file1.jpg"},
{Buffer: &buf2, FileName: "file2.mp4"},
}
urls, err := meowbox.UploadFiles(entries, 30*time.Second)
if err != nil {
fmt.Println("Upload failed:", err)
return
}
for _, u := range urls {
fmt.Println(u)
}git clone https://github.com/Badmunda05/meowbox
cd meowbox/example
go run main.go photo.jpg
# Multiple files:
go run main.go file1.jpg file2.mp4Users can then install it with:
go get github.com/Badmunda05/meowbox@v1.0.0
# or always get the latest:
go get github.com/Badmunda05/meowbox| Function | Description |
|---|---|
UploadFile(buf, fileName, timeout) |
Uploads a single file, returns the direct URL |
UploadFiles([]FileEntry, timeout) |
Uploads multiple files, returns a slice of URLs |
type FileEntry struct {
Buffer *bytes.Buffer
FileName string
}url, err := meowbox.UploadFile(&buf, "photo.jpg", 30*time.Second)
if err != nil {
// Possible errors:
// - "upload request timed out after N seconds"
// - "rate limit hit — too many requests, try again later"
// - "upload failed: <server message>"
// - "HTTP error occurred: ..."
fmt.Println("Upload failed:", err)
}- Python library: MeowBox (Python)
- Telegram: @BadmundaXd