revert aria2c usage
This commit is contained in:
parent
8fb1e2ead0
commit
01f6448e72
2 changed files with 2 additions and 12 deletions
|
@ -2,7 +2,6 @@ package ip_manager
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net"
|
"net"
|
||||||
"os"
|
|
||||||
"sort"
|
"sort"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
@ -46,8 +45,7 @@ func GetIPPool(stopGrp *stop.Group) (*IPPool, error) {
|
||||||
var pool []throttledIP
|
var pool []throttledIP
|
||||||
for _, address := range addrs {
|
for _, address := range addrs {
|
||||||
if ipnet, ok := address.(*net.IPNet); ok && ipnet.IP.IsGlobalUnicast() {
|
if ipnet, ok := address.(*net.IPNet); ok && ipnet.IP.IsGlobalUnicast() {
|
||||||
ipv6Disabled := os.Getenv("DISABLE_IPV6") != ""
|
if ipnet.IP.To16() != nil && govalidator.IsIPv6(ipnet.IP.String()) {
|
||||||
if ipnet.IP.To16() != nil && govalidator.IsIPv6(ipnet.IP.String()) && !ipv6Disabled {
|
|
||||||
pool = append(pool, throttledIP{
|
pool = append(pool, throttledIP{
|
||||||
IP: ipnet.IP.String(),
|
IP: ipnet.IP.String(),
|
||||||
LastUse: time.Now().Add(-5 * time.Minute),
|
LastUse: time.Now().Add(-5 * time.Minute),
|
||||||
|
|
|
@ -279,15 +279,7 @@ func (v *YoutubeVideo) download() error {
|
||||||
"--load-info-json",
|
"--load-info-json",
|
||||||
metadataPath,
|
metadataPath,
|
||||||
}
|
}
|
||||||
ipv6Disabled := os.Getenv("DISABLE_IPV6") != ""
|
|
||||||
if ipv6Disabled {
|
|
||||||
ytdlArgs = append(ytdlArgs,
|
|
||||||
"--external-downloader",
|
|
||||||
"aria2c",
|
|
||||||
"--external-downloader-args",
|
|
||||||
"aria2c:-j 16 -x 16 -s 16 -k 1M",
|
|
||||||
)
|
|
||||||
}
|
|
||||||
userAgent := []string{"--user-agent", downloader.ChromeUA}
|
userAgent := []string{"--user-agent", downloader.ChromeUA}
|
||||||
if v.maxVideoSize > 0 {
|
if v.maxVideoSize > 0 {
|
||||||
ytdlArgs = append(ytdlArgs,
|
ytdlArgs = append(ytdlArgs,
|
||||||
|
|
Loading…
Reference in a new issue