A simple Discord bot that cleans the "si=" query parameter from YouTube links.
Find a file
Phillip d367547a69 Add unit tests for URL cleaning logic and improve parameter handling
- Introduced `main_test.go` with comprehensive test coverage.
- Refactor `main.go` to enhance query parameter filtering using a cleaner data structure.
- Update README with testing and usage instructions.
- Add IntelliJ IDEA project configuration files to `.gitignore`.
2026-03-13 22:12:16 -06:00
.idea Add unit tests for URL cleaning logic and improve parameter handling 2026-03-13 22:12:16 -06:00
.gitignore Add dist dir to .gitignore 2025-12-12 11:39:13 -07:00
go.mod Change module path to point at Codeberg repo. 2025-12-12 11:27:21 -07:00
go.sum Initial commit. 2025-12-12 11:22:18 -07:00
main.go Add unit tests for URL cleaning logic and improve parameter handling 2026-03-13 22:12:16 -06:00
main_test.go Add unit tests for URL cleaning logic and improve parameter handling 2026-03-13 22:12:16 -06:00
README.md Add unit tests for URL cleaning logic and improve parameter handling 2026-03-13 22:12:16 -06:00

This bot cleans tracking parameters from YouTube and Instagram links (e.g., si=*, igsh=*), while preserving other query parameters.

Project Layout

  • main.go: Main bot logic and URL cleaning implementation.
  • main_test.go: Unit tests for the URL cleaning logic.
  • go.mod, go.sum: Go module configuration.

Build & Run

  1. Build:
    go build
    
  2. Run:
    ./yt-cleaner -t YOUR_DISCORD_BOT_TOKEN
    
    Use ./yt-cleaner --help for flag details.

Testing

To run the test suite:

go test -v