Compare commits
28 Commits
v1.0.2
...
b987f4775f
| Author | SHA1 | Date | |
|---|---|---|---|
| b987f4775f | |||
|
8ff5caaede
|
|||
| 163a2af84b | |||
|
88ced43981
|
|||
| f3cd0d0a89 | |||
|
9ae57862a0
|
|||
| 25eafe3959 | |||
| a250bb7c9b | |||
|
8768ea181c
|
|||
|
7e0fd89e11
|
|||
| 445e10fa16 | |||
|
0b621acdfb
|
|||
| bdfd612fa0 | |||
| de6e50179a | |||
|
38691be66b
|
|||
|
46bbecb280
|
|||
| 772993a596 | |||
|
f809b08c37
|
|||
| 4f3b30885e | |||
| 6c0316ac28 | |||
|
52cc00190b
|
|||
|
a7765f90d9
|
|||
| 7b4d25d484 | |||
|
b392048ca1
|
|||
| b0cb606afe | |||
|
f303eb3eb8
|
|||
| e641e1d2a5 | |||
|
a6dc4e27b9
|
@@ -83,7 +83,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
- name: Push changes
|
- name: Push changes
|
||||||
uses: ad-m/github-push-action@v1.0.0
|
uses: ad-m/github-push-action@v1.1.0
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.ACTIONS_TOKEN }}
|
github_token: ${{ secrets.ACTIONS_TOKEN }}
|
||||||
repository: infrastructure/core-apps
|
repository: infrastructure/core-apps
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
########################################
|
########################################
|
||||||
# Versions
|
# Versions
|
||||||
ARG YT_DLP_VERSION="2026.03.03"
|
ARG YT_DLP_VERSION="2026.03.17"
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Deno builder stage
|
# Deno builder stage
|
||||||
@@ -38,7 +38,7 @@ RUN case "$TARGETARCH" in \
|
|||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# FFmpeg builder stage
|
# FFmpeg builder stage
|
||||||
FROM debian:13-slim@sha256:1d3c811171a08a5adaa4a163fbafd96b61b87aa871bbc7aa15431ac275d3d430 AS ffmpeg-builder
|
FROM debian:13-slim@sha256:4ffb3a1511099754cddc70eb1b12e50ffdb67619aa0ab6c13fcd800a78ef7c7a AS ffmpeg-builder
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y --no-install-recommends ffmpeg
|
apt-get install -y --no-install-recommends ffmpeg
|
||||||
COPY --from=yt-dlp-builder /rootfs/bin/yt-dlp /yt-dlp
|
COPY --from=yt-dlp-builder /rootfs/bin/yt-dlp /yt-dlp
|
||||||
@@ -54,7 +54,7 @@ RUN mkdir -p /rootfs/bin && \
|
|||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# App builder stage
|
# App builder stage
|
||||||
FROM golang:1.26.1-trixie@sha256:ab8c4944b04c6f97c2b5bffce471b7f3d55f2228badc55eae6cce87596d5710b AS app-builder
|
FROM golang:1.26.2-trixie@sha256:da3943074756e8d6f109ce7a84be16e98bffa39e9d369a0447f016b56db84e8f AS app-builder
|
||||||
|
|
||||||
COPY app/ /opt/app
|
COPY app/ /opt/app
|
||||||
WORKDIR /opt/app
|
WORKDIR /opt/app
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ go 1.25.2
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/bwmarrin/discordgo v0.29.0
|
github.com/bwmarrin/discordgo v0.29.0
|
||||||
github.com/lrstanley/go-ytdlp v1.3.3
|
github.com/lrstanley/go-ytdlp v1.3.5
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0U
|
|||||||
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||||
github.com/lrstanley/go-ytdlp v1.3.3 h1:Y9kJcdTwskPWDiwONMIl501Dhi+OrTF7HHY6J6+Lbco=
|
github.com/lrstanley/go-ytdlp v1.3.3 h1:Y9kJcdTwskPWDiwONMIl501Dhi+OrTF7HHY6J6+Lbco=
|
||||||
github.com/lrstanley/go-ytdlp v1.3.3/go.mod h1:VgjnTrvkTf+23JuySjyPq1iQ8ijSovBtTPpXH5XrLtI=
|
github.com/lrstanley/go-ytdlp v1.3.3/go.mod h1:VgjnTrvkTf+23JuySjyPq1iQ8ijSovBtTPpXH5XrLtI=
|
||||||
|
github.com/lrstanley/go-ytdlp v1.3.4 h1:x3ppgdeN3FbguT5ifc6ISrgjYN10+dVUAbprA7/dYrk=
|
||||||
|
github.com/lrstanley/go-ytdlp v1.3.4/go.mod h1:VgjnTrvkTf+23JuySjyPq1iQ8ijSovBtTPpXH5XrLtI=
|
||||||
|
github.com/lrstanley/go-ytdlp v1.3.5 h1:eT+29mK3Lp+XPMQOH25+jVerrrjifYW1o3IkTYJ9SMs=
|
||||||
|
github.com/lrstanley/go-ytdlp v1.3.5/go.mod h1:VgjnTrvkTf+23JuySjyPq1iQ8ijSovBtTPpXH5XrLtI=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||||
|
|||||||
25
app/main.go
25
app/main.go
@@ -6,6 +6,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"sort"
|
"sort"
|
||||||
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/bwmarrin/discordgo"
|
"github.com/bwmarrin/discordgo"
|
||||||
@@ -365,8 +366,20 @@ func main() {
|
|||||||
h(s, i)
|
h(s, i)
|
||||||
}
|
}
|
||||||
case discordgo.InteractionMessageComponent:
|
case discordgo.InteractionMessageComponent:
|
||||||
if h, ok := componentHandlers[i.MessageComponentData().CustomID]; ok {
|
customID := i.MessageComponentData().CustomID
|
||||||
|
if h, ok := componentHandlers[customID]; ok {
|
||||||
h(s, i)
|
h(s, i)
|
||||||
|
} else if strings.HasPrefix(customID, "retry:") {
|
||||||
|
url := strings.TrimPrefix(customID, "retry:")
|
||||||
|
s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
|
||||||
|
Type: discordgo.InteractionResponseUpdateMessage,
|
||||||
|
Data: &discordgo.InteractionResponseData{
|
||||||
|
Content: fmt.Sprintf("%s Fetching available formats...", loading_emoji),
|
||||||
|
Components: []discordgo.MessageComponent{},
|
||||||
|
Flags: discordgo.MessageFlagsEphemeral,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
go fetchAndShowFormats(s, i, url)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -444,6 +457,16 @@ func fetchAndShowFormats(s *discordgo.Session, i *discordgo.InteractionCreate, u
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
_, err = s.InteractionResponseEdit(i.Interaction, &discordgo.WebhookEdit{
|
_, err = s.InteractionResponseEdit(i.Interaction, &discordgo.WebhookEdit{
|
||||||
Content: ptr("❌ Error fetching formats: " + err.Error()),
|
Content: ptr("❌ Error fetching formats: " + err.Error()),
|
||||||
|
Components: &[]discordgo.MessageComponent{
|
||||||
|
&discordgo.ActionsRow{
|
||||||
|
Components: []discordgo.MessageComponent{
|
||||||
|
discordgo.Button{
|
||||||
|
Label: "Retry",
|
||||||
|
CustomID: fmt.Sprintf("retry:%s", url),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Error updating interaction: %v", err)
|
log.Printf("Error updating interaction: %v", err)
|
||||||
|
|||||||
@@ -19,7 +19,9 @@ func GetFormats(url string) (*FormatOptions, error) {
|
|||||||
SkipDownload().
|
SkipDownload().
|
||||||
DumpJSON()
|
DumpJSON()
|
||||||
|
|
||||||
result, err := dl.Run(context.TODO(), url)
|
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
|
||||||
|
defer cancel()
|
||||||
|
result, err := dl.Run(ctx, url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user