-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
plugins.goodgame: rewrite using API #5586
plugins.goodgame: rewrite using API #5586
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved pending verification by issue reporter.
Hi, everything looks great, most streams are working fine. However, I've found some unexpected problems. As for the errors:
|
This is done via
While curl ignores the percent-encoding (check with $ curl -Is --http1.1 'https://goodgame.ru/channel/osbvmt%7CVitaTV' | head -n1
HTTP/1.1 404 not found
$ curl -Is --http1.1 'https://goodgame.ru/channel/osbvmt|VitaTV' | head -n1
HTTP/1.1 200 OK Web browsers like Chromium for example follow RFC 3986 correctly, whereas Firefox does not: >>> (await fetch("https://goodgame.ru/channel/osbvmt%7CVitaTV")).status
404
>>> (await fetch("https://goodgame.ru/channel/osbvmt|VitaTV")).status
404 Since there is no control over how urllib3 encodes the URL path, this channel is simply not accessible. They need to fix their server/API and compare the channel name from the URL's path after percent-decoding it.
Use a Python debugger. Streamlink CLI does only handle output streams of the
That channel is offline. You must've checked this while it was going offline. I don't see any issues here. The plugin simply checks the |
3362ba4
to
8041c49
Compare
I've sent an email to support, they will probably fix this problem because it's not just the API problem. The website has the same problem.
It was online at that moment, but it only has a twitch player. Other twitch players
It seems that Sometimes this can be a bit weird. The stream is online, but there are no players. https://goodgame.ru/channel/Starsky_TV/{
"id": 76832,
"key": "Starsky_TV",
"preview": "https://hls.goodgame.ru/previews/76832_240.jpg",
"title": "Комментатор в деле (Starsky stream)",
"viewers": 0,
"streamer": {
"id": 740896,
"obj_key": "9:740896",
"nickname": "Starsky_TV",
"username": "Starsky_TV",
"avatar": "https://goodgame.ru//files/avatars/av_avatar_hum.png",
"premium": false,
"banned": false
},
"streamKey": "76832",
"online": true,
"game": {
"id": 55788,
"title": "Playerunknown's Battlegrounds",
"url": "/games/playerunknowns-battlegrounds"
},
"poster": "https://goodgame.ru/files/logotypes/ch_76832_ODnM_logo.png",
"hidden": false,
"adult": false,
"link": "https://goodgame.ru/channel/Starsky_TV/",
"premium": false,
"players": [],
"watchTogether": false,
"premiums": 0,
"followers": 19,
"rating": {
"value": 0,
"place": 0
}
} I wonder if the right solution would be to iterate over the players of the channel and select the first one that is online. |
8041c49
to
edc3436
Compare
edc3436
to
7efe147
Compare
I've removed the status check of the embedded players. It now only checks the embedded player's Embedded players also get checked when the channel's This should cover all the cases. Online channels, offline channels and offline channels with embedded players. |
LGTM! |
Thanks for checking! |
Fixes #5581
Fixes #5585
Fixes #5584
Fixes #5583
@IosifShmidt
Please check and verify.
https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md#pull-request-feedback
This now queries their API instead of finding the data in the page's embedded JSON.
However, URLs using the plugin's default matcher without the
/channel/
prefix appear to not have an API endpoint for querying the channel key, so it still needs to be acquired from the embedded JSON.https://goodgame.ru/html/api4docs/index.html
That should work fine though:
Game metadata can either be a string or
null
. This wasn't obvious in the recent plugin changes. Both the game metadata and stream title metadata are now treated as optional.The game title metadata now however is nested in another
game
object, so it's possible that the entiregame
object can becomenull
instead ofgame.title
. This needs to be verified first, otherwise we'll have anotherValidationError
.The player URL is now supported.
Twitch redirection should now be supported unless I'm mistaken about the
status
andonline
flags in the API response. Both need to be true for the plugin to redirect to Twitch instead of trying to access the goodgame HLS URL. Theonline
field is self-explanatory and to my understanding,status
is true if the user has activated the Twitch player on their goodgame channel. Is that right?I couldn't find any live channels with a Twitch player.
The old stream quality weights have been removed, since the player page revealed the URL of the HLS multivariant playlist. The quality weights were needed because of the individual media playlist URLs which were embedded in the JSON data previously.