~krathalan/wtwitch#2: 
-c flag not listing all live channels, seemingly if too many are subscribed

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.

Log with minimal subs, no issue

Log with many subs

Status
RESOLVED FIXED
Submitter
~firegem
Assigned to
Submitted
2 years ago
Updated
1 year, 7 months ago
Labels
bug

~krathalan 2 years ago

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 you cat 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?

~firegem 2 years ago

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. cating the file also just shows the one entry.

~krathalan 2 years ago

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?

~firegem 2 years ago

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 in stream_offline.txt).

~firegem 2 years ago

I realize the api error wouldn't appear on my log now because it's less detailed, but the rest still stands.

~firegem 2 years ago

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.

~krathalan 2 years ago

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 :)

~krathalan referenced this from #3 2 years ago

~krathalan 2 years ago

@~firegem can you please test the latest dev version I have just published to see if it fixes the issue?

Either:

  1. 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.

  2. Download it from here: https://git.sr.ht/~krathalan/wtwitch/blob/dev/wtwitch Then cd to wherever you downloaded it to and run rm -rf ~/.cache/wtwitch && bash wtwitch -c to use the local version.

~krathalan 2 years ago

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:

  1. 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.

  2. Download it from here: https://git.sr.ht/~krathalan/wtwitch/blob/dev/wtwitch
    Then cd to wherever you downloaded it to and run rm -rf ~/.cache/wtwitch && bash wtwitch -c to use the local version.

~krathalan 2 years ago

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:

  1. 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.


  1. Download it from here: https://git.sr.ht/~krathalan/wtwitch/blob/dev/wtwitch

Then cd to wherever you downloaded it to and run rm -rf ~/.cache/wtwitch && bash wtwitch -c to use the local version.

~krathalan referenced this from #3 2 years ago

~firegem 2 years ago

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.

~krathalan REPORTED FIXED 2 years ago

Awesome :) yes, it should be right next to the comment button.

Anyways, 1.2.0 is on the AUR now with the fix.

~krathalan referenced this from #8 1 year, 7 months ago

Kevin Malcolm referenced this from #8 1 year, 7 months ago

Register here or Log in to comment, or comment via email.