Start interface
started implementing main func
This commit is contained in:
parent
3107df1045
commit
5028dc49b1
13
main.go
13
main.go
@ -1,8 +1,11 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
|
||||
"github.com/alexflint/go-arg"
|
||||
)
|
||||
@ -21,9 +24,17 @@ func main() {
|
||||
RELEASE string `arg:"-r,help:Release group preference order. Comma seperated."`
|
||||
SHOW []string `arg:"positional,help:TV show to download"`
|
||||
NEW bool `arg:"-n,help:Only modify new torrents"`
|
||||
PATH string `arg:"-P,help:Path to torrent files"`
|
||||
}
|
||||
arg.MustParse(&args)
|
||||
fmt.Println("Hello, World!!!")
|
||||
scnr := bufio.NewScanner(os.Stdin)
|
||||
for err == nil {
|
||||
if !scnr.scan() {
|
||||
panic("fail")
|
||||
}
|
||||
exec.Command("wget", scnr.Text(), "-o", args.PATH+'/')
|
||||
process(args.PATH + '/' + path.Base(scnr.Text()))
|
||||
}
|
||||
}
|
||||
|
||||
func process(torrentFile string) *TorrentVideo {
|
||||
|
8
type.go
8
type.go
@ -65,6 +65,13 @@ type TorrentEpisode struct {
|
||||
Season string
|
||||
}
|
||||
|
||||
type Interface interface {
|
||||
ReleaseGroup() string
|
||||
Len() int
|
||||
Swap(i, j int)
|
||||
Less(i, j int) bool
|
||||
}
|
||||
|
||||
func NewTorrent(mt MetaTorrent) (T *Torrent) {
|
||||
T = new(Torrent)
|
||||
if mt.Info.Length == 0 {
|
||||
@ -140,7 +147,6 @@ func (T *TorrentVideo) Process() error {
|
||||
T.Release = match[1]
|
||||
T.Creator = match[2]
|
||||
}
|
||||
|
||||
} else {
|
||||
if re[0].MatchString(str) {
|
||||
tag = true
|
||||
|
Loading…
Reference in New Issue
Block a user