mirror of
https://git.sr.ht/~joren/streamrip-go
synced 2026-06-17 15:05:39 +02:00
performance: tune shared HTTP transport for concurrent CDN downloads
This commit is contained in:
@@ -86,7 +86,7 @@ func fetchLastFMPlaylist(ctx context.Context, verifySSL bool, playlistURL string
|
||||
if !isValidLastFMPlaylistURL(playlistURL) {
|
||||
return "", nil, fmt.Errorf("invalid playlist url")
|
||||
}
|
||||
client := netutil.NewHTTPClient(30*time.Second, verifySSL)
|
||||
client := netutil.NewHTTPClient(30*time.Second, verifySSL, 0)
|
||||
|
||||
page1, err := fetchLastFMPlaylistPage(ctx, client, parsed, 1)
|
||||
if err != nil {
|
||||
@@ -123,7 +123,7 @@ func fetchLastFMPlaylist(ctx context.Context, verifySSL bool, playlistURL string
|
||||
}
|
||||
|
||||
func fetchLastFMPlaylistViaMirror(ctx context.Context, verifySSL bool, playlistURL string) (string, []lastFMTrack, error) {
|
||||
client := netutil.NewHTTPClient(30*time.Second, verifySSL)
|
||||
client := netutil.NewHTTPClient(30*time.Second, verifySSL, 0)
|
||||
all := make([]lastFMTrack, 0, 200)
|
||||
title := ""
|
||||
|
||||
@@ -376,7 +376,7 @@ func fetchSoundcloudOEmbed(ctx context.Context, verifySSL bool, trackURL string)
|
||||
q.Set("url", trackURL)
|
||||
endpoint := "https://soundcloud.com/oembed?" + q.Encode()
|
||||
|
||||
client := netutil.NewHTTPClient(20*time.Second, verifySSL)
|
||||
client := netutil.NewHTTPClient(20*time.Second, verifySSL, 0)
|
||||
req, err := http.NewRequestWithContext(ctx, http.MethodGet, endpoint, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user