The output of wtwitch -c
results in only one live channel listed, even if there are multiple, these channels are absent in both the online and offline lists, but seem to be present in the debug log. There are two pastes below, with both the terminal output and debug information. Not certain what causes this, but it has only begun recently.
Before getting the log for both commands, I uninstalled, reinstalled, and deleted both the config and cache files.
Hi, thanks for your thorough bug report. This is strange!
On line 1135 of your many subs debug log,
sort /home/matt/.cache/wtwitch/stream_online.txt
shows all of the streamers that aren't printing. If youcat
that file can you confirm all of the streamers are there? If I copy+paste the output of the sort command from the debug log it seems that nothing is getting improperly escaped. So it seems the output is getting clipped somehow.What is your terminal emulator? Have you tried a different terminal emulator?
This was initially tested on Alacritty, though the same thing happens on the XFCE Terminal. The part of the log you pointed out also stood out to me, but I no longer have that specific cache file. The new
online
file, however, now contains just one channel, though the specific channel differs between each rerun.Here is a new log showing the change in
stream_online.txt
.cat
ing the file also just shows the one entry.
So it seems like this issue is caused by the Twitch API's rate limiting. I had suspected this but just did some additional testing to confirm.
You can read more about Twitch's rate limiting here: https://dev.twitch.tv/docs/api/guide/#rate-limits
Here is a paste showing the error (at the very end): https://bin.privacytools.io/?6886d01fe1d7684f#rJD3AGRbB6bU+MI+wVQbXiHsqtzuoi1/i4KAt8q+MtU=
A solution to this is to create a dummy Twitch account and only use it to generate a new API key. In the developer console (https://dev.twitch.tv/console), under "Applications", click "Register your application". You can use any name and URL for it. Even wtwitch's "URL" is "http://localhost". Then use the new Client ID (for example, "cotxsalhlctv8z572f7fant4b0sc3u" is wtwitch's).
At the moment you'd have to edit the wtwitch script every time you update it for the new Client ID. However I would be able to easily add an option to save a custom Client ID to the config file. Does this sound like it would work for you?
Sorry for the late reply. Changing the ID does nothing to fix the output (with both my main account and a throwaway). The debug log looks similar to the one I linked in my last comment, meaning there is no error at the bottom, and only one channel shows up in
stream_online.txt
(the other live channels not appearing instream_offline.txt
).
I realize the api error wouldn't appear on my log now because it's less detailed, but the rest still stands.
jq '.subscriptions[].streamer' config.json | wc -l
gives me 29 subscriptions. Of those, 3 are online but only two show up. Maybe there's just a hard cap.
I've been busy this last week but I plan to look at ways to reduce the number of API calls soon. I tried before but it wasn't working for me -- need to keep digging :)
@~firegem can you please test the latest dev version I have just published to see if it fixes the issue?
Either:
Clone the repository:
git clone https://git.sr.ht/~krathalan/wtwitch
Enter dir:cd wtwitch/
Checkout dev branch:git checkout dev
Runrm -rf ~/.cache/wtwitch && bash wtwitch -c
to use the local version.Download it from here: https://git.sr.ht/~krathalan/wtwitch/blob/dev/wtwitch Then
cd
to wherever you downloaded it to and runrm -rf ~/.cache/wtwitch && bash wtwitch -c
to use the local version.
Sorry about the formatting.
@~firegem can you please test the latest dev version I have just published to see if it fixes the issue?
Either:
Clone the repository: git clone https://git.sr.ht/~krathalan/wtwitch
Enter dir:cd wtwitch/
Checkout dev branch:git checkout dev
Runrm -rf ~/.cache/wtwitch && bash wtwitch -c
to use the local version.Download it from here: https://git.sr.ht/~krathalan/wtwitch/blob/dev/wtwitch
Thencd
to wherever you downloaded it to and runrm -rf ~/.cache/wtwitch && bash wtwitch -c
to use the local version.
Wow, sourcehut markdown really doesn't like me. I wish I could delete comments. :|
@~firegem can you please test the latest dev version I have just published to see if it fixes the issue?
Either:
- Clone the repository: git clone https://git.sr.ht/~krathalan/wtwitch
Enter dir:
cd wtwitch/
Checkout dev branch:
git checkout dev
Run
rm -rf ~/.cache/wtwitch && bash wtwitch -c
to use the local version.
- Download it from here: https://git.sr.ht/~krathalan/wtwitch/blob/dev/wtwitch
Then
cd
to wherever you downloaded it to and runrm -rf ~/.cache/wtwitch && bash wtwitch -c
to use the local version.
Yeah, this seems to have worked, the command outputs all online streamers with none missing from either list. Also tried it with >30 total streamers and it still works, thanks a lot!
I feel you with the markdown, too. Good thing they have a preview button on desktop though.
Awesome :) yes, it should be right next to the comment button.
Anyways, 1.2.0 is on the AUR now with the fix.