Open xiconet opened 9 years ago
You need to compile latest binary from git (requires go-1.3). Confirmed to work.
I have the same problem with an executable compiled with go 1.4, according to the instructions you provide: git clone https://github.com/t3rm1n4l/megacmd.git cd megacmd make
Guess I'll have to learn a bit more about about the Go language. Thanks for the code anyway.
Well, here I come again after learning some go confirmed NOT to work:
in file utils.go
func decryptAttr (...) {
...
if string(buf[:4]) == "MEGA" {
str := strings.TrimRight(string(buf[4:]), "\x00")
fmt.Println("str:", str) // this is the debug statement I added
err = json.Unmarshal([]byte(str), &attr)
}
return
}
megacmd list mega:/ > output
example output, as seen in Notepad++
str: {"n":"Weather Report - Live in Tokyo (1972)"} // OK, correctly listed
str: {"n":"Herbie Mann"} NUL DC3 NUL EOT NUL S SOH SI // This will throw BAD ATTRIBUTE
This shows that the decoded attributes are (very often in my case) followed by non NUL characters, and explains why the downstream function returns BAD ATTRIBUTE
Should be easy to fix, some regexp perhaps?
The solution a this bug: 1- Download the package go- mega and put in local directory. 2 - Edit utils.go file 3 - Find the line: str := strings.TrimRight(string(buf[4:]), "\x00") 4 - Replace for line: str := string(buf[4:strings.Index(string(buf), "\x00")])
Hello, I see megacmd allows "segmented" downloading and i'd love to be able to use it. Unfortunately, this is what I get when trying to list items in some account:
Root: seems OK, the two existing folders are shown.
But if I try to list one of these folders:
What surprises me is that some sub-folders do appear, while all names are (apparently) of the same form and come from the same source. Moreover, all have been uploaded with the same tool. So what is it that makes a "bad attribute"? I used a self-compiled version on a machine running WinXP-sp3. Same problem when using either the native cmd.exe or git-bash.