removed reddit download
This commit is contained in:
parent
591164c586
commit
467d12602e
1 changed files with 3 additions and 2 deletions
|
@ -39,7 +39,7 @@ func Download(update tgbotapi.Update, bot *tgbotapi.BotAPI) {
|
|||
log.Println("[download] Failed to download URL " + update.Message.CommandArguments() + " NO URL")
|
||||
message := tgbotapi.EditMessageTextConfig{
|
||||
BaseEdit: tgbotapi.BaseEdit{ChatID: workingMessage.Chat.ID, MessageID: workingMessage.MessageID},
|
||||
Text: "Please specify a valid YouTube or Reddit URL to download something\\nI can only download media that is hosted by YouTube or Reddit. Reddit posts that link to Imgur, for example, won't work\"",
|
||||
Text: "Please specify a valid YouTube URL to download something.",
|
||||
}
|
||||
botIO.EditMessage(message, bot)
|
||||
return
|
||||
|
@ -88,6 +88,7 @@ func Download(update tgbotapi.Update, bot *tgbotapi.BotAPI) {
|
|||
botIO.EditMessage(message, bot)
|
||||
|
||||
serveMedia(update, bot, downloadTarget, files[0].Name())
|
||||
log.Println("[download] Served URL " + update.Message.CommandArguments() + " for " + strconv.FormatInt(update.Message.From.ID, 10) + " in chat " + strconv.FormatInt(update.Message.Chat.ID, 10))
|
||||
|
||||
time.Sleep(10 * time.Second)
|
||||
|
||||
|
@ -146,7 +147,7 @@ func matchURL(URL string) (matchedURL string) {
|
|||
|
||||
}
|
||||
|
||||
var domainRegex = regexp.MustCompile(`(youtube\.com$)|(youtu\.be$)|(reddit\.com$)`)
|
||||
var domainRegex = regexp.MustCompile(`(youtube\.com$)|(youtu\.be$)`)
|
||||
|
||||
m := domainRegex.FindStringSubmatch(parsedURL.Hostname())
|
||||
|
||||
|
|
Loading…
Reference in a new issue