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

new "unexpected error" message #18

Open
umbongodrink opened this issue Sep 19, 2021 · 11 comments
Open

new "unexpected error" message #18

umbongodrink opened this issue Sep 19, 2021 · 11 comments

Comments

@umbongodrink
Copy link

umbongodrink commented Sep 19, 2021

I have been using twitch-stream-recorder for many months, it is great software, thank you for making it!

During that time I leave it running and am accustomed to seeing the message:

<twitch-user> currently offline, checking again in 15 seconds
and this will keep checking every 15 seconds until the comes online and then the software will record the stream.

However, recently I have noticed that after the intial "checking in 15 seconds" message as above, the twitch-stream-recorder software now gives the message:

<time-of-day> unexpected error. will try again in 5 minutes

For example:

python3.8 twitch-recorder.py --username francoisknyc --quality audio_only checking for francoisknyc every 15 seconds, recording with audio_only quality francoisknyc currently offline, checking again in 15 seconds 04h20m44s unexpected error. will try again in 5 minutes

I have recently built a new VM Ubuntu 20.04.03, with a fresh download of twitch-stream-recorder, to see if the issue would re-occur and it does.

This is the output of twitch-recorder.log:
INFO:root:checking for francoisknyc every 15 seconds, recording with audio_only quality
INFO:root:francoisknyc currently offline, checking again in 15 seconds
ERROR:root:04h20m44s unexpected error. will try again in 5 minutes
INFO:root:checking for francoisknyc every 15 seconds, recording with audio_only quality
ERROR:root:04h25m35s unexpected error. will try again in 5 minutes

Could you please offer assistance as to a fix on this?
Thank you.

@ancalentari
Copy link
Owner

Hello,
unfortunately, due to some health issues and lack of time I am unable to look into it, since I was doing this in my spare time.

@DravenTec
Copy link

DravenTec commented Sep 19, 2021

Is the current version of Streamlink installed (2.4.0)?
The version in the Ubuntu repo is outdated and causes problems.

I would test if it works without Recorder Script directly with Streamlink.

This command tries to play the stream in the VLC player.
streamlink --twitch-disable-ads twitch.tv/francoisknyc audio_only

This command records the stream.
streamlink --twitch-disable-ads twitch.tv/francoisknyc audio_only -o recorded_stream.mp4

@umbongodrink
Copy link
Author

Hi DravenTec,

thank you very much for your response and looking into the issue! :)

So I have two VM installations of Ubuntu trying to do use the twitch-stream-recorder script.
One is Ubuntu 18.04 with Streamlink 2.1.1 installed.
The other is Ubuntu 20.04 with Streamlink 2.4.0 installed.
In both instances I get the error.
The strange thing is, this error is fairly recent, like starting within the last week or two?? Nothing changed on my 18.04 installation to cause this as far as I can tell.

The problem also seems to come and go:

ladmin@ubuntuiplayer:/mnt/hgfs/TWITCH-STREAM-RECORDER$ python3.8 twitch-recorder.py --username francoisknyc --quality audio_only checking for francoisknyc every 15 seconds, recording with audio_only quality francoisknyc currently offline, checking again in 15 seconds francoisknyc currently offline, checking again in 15 seconds francoisknyc currently offline, checking again in 15 seconds francoisknyc currently offline, checking again in 15 seconds francoisknyc currently offline, checking again in 15 seconds francoisknyc currently offline, checking again in 15 seconds 09h21m57s unexpected error. will try again in 5 minutes francoisknyc currently offline, checking again in 15 seconds francoisknyc currently offline, checking again in 15 seconds 09h27m42s unexpected error. will try again in 5 minutes francoisknyc currently offline, checking again in 15 seconds 09h33m13s unexpected error. will try again in 5 minutes 09h38m28s unexpected error. will try again in 5 minutes 09h43m43s unexpected error. will try again in 5 minutes francoisknyc currently offline, checking again in 15 seconds francoisknyc currently offline, checking again in 15 seconds francoisknyc currently offline, checking again in 15 seconds francoisknyc currently offline, checking again in 15 seconds francoisknyc currently offline, checking again in 15 seconds francoisknyc currently offline, checking again in 15 seconds francoisknyc currently offline, checking again in 15 seconds francoisknyc currently offline, checking again in 15 seconds 09h51m00s unexpected error. will try again in 5 minutes

Do you know of a version of Streamlink that will work with the twitch-stream-recorder script?
I've had a look here https://streamlink.github.io/install.html, and it seems 2.4.0 is the latest Stable, with 2.4.0+19.gb943184 being the Latest?

