2024-10-09 19:39:46 +03:00
2024-10-04 13:16:44 +03:00
2024-10-09 19:39:46 +03:00
2024-10-08 00:05:52 +03:00
2024-09-18 19:49:07 +03:00
2024-10-05 20:45:43 +03:00
2024-10-05 20:45:43 +03:00
2024-09-17 16:55:01 +03:00
2024-08-22 11:11:02 +03:00

soundcloak

wip alternative frontend for soundcloud

Instance list

Already implemented

  • Searching for songs, users, playlists
  • Basic user overview (songs, playlists, albums, metadata)
  • Basic song overview (author, metadata) & streaming (requires javascript (which requires support for Media Source Extensions) if no browser support for HLS)
  • Basic playlist/set/album overview (songs list, author, metadata)
  • Resolving shortened links (https://on.soundcloud.com/boiKDP46fayYDoVK9 -> https://sc.maid.zone/on/boiKDP46fayYDoVK9)

In the works

  • Track player embeds (https://w.soundcloud.com/player/ -> https://sc.maid.zone/w/player/)

The UI isn't really done yet. All parameters other than url are unsupported. You can also specify track without the soundcloud.com part: https://sc.maid.zone/w/player/?url=<id> or https://sc.maid.zone/w/player/?url=<user>/<track>

Contributing

Contributions are appreciated! This includes feedback, feature requests, issues, pull requests and etc. Feedback and feature requests are especially needed, since I (laptopcat) don't really know what to prioritize

You can contribute on:

You can also reach out to me privately

Setting it up

Prerequisites:

  1. node.js + npm (any recent enough version should do, it's just used for getting hls.js builds)
  2. golang (1.21 or higher was tested, others might work too)
  3. git

Setup:

  1. Clone this repository:
git clone https://github.com/maid-zone/soundcloak
  1. Go into the cloned repository:
cd soundcloak
  1. Download hls.js:
npm i
  1. Download templ:
go install github.com/a-h/templ/cmd/templ@latest

You might need to add go binaries to your PATH (add this line to your .bashrc / .zshrc / whatever)

export PATH=${PATH}:`go env GOPATH`/bin
  1. Generate code from templates:
templ generate
  1. Download other required go modules:
go get
  1. Optional. Edit config:

You can change some values in lib/cfg/init.go if you want. Keep in mind that you need to rebuild the binary each time you want to update the config.

  1. Build binary:
go build main.go
  1. Run the binary:
./main

This will run soundcloak on localhost, port 4664. (by default)

Maintenance-related stuffs

Updating

  1. Retrieve the latest code:
git fetch origin
git pull
  1. Remove compressed versions of files:

The webserver is configured to locally cache compressed versions of files. They have .fiber.gz extension and can be found in assets folder and node_modules/hls.js/dist. If any static files have been changed, you should purge these compressed files so the new versions can be served. Static files are also cached in user's browser, so you will need to clean your cache to get the new files (Ctrl + F5)

For example, you can clean these files from assets folder like so:

cd assets
rm *.fiber.gz
  1. Optional. Edit config:

Sometimes, new updates add new config values. You can change some values in lib/cfg/init.go if you want.

  1. Regenerate templates (if they changed):
templ generate
  1. Build binary:
go build main.go
  1. Run it:
./main

Congratulations! You have succesfully updated your soundcloak. (hopefully this guide works)

Built with

Backend

Frontend

  • HTML, CSS and JavaScript
  • hls.js
Description
Frontend for SoundCloud
Readme AGPL-3.0 964 KiB
Languages
Go 74.2%
templ 20.7%
JavaScript 2.5%
CSS 1.9%
Dockerfile 0.7%