Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic #7

Open
abhinavprateek opened this issue Aug 22, 2018 · 4 comments
Open

Panic #7

abhinavprateek opened this issue Aug 22, 2018 · 4 comments

Comments

@abhinavprateek
Copy link

`panic: interface conversion: interface {} is nil, not string

goroutine 1 [running]:
main.genericCmd(0x1b, 0x0, 0x11d82360, 0xb, 0x11d84348, 0x1, 0x1)
/home/pi/go/src/github.com/CBiX/gotubecast/main.go:291 +0x40a0
main.decodeBindStream(0x74c6bd10, 0x11dfa4d0, 0x11dfa4d0, 0x74c6bd10)
/home/pi/go/src/github.com/CBiX/gotubecast/main.go:233 +0x104
main.main()
/home/pi/go/src/github.com/CBiX/gotubecast/main.go:191 +0x11d4`

@cbix
Copy link
Owner

cbix commented Aug 22, 2018

Hi, can you post the lines above as well, so I can see which cmd triggered your error? Thanks.

Quickfix would be changing line 291
currentTime := data["currentTime"].(string)
to

currentTime := 0
if data["currentTime"] != nil {
    currentTime = data["currentTime"].(string)
}

Anyway I'll integrate more data checks soon, thanks for reporting this one :)

@abhinavprateek
Copy link
Author

Will try that and revert.

Also I am noticing delay in music playback, after I select the video and the video starts playing on the Raspberry Pi. The delay is in the range 15 - 20 seconds. Is it normal?

@cbix
Copy link
Owner

cbix commented Aug 23, 2018

Yea the script uses youtube-dl, which can take around 15 secs to start and fetch the video stream URL. Because there is no open API for obtaining the stream link from a video ID, we have to rely on youtube-dl here for now.

@banyip
Copy link

banyip commented Mar 17, 2019

Hi, can you post the lines above as well, so I can see which cmd triggered your error? Thanks.

Quickfix would be changing line 291
currentTime := data["currentTime"].(string)
to

currentTime := 0
if data["currentTime"] != nil {
    currentTime = data["currentTime"].(string)
}

Anyway I'll integrate more data checks soon, thanks for reporting this one :)

after Quickfix, the following build errors occurs:
root@raspberrypi:~/gotubecast# GOARCH=arm go build

_/root/gotubecast

./main.go:293: cannot use data["currentTime"].(string) (type string) as type int in assignment
./main.go:306: cannot convert "s" to type int
./main.go:306: invalid operation: currentTime + "s" (mismatched types int and string)
./main.go:321: cannot use currentTime (type int) as type string in map value
./main.go:329: cannot use currentTime (type int) as type string in map value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants