Skip to content

Commit

Permalink
fix: correctly use URL query for telegram URL transform
Browse files Browse the repository at this point in the history
  • Loading branch information
NGTmeaty committed Aug 19, 2024
1 parent af035e1 commit 4c2c5ef
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions internal/pkg/crawl/sitespecific/telegram/telegram.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ func IsTelegramURL(url string) bool {

func TransformURL(URL *url.URL) {
// Add embed=1 to the URL, without changing the original URL
if len(URL.RawQuery) > 0 {
URL.RawQuery += "&embed=1&mode=tme"
} else {
URL.RawQuery = "embed=1&mode=tme"
}
q := URL.Query()
q.Add("embed", "1")
q.Add("mode", "tme")
URL.RawQuery = q.Encode()
}

0 comments on commit 4c2c5ef

Please sign in to comment.