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

send_watch InvalidUrlClientError [{"error":"Can not find channel"}] #586

Open
DevilXD opened this issue Oct 24, 2024 · 8 comments
Open

send_watch InvalidUrlClientError [{"error":"Can not find channel"}] #586

DevilXD opened this issue Oct 24, 2024 · 8 comments
Labels
Bug Something isn't working

Comments

@DevilXD
Copy link
Owner

DevilXD commented Oct 24, 2024

          Not sure if this was related but using the latest master I was able to mine for about 40 minutes and then received this:
16:04:03: Watching: InfernoTheFireLord
16:43:12: Watching: mellowteddy
16:43:33: ERROR: Exception in _watch_loop task
16:43:33: Traceback (most recent call last):
16:43:33:   File "channel.py", line 380, in send_watch
16:43:33:   File "contextlib.py", line 199, in __aenter__
16:43:33:   File "twitch.py", line 1313, in request
16:43:33:   File "gui.py", line 2198, in coro_unless_closed
16:43:33:   File "aiohttp\client.py", line 1343, in send
16:43:33:   File "aiohttp\client.py", line 592, in _request
16:43:33: aiohttp.client_exceptions.InvalidUrlClientError: %5B%7B%22error%22:%22Can%20not%20find%20channel%22%7D%5D
16:43:33: 
16:43:33: The above exception was the direct cause of the following exception:
16:43:33: 
16:43:33: Traceback (most recent call last):
16:43:33:   File "utils.py", line 132, in wrapper
16:43:33:   File "twitch.py", line 888, in _watch_loop
16:43:33:   File "channel.py", line 401, in send_watch
16:43:33: exceptions.MinerException
16:43:33: Exiting...
16:43:33: 
16:43:33: Application Terminated.
16:43:33: Close the window to exit the application.

Originally posted by @introvertism in #583 (comment)

@DevilXD
Copy link
Owner Author

DevilXD commented Oct 27, 2024

Related: #590 (comment)

@jordyamc
Copy link

I had a similar error but with InvalidURL

03:41:41: ERROR: Exception in _watch_loop task
03:41:41: Traceback (most recent call last):
03:41:41:   File "channel.py", line 381, in send_watch
03:41:41:   File "contextlib.py", line 199, in __aenter__
03:41:41:   File "twitch.py", line 1313, in request
03:41:41:   File "gui.py", line 2208, in coro_unless_closed
03:41:41:   File "aiohttp\client.py", line 1178, in send
03:41:41:   File "aiohttp\client.py", line 545, in _request
03:41:41:   File "aiohttp\client_reqrep.py", line 326, in __init__
03:41:41:   File "aiohttp\client_reqrep.py", line 400, in update_host
03:41:41: aiohttp.client_exceptions.InvalidURL: %5B%7B%22url%22:%22/api/channel/hls/multiversus.m3u8?sig=1585980187f867e3540788aee51c17be3c7ea060%5Cu0026token=%7B%22adblock%22:false,%22authorization%22:%7B%22forbidden%22:false,%22reason%22:%22%22%7D,%22blackout_enabled%22:false,%22channel%22:%22multiversus%22,%22channel_id%22:735931830,%22chansub%22:%7B%22restricted_bitrates%22:%5B%5D,%22view_until%22:1924905600%7D,%22ci_gb%22:true,%22geoblock_reason%22:%22content_geoblocked%22,%22device_id%22:%22EbiUgsm409aCa4hsGuPKWSCWRfU0UXDu%22,%22expires%22:1730023300,%22extended_history_allowed%22:false,%22game%22:%22%22,%22hide_ads%22:false,%22https_required%22:true,%22mature%22:false,%22partner%22:false,%22platform%22:%22web%22,%22player_type%22:%22site%22,%22private%22:%7B%22allowed_to_view%22:true%7D,%22privileged%22:false,%22role%22:%22%22,%22server_ads%22:true,%22show_ads%22:true,%22subscriber%22:false,%22turbo%22:false,%22user_id%22:59135981,%22user_ip%22:%22187.190.204.225%22,%22version%22:2%7D%22,%22error%22:%22Content+Restricted+In+Region%22,%22error_code%22:%22content_geoblocked%22,%22type%22:%22error%22%7D%5D
03:41:41: 
03:41:41: The above exception was the direct cause of the following exception:
03:41:41: 
03:41:41: Traceback (most recent call last):
03:41:41:   File "utils.py", line 132, in wrapper
03:41:41:   File "twitch.py", line 888, in _watch_loop
03:41:41:   File "channel.py", line 402, in send_watch
03:41:41: exceptions.MinerException

@DevilXD
Copy link
Owner Author

DevilXD commented Oct 27, 2024

That's another "error":"Content+Restricted+In+Region", just like in the linked comment. I'm working on this.

@imranh2
Copy link

imranh2 commented Oct 28, 2024

@DevilXD I implmented a workaround for the geoblock here #593

@DevilXD
Copy link
Owner Author

DevilXD commented Oct 28, 2024

I already have a working "workaround", that emits an error when a case like this is detected. The thing is, apparently I forgot to push it yesterday, when I was testing how it works. Will do so in about an hour or two.

The issue is, that won't solve much. There's currently no way to mark a channel as "unwatchable", as long as it's online and streaming an applicable game. Setting it offline won't work, because the redundant viewers count update logic in the miner will set it back online a few minutes later. I'll need to think about implementing a way to do that later on, but for now, the change I'll soon push will simply make the miner at least not crash in cases like this.

@DevilXD
Copy link
Owner Author

DevilXD commented Oct 28, 2024

3b4923a has been put in place to turn this issue into a non-fatal error, but an error nonetheless. The next logical step would be to implement a way for the miner to detect and mark a stream as "unwatchable", or "not possible to watch", due to various reasons (like the geo-blocking / "content restricted in region" in this case).

It sounds as something relatively simple to do, but at the same time, not really. This is because properly detecting a geo-blocked stream would require me having access to one, which I currently do not have, nor can find. Twitch search specifically won't show me geo-blocked streams: https://help.twitch.tv/s/article/how-does-search-work?language=en_US#whyresults

My only bet would be for someone else to supply me with a link or channel name to a geo-blocked stream. For now though, I've managed to find this website, that lists banned streamer accounts/channels: https://streamerbans.com/streamers?page=1&banStatus=banned I'll try using that to do the testing instead.

@jordyamc
Copy link

jordyamc commented Oct 30, 2024

I read that some Korean streams using content from Korean bands are sometimes geo-blocked to korea

In my case the miner was trying to watch this channel multiversus that is geo-blocked to USA only

But I don't know if it was only blocked during that stream for the drops or all of the streams are blocked

@DevilXD
Copy link
Owner Author

DevilXD commented Oct 30, 2024

I see, thank you. I'll keep an eye on the channel to see if I can catch it streaming the geo-blocked stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants