instagram: No romperse si no es un reel

This commit is contained in:
Cat /dev/Nulo 2023-01-02 23:45:37 -03:00
parent 2e02b5a7a1
commit 6d33ce97df

View file

@ -3,6 +3,7 @@ package main
import (
"log"
"net/url"
"strings"
"nulo.in/dlbot/common"
@ -13,6 +14,9 @@ func respond(bot *tgbotapi.BotAPI, update tgbotapi.Update, url *url.URL) common.
if url.Hostname() != "instagram.com" && url.Hostname() != "www.instagram.com" {
return common.NotValid
}
if strings.Index(url.Path, "/reel/") != 0 {
return common.NotValid
}
log.Printf("Downloading %s", url.String())
lookup, err := Lookup(url.String())