mirror of
https://codeberg.org/Hyperpipe/hyperpipe-backend
synced 2024-12-06 19:26:30 +01:00
Fixed Explore, Added Docker Support ( closes Hyperpipe/Hyperpipe#2 )
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
.git
|
||||
.gitignore
|
||||
.dockerignore
|
||||
*.md
|
||||
*.txt
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
FROM golang:alpine AS build
|
||||
|
||||
ARG proxy
|
||||
|
||||
WORKDIR /app/
|
||||
|
||||
RUN apk --no-cache add ca-certificates
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN sed -i "s/hyperpipe-proxy.onrender.com/$proxy/g" utils.go
|
||||
|
||||
RUN go mod download && \
|
||||
go build -ldflags "-s -w"
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ./hyperpipe-backend
|
||||
@@ -2,7 +2,17 @@
|
||||
|
||||
Until NewPipeExtractor Supports Youtube Music Browse endpoints.
|
||||
|
||||
## Self-Hosting
|
||||
|
||||
### Docker
|
||||
|
||||
Configure using `docker-compose.yml` ( Set the Proxy URL )
|
||||
|
||||
Then run
|
||||
|
||||
`# docker-compose up -d`
|
||||
|
||||
|
||||
## Official Frontend
|
||||
|
||||
codeberg.org/Hyperpipe/hyperpipe
|
||||
https://codeberg.org/Hyperpipe/hyperpipe
|
||||
@@ -0,0 +1,13 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
hyperpipe-backend:
|
||||
image: hyperpipe-backend
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
proxy: "pipopiped.tokhmi.xyz"
|
||||
container_name: hyperpipe-backend
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- 3000:3000
|
||||
@@ -11,7 +11,7 @@ func SetHeaders(c *fiber.Ctx) error {
|
||||
c.Type("json", "utf-8")
|
||||
c.Set("Access-Control-Allow-Origin", "*")
|
||||
c.Set("Access-Control-Allow-Headers", "*")
|
||||
c.Set("Access-Control-Max-Age", "1728000")
|
||||
c.Set("Access-Control-Max-Age", "300")
|
||||
|
||||
return c.Next()
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ func ParseExplore(raw string) (string, error) {
|
||||
j := gjson.Parse(raw)
|
||||
|
||||
c := j.Get("contents.singleColumnBrowseResultsRenderer.tabs.0.tabRenderer.content" +
|
||||
".tabRenderer.content.sectionListRenderer.contents.#.musicCarouselShelfRenderer")
|
||||
".sectionListRenderer.contents.#.musicCarouselShelfRenderer")
|
||||
|
||||
a := c.Get("#(header.musicCarouselShelfBasicHeaderRenderer" +
|
||||
".title.runs.0.text == New albums & singles)")
|
||||
@@ -51,6 +51,8 @@ func ParseExplore(raw string) (string, error) {
|
||||
".title.runs.0.text == Trending)")
|
||||
|
||||
val := Explore{
|
||||
TrendingId: t.Get("header.musicCarouselShelfBasicHeaderRenderer" +
|
||||
".title.runs.0.navigationEndpoint.browseEndpoint.browseId").String(),
|
||||
Albums: TwoRowItemRenderer("album", a.Get("contents")),
|
||||
Trending: ResponsiveListItemRenderer(t.Get("contents")),
|
||||
}
|
||||
|
||||
+3
-2
@@ -23,8 +23,9 @@ type Items struct {
|
||||
}
|
||||
|
||||
type Explore struct {
|
||||
Albums []Item `json:"albums_and_singles"`
|
||||
Trending []Item `json:"trending"`
|
||||
TrendingId string `json:"trendingId"`
|
||||
Albums []Item `json:"albums_and_singles"`
|
||||
Trending []Item `json:"trending"`
|
||||
}
|
||||
|
||||
type Genres struct {
|
||||
|
||||
Reference in New Issue
Block a user