mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 13:36:09 +05:00
update to torrent v1.42.0 dms 1.4.0 and add dsd support
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package dlna
|
package dlna
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
@@ -13,20 +12,23 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/anacrolix/dms/dlna/dms"
|
"github.com/anacrolix/dms/dlna/dms"
|
||||||
|
"github.com/anacrolix/log"
|
||||||
|
|
||||||
"server/log"
|
"server/settings"
|
||||||
"server/web/pages/template"
|
"server/web/pages/template"
|
||||||
)
|
)
|
||||||
|
|
||||||
var dmsServer *dms.Server
|
var dmsServer *dms.Server
|
||||||
|
|
||||||
func Start() {
|
func Start() {
|
||||||
|
logger := log.Default.WithNames("dms")
|
||||||
dmsServer = &dms.Server{
|
dmsServer = &dms.Server{
|
||||||
|
Logger: logger.WithNames("dms", "server"),
|
||||||
Interfaces: func() (ifs []net.Interface) {
|
Interfaces: func() (ifs []net.Interface) {
|
||||||
var err error
|
var err error
|
||||||
ifaces, err := net.Interfaces()
|
ifaces, err := net.Interfaces()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.TLogln(err)
|
log.Print(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
for _, i := range ifaces {
|
for _, i := range ifaces {
|
||||||
@@ -41,7 +43,7 @@ func Start() {
|
|||||||
HTTPConn: func() net.Listener {
|
HTTPConn: func() net.Listener {
|
||||||
port := 9080
|
port := 9080
|
||||||
for {
|
for {
|
||||||
log.TLogln("Check dlna port", port)
|
log.Printf("Check dlna port %d", port)
|
||||||
m, err := net.Listen("tcp", ":"+strconv.Itoa(port))
|
m, err := net.Listen("tcp", ":"+strconv.Itoa(port))
|
||||||
if m != nil {
|
if m != nil {
|
||||||
m.Close()
|
m.Close()
|
||||||
@@ -51,10 +53,10 @@ func Start() {
|
|||||||
}
|
}
|
||||||
port++
|
port++
|
||||||
}
|
}
|
||||||
log.TLogln("Set dlna port", port)
|
log.Printf("Set dlna port %d", port)
|
||||||
conn, err := net.Listen("tcp", ":"+strconv.Itoa(port))
|
conn, err := net.Listen("tcp", ":"+strconv.Itoa(port))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.TLogln(err)
|
log.Print(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
return conn
|
return conn
|
||||||
@@ -69,16 +71,17 @@ func Start() {
|
|||||||
Height: 48,
|
Height: 48,
|
||||||
Depth: 24,
|
Depth: 24,
|
||||||
Mimetype: "image/png",
|
Mimetype: "image/png",
|
||||||
ReadSeeker: bytes.NewReader(template.Dlnaicon48png),
|
Bytes: template.Dlnaicon48png,
|
||||||
},
|
},
|
||||||
dms.Icon{
|
dms.Icon{
|
||||||
Width: 120,
|
Width: 120,
|
||||||
Height: 120,
|
Height: 120,
|
||||||
Depth: 24,
|
Depth: 24,
|
||||||
Mimetype: "image/png",
|
Mimetype: "image/png",
|
||||||
ReadSeeker: bytes.NewReader(template.Dlnaicon120png),
|
Bytes: template.Dlnaicon120png,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
LogHeaders: settings.BTsets.EnableDebug,
|
||||||
NotifyInterval: 30 * time.Second,
|
NotifyInterval: 30 * time.Second,
|
||||||
AllowedIpNets: func() []*net.IPNet {
|
AllowedIpNets: func() []*net.IPNet {
|
||||||
var nets []*net.IPNet
|
var nets []*net.IPNet
|
||||||
@@ -93,12 +96,12 @@ func Start() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := dmsServer.Init(); err != nil {
|
if err := dmsServer.Init(); err != nil {
|
||||||
log.TLogln("error initing dms server: %v", err)
|
log.Printf("error initing dms server: %v", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
go func() {
|
go func() {
|
||||||
if err := dmsServer.Run(); err != nil {
|
if err := dmsServer.Run(); err != nil {
|
||||||
log.TLogln(err)
|
log.Print(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
@@ -140,13 +143,13 @@ func getDefaultFriendlyName() string {
|
|||||||
userName := ""
|
userName := ""
|
||||||
user, err := user.Current()
|
user, err := user.Current()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.TLogln("getDefaultFriendlyName could not get username: %s", err)
|
log.Printf("getDefaultFriendlyName could not get username: %s", err)
|
||||||
} else {
|
} else {
|
||||||
userName = user.Name
|
userName = user.Name
|
||||||
}
|
}
|
||||||
host, err := os.Hostname()
|
host, err := os.Hostname()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.TLogln("getDefaultFriendlyName could not get hostname: %s", err)
|
log.Printf("getDefaultFriendlyName could not get hostname: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if userName == "" && host == "" {
|
if userName == "" && host == "" {
|
||||||
|
|||||||
@@ -1,35 +1,40 @@
|
|||||||
module server
|
module server
|
||||||
|
|
||||||
go 1.17
|
go 1.18
|
||||||
|
|
||||||
replace github.com/anacrolix/dms v1.3.0 => github.com/tsynik/dms v1.3.1
|
replace (
|
||||||
|
github.com/anacrolix/dms v1.4.0 => github.com/tsynik/dms v1.4.1
|
||||||
|
github.com/tidwall/btree v1.2.2 => github.com/tidwall/btree v0.7.2-0.20211211132910-4215444137fc
|
||||||
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/alexflint/go-arg v1.4.2
|
github.com/alexflint/go-arg v1.4.2
|
||||||
github.com/anacrolix/dms v1.3.0
|
github.com/anacrolix/dms v1.4.0
|
||||||
|
github.com/anacrolix/log v0.13.1
|
||||||
github.com/anacrolix/missinggo v1.3.0
|
github.com/anacrolix/missinggo v1.3.0
|
||||||
github.com/anacrolix/torrent v1.41.0
|
github.com/anacrolix/torrent v1.42.0
|
||||||
github.com/gin-contrib/cors v1.3.1
|
github.com/gin-contrib/cors v1.3.1
|
||||||
github.com/gin-contrib/location v0.0.2
|
github.com/gin-contrib/location v0.0.2
|
||||||
github.com/gin-gonic/gin v1.7.7
|
github.com/gin-gonic/gin v1.7.7
|
||||||
github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4
|
github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4
|
||||||
github.com/pkg/errors v0.9.1
|
github.com/pkg/errors v0.9.1
|
||||||
go.etcd.io/bbolt v1.3.6
|
go.etcd.io/bbolt v1.3.6
|
||||||
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11
|
golang.org/x/time v0.0.0-20220411224347-583f2d630306
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
crawshaw.io/sqlite v0.3.3-0.20210127221821-98b1f83c5508 // indirect
|
||||||
github.com/RoaringBitmap/roaring v0.9.4 // indirect
|
github.com/RoaringBitmap/roaring v0.9.4 // indirect
|
||||||
|
github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0 // indirect
|
||||||
github.com/alexflint/go-scalar v1.1.0 // indirect
|
github.com/alexflint/go-scalar v1.1.0 // indirect
|
||||||
github.com/anacrolix/chansync v0.3.0 // indirect
|
github.com/anacrolix/chansync v0.3.0 // indirect
|
||||||
github.com/anacrolix/confluence v1.11.0 // indirect
|
github.com/anacrolix/dht/v2 v2.17.0 // indirect
|
||||||
github.com/anacrolix/dht/v2 v2.15.2-0.20220123034220-0538803801cb // indirect
|
github.com/anacrolix/envpprof v1.2.1 // indirect
|
||||||
github.com/anacrolix/envpprof v1.1.1 // indirect
|
|
||||||
github.com/anacrolix/ffprobe v1.0.0 // indirect
|
github.com/anacrolix/ffprobe v1.0.0 // indirect
|
||||||
|
github.com/anacrolix/generics v0.0.0-20220217222028-44932cf46edd // indirect
|
||||||
github.com/anacrolix/go-libutp v1.2.0 // indirect
|
github.com/anacrolix/go-libutp v1.2.0 // indirect
|
||||||
github.com/anacrolix/log v0.10.1-0.20220123034749-3920702c17f8 // indirect
|
|
||||||
github.com/anacrolix/missinggo/perf v1.0.0 // indirect
|
github.com/anacrolix/missinggo/perf v1.0.0 // indirect
|
||||||
github.com/anacrolix/missinggo/v2 v2.5.3 // indirect
|
github.com/anacrolix/missinggo/v2 v2.6.0 // indirect
|
||||||
github.com/anacrolix/mmsg v1.0.0 // indirect
|
github.com/anacrolix/mmsg v1.0.0 // indirect
|
||||||
github.com/anacrolix/multiless v0.3.0 // indirect
|
github.com/anacrolix/multiless v0.3.0 // indirect
|
||||||
github.com/anacrolix/stm v0.3.0 // indirect
|
github.com/anacrolix/stm v0.3.0 // indirect
|
||||||
@@ -37,7 +42,7 @@ require (
|
|||||||
github.com/anacrolix/upnp v0.1.3-0.20220123035249-922794e51c96 // indirect
|
github.com/anacrolix/upnp v0.1.3-0.20220123035249-922794e51c96 // indirect
|
||||||
github.com/anacrolix/utp v0.1.0 // indirect
|
github.com/anacrolix/utp v0.1.0 // indirect
|
||||||
github.com/benbjohnson/immutable v0.3.0 // indirect
|
github.com/benbjohnson/immutable v0.3.0 // indirect
|
||||||
github.com/bits-and-blooms/bitset v1.2.1 // indirect
|
github.com/bits-and-blooms/bitset v1.2.2 // indirect
|
||||||
github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 // indirect
|
github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 // indirect
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
github.com/dustin/go-humanize v1.0.0 // indirect
|
github.com/dustin/go-humanize v1.0.0 // indirect
|
||||||
@@ -45,11 +50,11 @@ require (
|
|||||||
github.com/gin-contrib/sse v0.1.0 // indirect
|
github.com/gin-contrib/sse v0.1.0 // indirect
|
||||||
github.com/go-playground/locales v0.14.0 // indirect
|
github.com/go-playground/locales v0.14.0 // indirect
|
||||||
github.com/go-playground/universal-translator v0.18.0 // indirect
|
github.com/go-playground/universal-translator v0.18.0 // indirect
|
||||||
github.com/go-playground/validator/v10 v10.10.0 // indirect
|
github.com/go-playground/validator/v10 v10.10.1 // indirect
|
||||||
github.com/golang/protobuf v1.5.2 // indirect
|
github.com/golang/protobuf v1.5.2 // indirect
|
||||||
github.com/google/btree v1.0.1 // indirect
|
github.com/google/btree v1.0.1 // indirect
|
||||||
github.com/google/uuid v1.3.0 // indirect
|
github.com/google/uuid v1.3.0 // indirect
|
||||||
github.com/gorilla/websocket v1.4.2 // indirect
|
github.com/gorilla/websocket v1.5.0 // indirect
|
||||||
github.com/huandu/xstrings v1.3.2 // indirect
|
github.com/huandu/xstrings v1.3.2 // indirect
|
||||||
github.com/json-iterator/go v1.1.12 // indirect
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
github.com/leodido/go-urn v1.2.1 // indirect
|
github.com/leodido/go-urn v1.2.1 // indirect
|
||||||
@@ -58,36 +63,31 @@ require (
|
|||||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||||
github.com/mschoch/smat v0.2.0 // indirect
|
github.com/mschoch/smat v0.2.0 // indirect
|
||||||
github.com/pion/datachannel v1.5.2 // indirect
|
github.com/pion/datachannel v1.5.2 // indirect
|
||||||
github.com/pion/dtls/v2 v2.1.2 // indirect
|
github.com/pion/dtls/v2 v2.1.3 // indirect
|
||||||
github.com/pion/ice/v2 v2.1.20 // indirect
|
github.com/pion/ice/v2 v2.2.3 // indirect
|
||||||
github.com/pion/interceptor v0.1.7 // indirect
|
github.com/pion/interceptor v0.1.10 // indirect
|
||||||
github.com/pion/logging v0.2.2 // indirect
|
github.com/pion/logging v0.2.2 // indirect
|
||||||
github.com/pion/mdns v0.0.5 // indirect
|
github.com/pion/mdns v0.0.5 // indirect
|
||||||
github.com/pion/randutil v0.1.0 // indirect
|
github.com/pion/randutil v0.1.0 // indirect
|
||||||
github.com/pion/rtcp v1.2.9 // indirect
|
github.com/pion/rtcp v1.2.9 // indirect
|
||||||
github.com/pion/rtp v1.7.4 // indirect
|
github.com/pion/rtp v1.7.13 // indirect
|
||||||
github.com/pion/sctp v1.8.2 // indirect
|
github.com/pion/sctp v1.8.2 // indirect
|
||||||
github.com/pion/sdp/v3 v3.0.4 // indirect
|
github.com/pion/sdp/v3 v3.0.4 // indirect
|
||||||
github.com/pion/srtp/v2 v2.0.5 // indirect
|
github.com/pion/srtp/v2 v2.0.5 // indirect
|
||||||
github.com/pion/stun v0.3.5 // indirect
|
github.com/pion/stun v0.3.5 // indirect
|
||||||
github.com/pion/transport v0.13.0 // indirect
|
github.com/pion/transport v0.13.0 // indirect
|
||||||
github.com/pion/turn/v2 v2.0.6 // indirect
|
github.com/pion/turn/v2 v2.0.8 // indirect
|
||||||
github.com/pion/udp v0.1.1 // indirect
|
github.com/pion/udp v0.1.1 // indirect
|
||||||
github.com/pion/webrtc/v3 v3.1.24-0.20220208053747-94262c1b2b38 // indirect
|
github.com/pion/webrtc/v3 v3.1.28 // indirect
|
||||||
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
|
|
||||||
github.com/rs/dnscache v0.0.0-20211102005908-e0241e321417 // indirect
|
github.com/rs/dnscache v0.0.0-20211102005908-e0241e321417 // indirect
|
||||||
github.com/ugorji/go/codec v1.2.6 // indirect
|
github.com/tidwall/btree v1.2.2 // indirect
|
||||||
golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838 // indirect
|
github.com/ugorji/go/codec v1.2.7 // indirect
|
||||||
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
|
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect
|
||||||
|
golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect
|
||||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
|
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
|
||||||
golang.org/x/sys v0.0.0-20220111092808-5a964db01320 // indirect
|
golang.org/x/sys v0.0.0-20220412071739-889880a91fd5 // indirect
|
||||||
golang.org/x/text v0.3.7 // indirect
|
golang.org/x/text v0.3.7 // indirect
|
||||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
|
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f // indirect
|
||||||
google.golang.org/protobuf v1.27.1 // indirect
|
google.golang.org/protobuf v1.28.0 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
modernc.org/libc v1.13.2 // indirect
|
|
||||||
modernc.org/mathutil v1.4.1 // indirect
|
|
||||||
modernc.org/memory v1.0.5 // indirect
|
|
||||||
modernc.org/sqlite v1.14.4 // indirect
|
|
||||||
zombiezen.com/go/sqlite v0.8.0 // indirect
|
|
||||||
)
|
)
|
||||||
|
|||||||
1084
server/go.sum
1084
server/go.sum
File diff suppressed because it is too large
Load Diff
@@ -50,7 +50,7 @@ func Init(path, webpath string) {
|
|||||||
//https://stackoverflow.com/a/36140590
|
//https://stackoverflow.com/a/36140590
|
||||||
//fmt.Print(time.Now().UTC().Format("2006-01-02T15:04:05.999Z") + " TLOG " + string(bytes))
|
//fmt.Print(time.Now().UTC().Format("2006-01-02T15:04:05.999Z") + " TLOG " + string(bytes))
|
||||||
log.SetFlags(log.Ldate | log.Ltime | log.LUTC | log.Lmsgprefix)
|
log.SetFlags(log.Ldate | log.Ltime | log.LUTC | log.Lmsgprefix)
|
||||||
log.SetPrefix("UTC0 TLOG ")
|
log.SetPrefix("UTC0 SRV ")
|
||||||
log.SetOutput(ff)
|
log.SetOutput(ff)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,11 +24,16 @@ func init() {
|
|||||||
{"image/png", ".png"},
|
{"image/png", ".png"},
|
||||||
{"image/tiff", ".tiff,.tif"},
|
{"image/tiff", ".tiff,.tif"},
|
||||||
{"audio/x-aac", ".aac"},
|
{"audio/x-aac", ".aac"},
|
||||||
|
{"audio/dsd", ".dsd,.dsf,.dff"},
|
||||||
{"audio/flac", ".flac"},
|
{"audio/flac", ".flac"},
|
||||||
{"audio/mpeg", ".mpga,.mpega,.mp2,.mp3,.m4a"},
|
{"audio/mpeg", ".mpga,.mpega,.mp2,.mp3,.m4a"},
|
||||||
{"audio/ogg", ".oga,.ogg,.opus,.spx"},
|
{"audio/ogg", ".oga,.ogg,.opus,.spx"},
|
||||||
{"audio/opus", ".opus"},
|
{"audio/opus", ".opus"},
|
||||||
{"audio/weba", ".weba"},
|
{"audio/weba", ".weba"},
|
||||||
|
{"audio/x-ape", ".ape"},
|
||||||
|
// {"audio/x-dsd", ".dsd"},
|
||||||
|
// {"audio/x-dff", ".dff"},
|
||||||
|
// {"audio/x-dsf", ".dsf"},
|
||||||
{"audio/x-wav", ".wav"},
|
{"audio/x-wav", ".wav"},
|
||||||
{"video/dv", ".dif,.dv"},
|
{"video/dv", ".dif,.dv"},
|
||||||
{"video/fli", ".fli"},
|
{"video/fli", ".fli"},
|
||||||
|
|||||||
Reference in New Issue
Block a user