diff --git a/extractors/extractors.go b/extractors/extractors.go index 2954d32ed..76937d83a 100644 --- a/extractors/extractors.go +++ b/extractors/extractors.go @@ -41,6 +41,8 @@ func Extract(u string, option Options) ([]*Data, error) { } if u.Host == "haokan.baidu.com" { domain = "haokan" + } else if u.Host == "xhslink.com" { + domain = "xiaohongshu" } else { domain = utils.Domain(u.Host) } diff --git a/extractors/xiaohongshu/xiaohongshu.go b/extractors/xiaohongshu/xiaohongshu.go index 0a255c909..103b79be0 100644 --- a/extractors/xiaohongshu/xiaohongshu.go +++ b/extractors/xiaohongshu/xiaohongshu.go @@ -2,6 +2,7 @@ package xiaohongshu import ( "encoding/json" + neturl "net/url" "strconv" "strings" @@ -34,7 +35,7 @@ func (e *extractor) Extract(url string, option extractors.Options) ([]*extractor } // title - titles := utils.MatchOneOf(html, `,"title":"(.+?)",`) + titles := utils.MatchOneOf(html, `