instagram: new extraction method

new extraction method first tries to fetch content directly from instagram graphql API, fallback to html embed page. in case every method fail, rely on 3rd party
This commit is contained in:
stefanodvx 2025-04-23 18:52:05 +02:00
parent 1b3c426808
commit 93e964a28b
10 changed files with 494 additions and 110 deletions

View file

@ -2,7 +2,6 @@ package util
import (
"bytes"
"encoding/json"
"fmt"
"govd/config"
"govd/models"
@ -14,6 +13,8 @@ import (
"strings"
"sync"
"time"
"github.com/bytedance/sonic"
)
var (
@ -235,7 +236,7 @@ func parseProxyResponse(proxyResp *http.Response, originalReq *http.Request) (*h
}
var response models.ProxyResponse
if err := json.Unmarshal(body, &response); err != nil {
if err := sonic.ConfigFastest.Unmarshal(body, &response); err != nil {
return nil, fmt.Errorf("error parsing proxy response: %w", err)
}