From 94fc08b2b12b6d48a6506ec3beafd6a60d77a78e Mon Sep 17 00:00:00 2001 From: Al Beano Date: Tue, 30 May 2017 18:31:31 +0100 Subject: [PATCH] windows bugfixes, more docs --- README.md | 17 ++++++++++++++--- platform/windows.go | 3 +-- wimp-get.go | 14 +++++++------- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index d38791b..9198fbd 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,21 @@ Tool to download FLACs from WiMP/Tidal. -## Build prerequisites - * go >= 1.8 +## Binaries -... more info soon™ ... +Windows binaries are available in the [releases](https://git.fuwafuwa.moe/albino/wimp-get/releases) tab. + +## Compiling + +You need Go >= 1.8, and suitable ffmpeg, sox and mktorrent binaries. Once you've got that, just run `go build -ldflags "-s -w"`, and a `wimp-get` binary should be generated. + +## Configuration + +If your copies of ffmpeg, sox or mktorrent are outwith your path, put their paths in magic.json. Extract the `sessionId` of your WiMP session using your browser's developer tools, and insert that into magic.json too. + +## Help! + +If it's not working, come and ask for help on IRC. Connect to `irc.rizon.net`, type `/join #wimp-get` and get my attention by saying my name (albino). ## License info diff --git a/platform/windows.go b/platform/windows.go index 2175818..3ba3fd4 100644 --- a/platform/windows.go +++ b/platform/windows.go @@ -1,5 +1,4 @@ // +build windows -// currently untested as I don't have a windows machine to test on package platform @@ -8,7 +7,7 @@ import( ) func SanitiseFilename(filename string) (newName string, e error) { - r, e := regexp.Compile("[\\?<>:\"/\\\\|\\*]") + r, e := regexp.Compile("[\\?<>:/\"\\\\|\\*]") if e != nil { return } diff --git a/wimp-get.go b/wimp-get.go index 3cfc47a..d344210 100644 --- a/wimp-get.go +++ b/wimp-get.go @@ -85,18 +85,18 @@ func main() { fmt.Printf("[%d/%s] %s...", track.Volume, num, track.Title) - var filename string - if (multidisc) { - filename = fmt.Sprintf("%s/Disc %d/%s - %s.flac", dirName, track.Volume, num, track.Title) - } else { - filename = fmt.Sprintf("%s/%s - %s.flac", dirName, num, track.Title) - } - + var filename = fmt.Sprintf("%s - %s.flac", num, track.Title) filename, e = platform.SanitiseFilename(filename) if e != nil { panic(e) } + if (multidisc) { + filename = fmt.Sprintf("%s/Disc %d/%s", dirName, track.Volume, filename) + } else { + filename = fmt.Sprintf("%s/%s", dirName, filename) + } + if i == 0 { firstFile = filename }