Start interface

started implementing main func
This commit is contained in:
lordwelch 2017-07-16 23:48:06 -07:00
parent 3107df1045
commit 5028dc49b1
2 changed files with 19 additions and 2 deletions

13
main.go
View File

@ -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 {

View File

@ -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