Compare commits
2 commits
ef658e4641
...
702519ddc7
Author | SHA1 | Date | |
---|---|---|---|
702519ddc7 | |||
ac0a1827c1 |
2 changed files with 7 additions and 0 deletions
5
main.go
5
main.go
|
@ -8,6 +8,7 @@ import (
|
|||
"os"
|
||||
"strings"
|
||||
"unicode/utf16"
|
||||
"errors"
|
||||
|
||||
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
|
||||
"nulo.in/dlbot/common"
|
||||
|
@ -30,6 +31,9 @@ func (fu FileURL) UploadData() (string, io.Reader, error) {
|
|||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
if res.StatusCode != http.StatusOK {
|
||||
return "", nil, errors.New(res.Status)
|
||||
}
|
||||
return "url.mp4", res.Body, nil
|
||||
}
|
||||
|
||||
|
@ -90,6 +94,7 @@ func (config Config) handleMessage(bot *tgbotapi.BotAPI, update tgbotapi.Update)
|
|||
_, err := bot.Send(res)
|
||||
if err != nil {
|
||||
log.Println("Error subiendo", url.String(), err)
|
||||
bot.Send(respondWithMany(update.Message, "Hubo un error al descargar ", url.String(), "."))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@ import (
|
|||
"net/url"
|
||||
)
|
||||
|
||||
// alternativa: https://github.com/Evil0ctal/Douyin_TikTok_Download_API
|
||||
|
||||
type lookupResponse struct {
|
||||
AuthorAvatar string `json:"author_avatar"`
|
||||
AuthorID string `json:"author_id"`
|
||||
|
|
Reference in a new issue