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

Can you use this for tiktok as well? #12

Closed
spinningsand opened this issue May 25, 2022 · 45 comments
Closed

Can you use this for tiktok as well? #12

spinningsand opened this issue May 25, 2022 · 45 comments
Labels
enhancement New feature or request

Comments

@spinningsand
Copy link

I noticed it worked on douyin and that you had tiktok tagged, but I wasn't sure.

luxcgo added a commit that referenced this issue May 29, 2022
@luxcgo
Copy link
Contributor

luxcgo commented May 29, 2022

Yes. Tiktok is fully supported in olive v0.2.9. Try for yourself!

@spinningsand
Copy link
Author

Thanks for that! But I'm not exactly sure how to use it. Can you help me?

@luxcgo
Copy link
Contributor

luxcgo commented May 30, 2022

You can first download the executable file for your os platform. And change the config.toml file to your streamer.
Last simply run the command /path/to/olive -c /path/to/config.toml, or you can cd the olive directory and run ./olive -c /path/to/config.toml

@spinningsand
Copy link
Author

I was able to change the config.toml file, but when I tried to run C:\Users\CLUNKYBOXCOMPUTER\go\pkg\mod\github.com\go-olive\olive@v0.2.9 -c C:\Users\CLUNKYBOXCOMPUTER\go\pkg\mod\github.com\go-olive\olive@v0.2.9\src\tmp\config.toml I get:

'C:\Users\CLUNKYBOXCOMPUTER\go\pkg\mod\github.com\go-olive\olive@v0.2.9' is not recognized as an internal or external command,
operable program or batch file.

So then I try the second option and put cd C:\Users\CLUNKYBOXCOMPUTER\go\pkg\mod\github.com\go-olive\olive@v0.2.9 and then -c C:\Users\CLUNKYBOXCOMPUTER\go\pkg\mod\github.com\go-olive\olive@v0.2.9\src\tmpl\config.toml and get:

'-c' is not recognized as an internal or external command,
operable program or batch file.

@luxcgo
Copy link
Contributor

luxcgo commented May 30, 2022

  1. go install github.com/go-olive/olive/src/cmd/olive@latest
  2. olive -c /path/to/config.toml

How about running this?

@luxcgo
Copy link
Contributor

luxcgo commented May 30, 2022

Actually, you have to download exe from https://github.com/go-olive/olive/releases. And put it somewhere, then cd that directory.

@spinningsand
Copy link
Author

What's the difference between the to amd64? I noticed there are 2 different sizes for them.

@luxcgo
Copy link
Contributor

luxcgo commented May 30, 2022

better google it

@spinningsand
Copy link
Author

I tried the first option and it seems to work, but how do you add more than 1 person to the same site? And is it okay to erase stuff from the sites you don't wanna use?

@luxcgo
Copy link
Contributor

luxcgo commented May 30, 2022

[[Shows]]
Platform = "tiktok"
RoomID = "rpd.beans"
OutTmpl = "[{{ now | date \"2006-01-02 15-04-05\"}}][{{ .StreamerName }}]"

One block like this means one streamer, you can add or delete whatever streamers you want.

@spinningsand
Copy link
Author

Awesome thanks! It downloaded a stream of someone I put in! One last question. Is it okay to leave it open when they're offline, would it start recording again if they go back online?

@luxcgo
Copy link
Contributor

luxcgo commented May 30, 2022

Of course, that's the key point.

@spinningsand
Copy link
Author

Okay, thanks again for helping me! You're awesome!

@spinningsand
Copy link
Author

spinningsand commented May 30, 2022

Actually, I have 1 last question. When they're not live it outputs this every time it make a snapshot:

