streamlink / streamlink-twitch-gui

A multi platform Twitch.tv browser for Streamlink
https://streamlink.github.io/streamlink-twitch-gui/
MIT License
2.69k stars 203 forks source link

Separate lang flag between China and Taiwan #864

Closed dxball closed 2 years ago

dxball commented 2 years ago

Checklist

Description

I've update Streamlink Twitch GUI to v2.0.0 I noticed that all Taiwan streamer's lang flag on top left corner have become CN flag, which should be TW.

Is there any chance to correct the flag?

Wrong flag image

Correct flag image

bastimeyer commented 2 years ago

This is just the data which Twitch provides. The 2.0.0 release hasn't changed anything in regards to the flags logic.

As you can see in the following two example API responses (/helix/streams and /helix/channels), the language and broadcaster_language attributes are both set to zh instead of zh-tw.

There is nothing that can be done here. You will have to report this to Twitch and tell them that their helix API sucks.

curl 'https://api.twitch.tv/helix/streams?user_id=11561802' \
  -H 'authorization: Bearer OAUTH_TOKEN' \
  -H 'client-id: phiay4sq36lfv9zu7cbqwz2ndnesfd8'
{
    "data": [
        {
            "id": "40502048875",
            "user_id": "11561802",
            "user_login": "godjj",
            "user_name": "接接",
            "game_id": "1833694612",
            "game_name": "Vampire Survivors",
            "type": "live",
            "title": "【J群玩家 GodJJ】全圖鑑大師  J群玩家YT每天上新片 ",
            "viewer_count": 5572,
            "started_at": "2022-02-03T12:37:24Z",
            "language": "zh",
            "thumbnail_url": "https://static-cdn.jtvnw.net/previews-ttv/live_user_godjj-{width}x{height}.jpg",
            "tag_ids": [
                "74c92063-a389-4fd2-8460-b1bb82b04ec7"
            ],
            "is_mature": false
        }
    ],
    "pagination": { }
}
curl 'https://api.twitch.tv/helix/channels?broadcaster_id=11561802' \
  -H 'authorization: Bearer OAUTH_TOKEN' \
  -H 'client-id: phiay4sq36lfv9zu7cbqwz2ndnesfd8'
{
    "data": [
        {
            "broadcaster_id": "11561802",
            "broadcaster_login": "godjj",
            "broadcaster_name": "接接",
            "broadcaster_language": "zh",
            "game_id": "1833694612",
            "game_name": "Vampire Survivors",
            "title": "【J群玩家 GodJJ】全圖鑑大師  J群玩家YT每天上新片 ",
            "delay": 0
        }
    ]
}
bastimeyer commented 2 years ago

Btw, here's the /kraken/streams query for comparison. stream.channel.broadcaster_language is set to zh and stream.channel.language is set to zh-tw:

curl 'https://api.twitch.tv/kraken/streams/11561802' \
  -H 'accept: application/vnd.twitchtv.v5+json' \
  -H 'client-id: phiay4sq36lfv9zu7cbqwz2ndnesfd8'
{
    "stream": {
        "_id": 40502048875,
        "game": "Vampire Survivors",
        "broadcast_platform": "live",
        "community_id": "",
        "community_ids": [],
        "viewers": 5985,
        "video_height": 1080,
        "average_fps": 60,
        "delay": 0,
        "created_at": "2022-02-03T12:37:24Z",
        "is_playlist": false,
        "stream_type": "live",
        "preview": {
            "small": "https://static-cdn.jtvnw.net/previews-ttv/live_user_godjj-80x45.jpg",
            "medium": "https://static-cdn.jtvnw.net/previews-ttv/live_user_godjj-320x180.jpg",
            "large": "https://static-cdn.jtvnw.net/previews-ttv/live_user_godjj-640x360.jpg",
            "template": "https://static-cdn.jtvnw.net/previews-ttv/live_user_godjj-{width}x{height}.jpg"
        },
        "channel": {
            "mature": false,
            "status": "【J群玩家 GodJJ】全圖鑑大師  J群玩家YT每天上新片 ",
            "broadcaster_language": "zh",
            "broadcaster_software": "",
            "display_name": "接接",
            "game": "Vampire Survivors",
            "language": "zh-tw",
            "_id": 11561802,
            "name": "godjj",
            "created_at": "2010-04-03T06:11:04.052464Z",
            "updated_at": "2022-02-03T18:28:02.382701Z",
            "partner": true,
            "logo": "https://static-cdn.jtvnw.net/jtv_user_pictures/godjj-profile_image-73e3a1dc1807a3ec-300x300.jpeg",
            "video_banner": "https://static-cdn.jtvnw.net/jtv_user_pictures/d63f0494-8fd2-4e3f-9623-f7ff17c0f70e-channel_offline_image-1920x1080.jpeg",
            "profile_banner": "https://static-cdn.jtvnw.net/jtv_user_pictures/a717b7d2-9e5b-40c0-bde1-edca2d54498a-profile_banner-480.png",
            "profile_banner_background_color": "",
            "url": "https://www.twitch.tv/godjj",
            "views": 145492775,
            "followers": 358267,
            "broadcaster_type": "",
            "description": "我是GodJJ,前LOL職業選手,現在是魔競旗下的實況主。主要實況LOL和各種小遊戲。號稱最有原則的實況主:絕不S(頭)L(痛)、絕不偷看攻略、絕不開金手指。快點來加入我的鴨子大軍吧!啾咪!",
            "private_video": false,
            "privacy_options_enabled": false
        }
    }
}
bastimeyer commented 2 years ago

I'm closing this, as there's nothing that can be done here.

Please open a bug report here with the API responses I've posted if the issue still hasn't been fixed by Twitch: https://github.com/twitchdev/issues/issues