main: changes, fixes

- refactors http session usage across modules
- adjusts video info extraction
- improves temporary directory, concurrency limits, buffering, and error handling in download routines
This commit is contained in:
stefanodvx 2025-04-14 23:45:54 +02:00
parent 10c113f400
commit 58bd5827b3
12 changed files with 171 additions and 51 deletions

View file

@ -17,7 +17,7 @@ const (
shortenerAPIFormat = "https://api.pinterest.com/url_shortener/%s/redirect/"
)
var HTTPSession = util.NewHTTPSession()
var httpSession = util.GetHTTPSession()
var ShortExtractor = &models.Extractor{
Name: "Pinterest (Short)",
@ -148,7 +148,7 @@ func GetPinData(pinID string) (*PinData, error) {
// fix 403 error
req.Header.Set("X-Pinterest-PWS-Handler", "www/[username].js")
resp, err := HTTPSession.Do(req)
resp, err := httpSession.Do(req)
if err != nil {
return nil, fmt.Errorf("failed to send request: %w", err)
}