Permalink
Browse files

Fixed Image regex, telegram scraper is waaaaay faster

  • Loading branch information...
Nhoya committed Jan 15, 2018
1 parent 3e7dfcf commit b8e845c815dc0dbdb80a22488cf92d2da9505704
Showing with 7 additions and 4 deletions.
  1. +3 −0 .gitignore
  2. +4 −4 telegram.go
View
@@ -15,3 +15,6 @@
# Binary
gOSINT
#Telegram dump
*.dump
View
@@ -53,8 +53,9 @@ func getTelegramGroupHistory(group string, grace int, dumpFlag bool) {
}
}
messageCounter++
time.Sleep(time.Millisecond * 500)
time.Sleep(time.Millisecond * 100)
}
fmt.Println("End of history, if you think there are more messages try to increase the grace perio (--grace [INT])")
}
func getTelegramMessage(body string) string {
@@ -68,7 +69,6 @@ func getTelegramMessage(body string) string {
}
messageBody = messageBody + getTelegramMedia(body)
return messageBody
}
func getTelegramMedia(body string) string {
@@ -77,10 +77,10 @@ func getTelegramMedia(body string) string {
}
func getTelegramPhoto(body string) string {
re := regexp.MustCompile(`image:url\('https:\/\/([\w+.\/-]+)'`)
re := regexp.MustCompile(`image:url\('(https:\/\/[\w+.\/-]+)'`)
match := re.FindStringSubmatch(body)
if len(match) == 2 {
return "Photo: " + match[1]
return "Image: " + match[1]
}
return ""
}

0 comments on commit b8e845c

Please sign in to comment.