Thanks for those two commands. Quick question:
streamlink --twitch-disable-ads twitch.tv/francoisknyc audio_only -o recorded_stream.mp4
I'm presuming I have to wait for the user francoisnyc to go live, and then try to test with the command?

@DravenTec
Copy link

I record a lot of streams myself, streamlink 2.4.0 works with Twitch in any case.
However, my script is different from this one.

With the command you have to wait until the stream is live so it can record.
Does the recording always stop after several hours of recording?

@umbongodrink
Copy link
Author

Hi I used the command you very kindly gave
streamlink --twitch-disable-ads twitch.tv/francoisknyc audio_only -o recorded_stream.mp4
and it did work, to create the file recorded_stream.mp4.
I did have to wait until the Twitch artist went live and the streamlink recording did stop when the Twitch broadcast ended.

So that's nice to have in the pocket. I wonder if I can use (Bash) variables to give the file a date and time etc.
Would you be able to share your script please?

Curiously, tonight I've been toying about with the system in various minor unrelated ways, and accidentally looking at the twitch-stream-recorder script running in various tmux sessions, I'm not seeing the "unexpected error" that kicked this whole thread off... Really no idea why not! Will continue to monitor.

@DravenTec
Copy link

I uploaded the whole thing earlier ( https://gist.github.com/DravenTec ), but OAuth and ClientID have to be added.
I have started the script either via "screen" or if it is persistent directly via systemd.
Would suspect that it was a problem with Twitch or the like, that something has swallowed there.

@DravenTec
Copy link

DravenTec commented Sep 29, 2021

I have now the same error and can no longer record because directly Error is reported and Retry. The whole thing should be related to the OAuth and the ClientID. The recording directly via streamlink is still possible. Only the check whether the stream is live makes the problem. As far as I have found out, I have a very very old ClientID that has always worked. I guess Twitch throws out the old "God Tokens" that did not expire now.

I'm sorry I didn't see this before or get the idea. I'm not a programmer and I'm always trying to find a way through it. My token seemed to be valid at the time still normal. I guess Twitch just threw out all the old tokens now. So that the record with the again goes must be entered simply a new and ClientID and a matching OAuth token. Then the recording should run again for the time being, the tokens are valid for 60 days.

@umbongodrink
Copy link
Author

Thanks for your comments DravenTec, and apologies for the slow reply, I was travelling when you posted.

I have generated a new ClientID and OAuth token just now and pasted it in config.py. I hope this will actually work as I can't possibly manually start the recordings all the time - I really need to rely on the script to automatically poll every 15 seconds and start recording when it detects a broadcast.

It's a shame if the old ClientIDs no longer work. This script was working brilliantly with them for nearly a year for me.

I will keep on monitoring the situation and hoping the new ClientID and OAuth combination work. 60 days is better than nothing - I can easily set an entry in my calendar as a reminder to update the token.

@DravenTec
Copy link

DravenTec commented Oct 11, 2021

Thanks for your comments DravenTec, and apologies for the slow reply, I was travelling when you posted.

I have generated a new ClientID and OAuth token just now and pasted it in config.py. I hope this will actually work as I can't possibly manually start the recordings all the time - I really need to rely on the script to automatically poll every 15 seconds and start recording when it detects a broadcast.

It's a shame if the old ClientIDs no longer work. This script was working brilliantly with them for nearly a year for me.

I will keep on monitoring the situation and hoping the new ClientID and OAuth combination work. 60 days is better than nothing - I can easily set an entry in my calendar as a reminder to update the token.

With me it ran with the token unfortunately only one night, am not sure what it was.
I have therefore changed the whole once to the twitchcli so that the token can always be updated.

I also need this functional because I record several streams for archiving purposes. The whole thing is now running for a week without problems, but you still have to set crontab so that the token is updated, I still have to add to the instructions.

@umbongodrink
Copy link
Author

Could you explain please "changed the whole once to the twitchcli so that the token can always be updated"?
I presume you're referring to your own fork, https://github.com/DravenTec/Twitch-Stream-Recorder?

@DravenTec
Copy link

Could you explain please "changed the whole once to the twitchcli so that the token can always be updated"? I presume you're referring to your own fork, https://github.com/DravenTec/Twitch-Stream-Recorder?

I have built in the https://github.com/twitchdev/twitch-cli that the query is performed over it. This can then also update the token via crontab. You also need the twitch-cli for this, but it was easier for me than to get this done with a self-renewing token.
I can mess around in code but I am far from being a programmer.

Basically ancalentari would have to rebuild the token system so that he regularly updates the token, this is possible with the help of a refresh token which must also be renewed.

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