←[31mERRO←[0m[2022-05-30 09:44:35] snap failed, User might be offline, Room ID not found ←[31mid←[0m=promobot.robots←[31mpf←[0m=tiktok

Is there a way you can make it where it doesn't output that as much and only when they're online? I can deal with it if it needs to stay that way, but I was just curious if you could do something about it so it'd look less cluttered.

@luxcgo
Copy link
Contributor

luxcgo commented May 30, 2022

Yes, I've just published a new release. u could use olive v0.2.10

@spinningsand
Copy link
Author

TikTok blocked my IP. Are there proxies or something that's supposed to be used with it?

@spinningsand
Copy link
Author

I added about 4 different streamers to it and left it running for several hours while I went out and when I got back home, it was returning this:

←[31mERRO←[0m[2022-05-30 17:20:19] snap failed, Your IP or country might be blocked by TikTok.

When I try to go on tiktok, it's a blank white screen, but I can still log into my account but only with a VPN.

@luxcgo
Copy link
Contributor

luxcgo commented May 31, 2022

Such conditions happened on other platform (kuaishou, a china tiktok competitor) as well. We might need to change a way of getting streamer infos which need some diggings.

@spinningsand
Copy link
Author

Ahh okay. Could taking snapshots less often be a temporary fix until then? Like maybe if one was taken once every few minutes, it might be able to avoid getting the IP blocked.

@luxcgo
Copy link
Contributor

luxcgo commented May 31, 2022

Worth a try, I'll add the time interval as a configuration later.

@spinningsand
Copy link
Author

Thanks, appreciate it.

@luxcgo luxcgo added the enhancement New feature or request label May 31, 2022
luxcgo added a commit that referenced this issue May 31, 2022
@luxcgo
Copy link
Contributor

luxcgo commented May 31, 2022

feat is supported in v0.2.11, the param name is SnapRestSeconds

@spinningsand
Copy link
Author

Thanks, I've give it a try when and let it run for a while and give you an update

@spinningsand
Copy link
Author

I changed the SnaprestSeconds value in config.toml and it doesn't do anything, it still takes a snap a snap every 5 seconds. I changed to 300 (for 5 minutes)

@luxcgo
Copy link
Contributor

luxcgo commented Jun 1, 2022

It works like a charm for me locally. Could u upload the config file?
And have u downloaded the new release? https://github.com/go-olive/olive/releases/tag/v0.2.11
Also the name is not quite right.

Change the params in config file like the following and try again?

LogLevel = 6
SnapRestSeconds = 300

@spinningsand
Copy link
Author

spinningsand commented Jun 2, 2022

Yes, I installed the newest version and when I try ,it just keeps taking snaps with little to no pause. It outputs this every few seconds:

←[31mERRO←[0m[2022-06-01 20:38:44] snap failed, User might be offline, Room ID not found ←[31mid←[0m=promobot.robots ←[31mpf←[0m=tiktok

It's only supposed to say that once every 5 minutes if you set the SnapRestSeconds param to 300, right? I'm not sure what LogLevel does but I set it to 6 as well. I barely had it running and it was already taking multiple snaps. This is what a I have in my config file, I have it to just 1 streamer now to reduce clutter until I can get it to work right:

LogLevel = 6
SnapRestSeconds = 300


[[Shows]]
Platform = "tiktok"
RoomID = "promobot.robots"
OutTmpl = "[{{ now | date \"2006-01-02 15-04-05\"}}][{{ .StreamerName }}]"

@luxcgo
Copy link
Contributor

luxcgo commented Jun 2, 2022

If you change the LogLevel to 0 and rerun it, it's supposed to output nothing.
If not probably you're not using the latest version.

@spinningsand
Copy link
Author

I got it to work. Even though I had the latest version, I think I had another folder that had some older packages that were interfering with it or didn't get updated or something, so I just deleted everything I've been installing for the past week or so and re-installed the latest version and that helped. It seems to be working now. Thanks!

But I was wondering, what does LogLevel mean?

@spinningsand
Copy link
Author

My IP got blocked setting it to 5 minutes as well. I'll have to try 10 minutes.

@luxcgo
Copy link
Contributor

luxcgo commented Jun 3, 2022

LogLevel controls the content that logger can log. It ranges from 0 to 6, as it grows larger, more detailed the logs become.

@spinningsand
Copy link
Author

spinningsand commented Jun 5, 2022

Since I've changed the SnapRestSeconds to 600 it hasn't blocked my IP, but one thing I've noticed is after a live ends, I get this:

panic: close of closed channel

goroutine 9309 [running]:
github.com/Davincible/gotiktoklive.(*TikTok).newLive.func1()
        C:/Users/CLUNKYBOXCOMPUTER/go/pkg/mod/github.com/!davincible/gotiktoklive@v0.0.0-20220525135242-dda499f27e6d/live.go:60 +0x4b
github.com/Davincible/gotiktoklive.(*Live).parseWssMsg.func1()
        C:/Users/CLUNKYBOXCOMPUTER/go/pkg/mod/github.com/!davincible/gotiktoklive@v0.0.0-20220525135242-dda499f27e6d/wss.go:228 +0x44
created by github.com/Davincible/gotiktoklive.(*Live).parseWssMsg
        C:/Users/CLUNKYBOXCOMPUTER/go/pkg/mod/github.com/!davincible/gotiktoklive@v0.0.0-20220525135242-dda499f27e6d/wss.go:225 +0x5ad

Then it shuts down.

@spinningsand
Copy link
Author

spinningsand commented Jun 6, 2022

Here's another output I get when the same thing happens:

panic: Failed to read websocket message, atempting to reconnect: EOF

goroutine 293 [running]:
github.com/Davincible/gotiktoklive.routineErrHandler({0xc0016bd9c0?, 0x3c?, 0xc000249ec8?})
        C:/Users/CLUNKYBOXCOMPUTER/go/pkg/mod/github.com/!davincible/gotiktoklive@v0.0.0-20220525135242-dda499f27e6d/utils.go:330 +0x2d
github.com/Davincible/gotiktoklive.(*Live).readSocket(0xc0000e8d80)
        C:/Users/CLUNKYBOXCOMPUTER/go/pkg/mod/github.com/!davincible/gotiktoklive@v0.0.0-20220525135242-dda499f27e6d/wss.go:121 +0x305
created by github.com/Davincible/gotiktoklive.(*Live).tryConnectionUpgrade
        C:/Users/CLUNKYBOXCOMPUTER/go/pkg/mod/github.com/!davincible/gotiktoklive@v0.0.0-20220525135242-dda499f27e6d/wss.go:294 +0x136

luxcgo added a commit to go-olive/tv that referenced this issue Jun 6, 2022
@luxcgo
Copy link
Contributor

luxcgo commented Jun 6, 2022

try v0.2.12, see if it happens.

@spinningsand
Copy link
Author

spinningsand commented Jun 6, 2022

It handles some lives for a while, but then it gave this output before it closed down again:

panic: Failed to read websocket message, atempting to reconnect: EOF

goroutine 2150 [running]:
github.com/Davincible/gotiktoklive.routineErrHandler({0xc0021874b0?, 0x3c?, 0xc00178fec8?})
        C:/Users/CLUNKYBOXCOMPUTER/go/pkg/mod/github.com/!davincible/gotiktoklive@v0.0.0-20220525135242-dda499f27e6d/utils.go:330 +0x2d
github.com/Davincible/gotiktoklive.(*Live).readSocket(0xc001c5e000)
        C:/Users/CLUNKYBOXCOMPUTER/go/pkg/mod/github.com/!davincible/gotiktoklive@v0.0.0-20220525135242-dda499f27e6d/wss.go:121 +0x305
created by github.com/Davincible/gotiktoklive.(*Live).tryConnectionUpgrade
        C:/Users/CLUNKYBOXCOMPUTER/go/pkg/mod/github.com/!davincible/gotiktoklive@v0.0.0-20220525135242-dda499f27e6d/wss.go:294 +0x136

@luxcgo
Copy link
Contributor

luxcgo commented Jun 7, 2022

v0.2.13 has fixed the bug, please try again.

@spinningsand
Copy link
Author

Seems to be working good for now! I'll give another update if there are more issues. Thanks for all your help!

@spinningsand
Copy link
Author

There is another thing I've noticed. Sometimes it only gets the audio while the video is a blank black screen.

@spinningsand
Copy link
Author

The panic issue happened again as well. I noticed it only happens in lives when there's a likes battle. After it ended, it gave this output before shutting down:

panic: Failed to read websocket message, atempting to reconnect: EOF

goroutine 15244 [running]:
github.com/Davincible/gotiktoklive.routineErrHandler({0xc002e7c1f0?, 0x3c?, 0xc0016cfec8?})
        C:/Users/CLUNKYBOXCOMPUTER/go/pkg/mod/github.com/!davincible/gotiktoklive@v0.0.0-20220525135242-dda499f27e6d/utils.go:330 +0x2d
github.com/Davincible/gotiktoklive.(*Live).readSocket(0xc002cef980)
        C:/Users/CLUNKYBOXCOMPUTER/go/pkg/mod/github.com/!davincible/gotiktoklive@v0.0.0-20220525135242-dda499f27e6d/wss.go:121 +0x305
created by github.com/Davincible/gotiktoklive.(*Live).tryConnectionUpgrade
        C:/Users/CLUNKYBOXCOMPUTER/go/pkg/mod/github.com/!davincible/gotiktoklive@v0.0.0-20220525135242-dda499f27e6d/wss.go:294 +0x136

@luxcgo
Copy link
Contributor

luxcgo commented Jun 9, 2022

same issue, you're not using the latest version according to your log

@spinningsand
Copy link
Author

spinningsand commented Jun 9, 2022

Oops, I didn't see the latest update there.

@spinningsand
Copy link
Author

I'm still getting some blank videos that only has audio. Do you know anything that might be causing that?

@luxcgo
Copy link
Contributor

luxcgo commented Jun 10, 2022

Probably u could try a different parser and see where it goes. Download ffmpeg locally and add a line Parser = "ffmpeg" under [[Shows]]
Btw, I'm only downloading the streams provided, not doing the fixing job. If stream itself is broken, there's not much I can do.

@spinningsand
Copy link
Author

spinningsand commented Jun 10, 2022

Thanks, the added ffmpeg line seems to have worked on every live that I've tested it on so far.

I keep getting panics, I've deleted every old folder I had and re-installed the latest version:

panic: Failed to read websocket message, atempting to reconnect: read tcp 192.168.0.7:53623->104.76.210.216:443: wsarecv: An existing connection was forcibly closed by the remote host.

goroutine 325 [running]:
github.com/Davincible/gotiktoklive.routineErrHandler({0xc002f3a260?, 0x3c?, 0xc00293fec8?})
        C:/Users/CLUNKYBOXCOMPUTER/go/pkg/mod/github.com/!davincible/gotiktoklive@v0.0.0-20220525135242-dda499f27e6d/utils.go:330 +0x2d
github.com/Davincible/gotiktoklive.(*Live).readSocket(0xc000320080)
        C:/Users/CLUNKYBOXCOMPUTER/go/pkg/mod/github.com/!davincible/gotiktoklive@v0.0.0-20220525135242-dda499f27e6d/wss.go:121 +0x305
created by github.com/Davincible/gotiktoklive.(*Live).tryConnectionUpgrade
        C:/Users/CLUNKYBOXCOMPUTER/go/pkg/mod/github.com/!davincible/gotiktoklive@v0.0.0-20220525135242-dda499f27e6d/wss.go:294 +0x136

I deleted the !davincible folder along with everything related to olive before re-installing. When I check my files, I don't even have the !davincible folder anymore that the error is supposedly coming from.

@luxcgo
Copy link
Contributor

luxcgo commented Jun 11, 2022

I'm confused about how you installed it. If you build it from source, u need to run go install github.com/go-olive/olive/src/cmd/olive@latest.

@spinningsand
Copy link
Author

spinningsand commented Jun 12, 2022

I've been installing the .zip file. I deleted it again and re-installed again with the command line yesterday and I've been letting it run since then and so far, no issues right now. I'll keep letting it run and hopefully no more will pop up. Thanks again for all your help! I'm new to programming so it's nice to have someone like you helping me out. I have it feeling it's gonna work good now..... hopefully lol....

@luxcgo luxcgo closed this as completed Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants