fix(189pc,baidu_photo,thunder): single link limit multithreading

This commit is contained in:
foxxorcat
2022-09-13 18:44:07 +08:00
parent 2de0da87fa
commit a90ef201c7
3 changed files with 23 additions and 26 deletions

View File

@ -4,10 +4,7 @@ import (
"context"
"fmt"
"net/http"
"regexp"
"strconv"
"strings"
"time"
"github.com/alist-org/alist/v3/drivers/base"
"github.com/alist-org/alist/v3/internal/driver"
@ -255,14 +252,16 @@ func (xc *XunLeiCommon) Link(ctx context.Context, file model.Obj, args model.Lin
},
}
strs := regexp.MustCompile(`e=([0-9]*)`).FindStringSubmatch(lFile.WebContentLink)
if len(strs) == 2 {
timestamp, err := strconv.ParseInt(strs[1], 10, 64)
if err == nil {
expired := time.Duration(timestamp-time.Now().Unix()) * time.Second
link.Expiration = &expired
/*
strs := regexp.MustCompile(`e=([0-9]*)`).FindStringSubmatch(lFile.WebContentLink)
if len(strs) == 2 {
timestamp, err := strconv.ParseInt(strs[1], 10, 64)
if err == nil {
expired := time.Duration(timestamp-time.Now().Unix()) * time.Second
link.Expiration = &expired
}
}
}
*/
return link, nil
}