Fixed Explore, Added Docker Support ( closes Hyperpipe/Hyperpipe#2 )

This commit is contained in:
Shiny Nematoda
2022-08-02 07:10:13 +00:00
parent 6a5f1d4b7a
commit 7e24fb8176
7 changed files with 54 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
.git
.gitignore
.dockerignore
*.md
*.txt
+18
View File
@@ -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
+11 -1
View File
@@ -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
+13
View File
@@ -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
+1 -1
View File
@@ -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()
}
+3 -1
View File
@@ -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
View File
@@ -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 {