1
0
mirror of https://github.com/mgerb/go-discord-bot synced 2026-01-10 09:02:49 +00:00

feat: add user admin page - various dependency updates

This commit is contained in:
mg
2022-02-16 23:27:13 -06:00
parent 3484a32284
commit 6b8db59e98
29 changed files with 17038 additions and 841 deletions

View File

@@ -4,12 +4,12 @@ import (
"errors"
"github.com/gin-gonic/gin"
"github.com/kkdai/youtube/v2"
"github.com/mgerb/go-discord-bot/server/bot"
"github.com/mgerb/go-discord-bot/server/db"
"github.com/mgerb/go-discord-bot/server/webserver/middleware"
"github.com/mgerb/go-discord-bot/server/webserver/model"
"github.com/mgerb/go-discord-bot/server/webserver/response"
"github.com/rylio/ytdl"
)
// AddVideoArchiveRoutes -
@@ -70,7 +70,9 @@ func postVideoArchiveHandler(c *gin.Context) {
return
}
info, err := ytdl.GetVideoInfo(params.URL)
client := youtube.Client{}
info, err := client.GetVideo(params.URL)
if err != nil {
response.InternalError(c, err)
@@ -85,7 +87,7 @@ func postVideoArchiveHandler(c *gin.Context) {
videoArchive := model.VideoArchive{
Author: info.Author,
DatePublished: info.DatePublished,
DatePublished: info.PublishDate,
Description: info.Description,
Duration: int(info.Duration.Seconds()),
Title: info.Title,