Skip to content

plugins.huya: fix 403 error #6058

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

Merged
merged 5 commits into from
Jul 3, 2024
Merged

plugins.huya: fix 403 error #6058

merged 5 commits into from
Jul 3, 2024

Conversation

v2wy
Copy link
Contributor

@v2wy v2wy commented Jul 2, 2024

Resolves #5487

test url: https://www.huya.com/majiajia

python.exe -m src.streamlink_cli -j https://www.huya.com/majiajia

{
  "plugin": "huya",
  "metadata": {
    "id": "7386883739648295431",
    "author": "\u5fae\u7ade\u4e36\u838e\u8389",
    "category": null,
    "title": ""
  },
  "streams": {
    "al_500": {
      "type": "http",
      "method": "GET",
      "url": "http://al.flv.huya.com/src/813535483-813535483-3494108293620563968-1627194422-10057-A-0-1-imgplus.flv?wsSecret=91d3e6752a2cb8460f43d740d6a96a3b&wsTime=6683bf16&ctype=huya_live&fs=bgct&seqid=1719922522577&ver=1&u=3161081088&t=100&sv=2401090219&sdk_sid=1719910174604&codec=264&ratio=500",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive",
        "Origin": "https://www.huya.com",
        "Referer": "https://www.huya.com/"
      },
      "body": null
    },
    "tx_500": {
      "type": "http",
      "method": "GET",
      "url": "http://tx.flv.huya.com/src/813535483-813535483-3494108293620563968-1627194422-10057-A-0-1-imgplus.flv?wsSecret=f20f471c0f1f15f89f80add9a1c9e4f0&wsTime=6683bf16&ctype=huya_live&fs=bgct&seqid=1719922523540&ver=1&u=3161327616&t=100&sv=2401090219&sdk_sid=1719910174604&codec=264&ratio=500",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive",
        "Origin": "https://www.huya.com",
        "Referer": "https://www.huya.com/"
      },
      "body": null
    },
    "hw_500": {
      "type": "http",
      "method": "GET",
      "url": "http://hw.flv.huya.com/src/813535483-813535483-3494108293620563968-1627194422-10057-A-0-1-imgplus.flv?wsSecret=5b1749294586a7706dc949ae05f4b855&wsTime=6683bf16&ctype=huya_live&fs=bgct&seqid=1719922519677&ver=1&u=3160338432&t=100&sv=2401090219&sdk_sid=1719910174605&codec=264&ratio=500",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive",
        "Origin": "https://www.huya.com",
        "Referer": "https://www.huya.com/"
      },
      "body": null
    },
    "hs_500": {
      "type": "http",
      "method": "GET",
      "url": "http://hs.flv.huya.com/src/813535483-813535483-3494108293620563968-1627194422-10057-A-0-1-imgplus.flv?wsSecret=201b1dc1d936aa0c4c06f254c9d36fe1&wsTime=6683bf16&ctype=huya_live&fs=bgct&seqid=1719922518272&ver=1&u=3159978752&t=100&sv=2401090219&sdk_sid=1719910174605&codec=264&ratio=500",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive",
        "Origin": "https://www.huya.com",
        "Referer": "https://www.huya.com/"
      },
      "body": null
    },
    "hy_500": {
      "type": "http",
      "method": "GET",
      "url": "http://qvodlive-va.huya.com/src/813535483-813535483-3494108293620563968-1627194422-10057-A-0-1-imgplus.flv?wsSecret=aa0bc14175c21fe227c0f34390857a36&wsTime=6683bf16&ctype=huya_live&fs=bgct&seqid=1719922518568&ver=1&u=3160054528&t=100&sv=2401090219&sdk_sid=1719910174605&codec=264&ratio=500",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive",
        "Origin": "https://www.huya.com",
        "Referer": "https://www.huya.com/"
      },
      "body": null
    },
    "al_2000": {
      "type": "http",
      "method": "GET",
      "url": "http://al.flv.huya.com/src/813535483-813535483-3494108293620563968-1627194422-10057-A-0-1-imgplus.flv?wsSecret=dc8155506b9429a45e6769ec9cc31e98&wsTime=6683bf16&ctype=huya_live&fs=bgct&seqid=1719922524153&ver=1&u=3161484544&t=100&sv=2401090219&sdk_sid=1719910174604&codec=264&ratio=2000",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive",
        "Origin": "https://www.huya.com",
        "Referer": "https://www.huya.com/"
      },
      "body": null
    },
    "tx_2000": {
      "type": "http",
      "method": "GET",
      "url": "http://tx.flv.huya.com/src/813535483-813535483-3494108293620563968-1627194422-10057-A-0-1-imgplus.flv?wsSecret=081168d115ba76230783999413edf997&wsTime=6683bf16&ctype=huya_live&fs=bgct&seqid=1719922517577&ver=1&u=3159801088&t=100&sv=2401090219&sdk_sid=1719910174604&codec=264&ratio=2000",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive",
        "Origin": "https://www.huya.com",
        "Referer": "https://www.huya.com/"
      },
      "body": null
    },
    "hw_2000": {
      "type": "http",
      "method": "GET",
      "url": "http://hw.flv.huya.com/src/813535483-813535483-3494108293620563968-1627194422-10057-A-0-1-imgplus.flv?wsSecret=038ce5f0e61e9be32044feecd1b1d6bd&wsTime=6683bf16&ctype=huya_live&fs=bgct&seqid=1719922520210&ver=1&u=3160474880&t=100&sv=2401090219&sdk_sid=1719910174605&codec=264&ratio=2000",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive",
        "Origin": "https://www.huya.com",
        "Referer": "https://www.huya.com/"
      },
      "body": null
    },
    "hs_2000": {
      "type": "http",
      "method": "GET",
      "url": "http://hs.flv.huya.com/src/813535483-813535483-3494108293620563968-1627194422-10057-A-0-1-imgplus.flv?wsSecret=53ecbf1d74e2a35e0c456405f6599313&wsTime=6683bf16&ctype=huya_live&fs=bgct&seqid=1719922523316&ver=1&u=3161270016&t=100&sv=2401090219&sdk_sid=1719910174605&codec=264&ratio=2000",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive",
        "Origin": "https://www.huya.com",
        "Referer": "https://www.huya.com/"
      },
      "body": null
    },
    "hy_2000": {
      "type": "http",
      "method": "GET",
      "url": "http://qvodlive-va.huya.com/src/813535483-813535483-3494108293620563968-1627194422-10057-A-0-1-imgplus.flv?wsSecret=3550477b574c9687e90c5c3ae6bad196&wsTime=6683bf16&ctype=huya_live&fs=bgct&seqid=1719922516164&ver=1&u=3159439104&t=100&sv=2401090219&sdk_sid=1719910174605&codec=264&ratio=2000",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive",
        "Origin": "https://www.huya.com",
        "Referer": "https://www.huya.com/"
      },
      "body": null
    },
    "al_4000": {
      "type": "http",
      "method": "GET",
      "url": "http://al.flv.huya.com/src/813535483-813535483-3494108293620563968-1627194422-10057-A-0-1-imgplus.flv?wsSecret=9f9c1b9f72575e5405be49697cd3a247&wsTime=6683bf16&ctype=huya_live&fs=bgct&seqid=1719922518413&ver=1&u=3160015104&t=100&sv=2401090219&sdk_sid=1719910174604&codec=264&ratio=4000",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive",
        "Origin": "https://www.huya.com",
        "Referer": "https://www.huya.com/"
      },
      "body": null
    },
    "tx_4000": {
      "type": "http",
      "method": "GET",
      "url": "http://tx.flv.huya.com/src/813535483-813535483-3494108293620563968-1627194422-10057-A-0-1-imgplus.flv?wsSecret=ecda22b71852b4ecb77cdd14d52c5b13&wsTime=6683bf16&ctype=huya_live&fs=bgct&seqid=1719922520231&ver=1&u=3160480512&t=100&sv=2401090219&sdk_sid=1719910174604&codec=264&ratio=4000",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive",
        "Origin": "https://www.huya.com",
        "Referer": "https://www.huya.com/"
      },
      "body": null
    },
    "hw_4000": {
      "type": "http",
      "method": "GET",
      "url": "http://hw.flv.huya.com/src/813535483-813535483-3494108293620563968-1627194422-10057-A-0-1-imgplus.flv?wsSecret=1e618b2231540eda69fe9e5bb3ca0322&wsTime=6683bf16&ctype=huya_live&fs=bgct&seqid=1719922523917&ver=1&u=3161423872&t=100&sv=2401090219&sdk_sid=1719910174605&codec=264&ratio=4000",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive",
        "Origin": "https://www.huya.com",
        "Referer": "https://www.huya.com/"
      },
      "body": null
    },
    "hs_4000": {
      "type": "http",
      "method": "GET",
      "url": "http://hs.flv.huya.com/src/813535483-813535483-3494108293620563968-1627194422-10057-A-0-1-imgplus.flv?wsSecret=ef4c48332b1cc5f9096de7af311158a1&wsTime=6683bf16&ctype=huya_live&fs=bgct&seqid=1719922519685&ver=1&u=3160340480&t=100&sv=2401090219&sdk_sid=1719910174605&codec=264&ratio=4000",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive",
        "Origin": "https://www.huya.com",
        "Referer": "https://www.huya.com/"
      },
      "body": null
    },
    "hy_4000": {
      "type": "http",
      "method": "GET",
      "url": "http://qvodlive-va.huya.com/src/813535483-813535483-3494108293620563968-1627194422-10057-A-0-1-imgplus.flv?wsSecret=c75ba20ca12a5f4b7e7592d5323f732d&wsTime=6683bf16&ctype=huya_live&fs=bgct&seqid=1719922520575&ver=1&u=3160568320&t=100&sv=2401090219&sdk_sid=1719910174605&codec=264&ratio=4000",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive",
        "Origin": "https://www.huya.com",
        "Referer": "https://www.huya.com/"
      },
      "body": null
    },
    "al_0": {
      "type": "http",
      "method": "GET",
      "url": "http://al.flv.huya.com/src/813535483-813535483-3494108293620563968-1627194422-10057-A-0-1-imgplus.flv?wsSecret=55327194d6df8d1fbfd764869db7b19c&wsTime=6683bf16&ctype=huya_live&fs=bgct&seqid=1719922518896&ver=1&u=3160138752&t=100&sv=2401090219&sdk_sid=1719910174604&codec=264&ratio=0",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive",
        "Origin": "https://www.huya.com",
        "Referer": "https://www.huya.com/"
      },
      "body": null
    },
    "tx_0": {
      "type": "http",
      "method": "GET",
      "url": "http://tx.flv.huya.com/src/813535483-813535483-3494108293620563968-1627194422-10057-A-0-1-imgplus.flv?wsSecret=7e44f79c92951243ea50f7512e335142&wsTime=6683bf16&ctype=huya_live&fs=bgct&seqid=1719922515702&ver=1&u=3159321088&t=100&sv=2401090219&sdk_sid=1719910174604&codec=264&ratio=0",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive",
        "Origin": "https://www.huya.com",
        "Referer": "https://www.huya.com/"
      },
      "body": null
    },
    "hw_0": {
      "type": "http",
      "method": "GET",
      "url": "http://hw.flv.huya.com/src/813535483-813535483-3494108293620563968-1627194422-10057-A-0-1-imgplus.flv?wsSecret=7564a7b919c488264aba39cdd638ba33&wsTime=6683bf16&ctype=huya_live&fs=bgct&seqid=1719922517475&ver=1&u=3159774976&t=100&sv=2401090219&sdk_sid=1719910174605&codec=264&ratio=0",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive",
        "Origin": "https://www.huya.com",
        "Referer": "https://www.huya.com/"
      },
      "body": null
    },
    "hs_0": {
      "type": "http",
      "method": "GET",
      "url": "http://hs.flv.huya.com/src/813535483-813535483-3494108293620563968-1627194422-10057-A-0-1-imgplus.flv?wsSecret=91b203a8ca40c7acb814ae0362ed5122&wsTime=6683bf16&ctype=huya_live&fs=bgct&seqid=1719922522879&ver=1&u=3161158144&t=100&sv=2401090219&sdk_sid=1719910174605&codec=264&ratio=0",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive",
        "Origin": "https://www.huya.com",
        "Referer": "https://www.huya.com/"
      },
      "body": null
    },
    "hy_0": {
      "type": "http",
      "method": "GET",
      "url": "http://qvodlive-va.huya.com/src/813535483-813535483-3494108293620563968-1627194422-10057-A-0-1-imgplus.flv?wsSecret=e74d1d96ea3dd41034d69d19ad1c25df&wsTime=6683bf16&ctype=huya_live&fs=bgct&seqid=1719922519321&ver=1&u=3160247296&t=100&sv=2401090219&sdk_sid=1719910174605&codec=264&ratio=0",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive",
        "Origin": "https://www.huya.com",
        "Referer": "https://www.huya.com/"
      },
      "body": null
    },
    "worst": {
      "type": "http",
      "method": "GET",
      "url": "http://al.flv.huya.com/src/813535483-813535483-3494108293620563968-1627194422-10057-A-0-1-imgplus.flv?wsSecret=91d3e6752a2cb8460f43d740d6a96a3b&wsTime=6683bf16&ctype=huya_live&fs=bgct&seqid=1719922522577&ver=1&u=3161081088&t=100&sv=2401090219&sdk_sid=1719910174604&codec=264&ratio=500",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive",
        "Origin": "https://www.huya.com",
        "Referer": "https://www.huya.com/"
      },
      "body": null
    },
    "best": {
      "type": "http",
      "method": "GET",
      "url": "http://qvodlive-va.huya.com/src/813535483-813535483-3494108293620563968-1627194422-10057-A-0-1-imgplus.flv?wsSecret=e74d1d96ea3dd41034d69d19ad1c25df&wsTime=6683bf16&ctype=huya_live&fs=bgct&seqid=1719922519321&ver=1&u=3160247296&t=100&sv=2401090219&sdk_sid=1719910174605&codec=264&ratio=0",
      "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "Accept-Encoding": "gzip, deflate",
        "Accept": "*/*",
        "Connection": "keep-alive",
        "Origin": "https://www.huya.com",
        "Referer": "https://www.huya.com/"
      },
      "body": null
    }
  }
}

@v2wy v2wy mentioned this pull request Jul 2, 2024
4 tasks
@mkbloke mkbloke changed the title fix huya plugins.huya: fix 403 error Jul 2, 2024
@bastimeyer bastimeyer added the plugin issue A Plugin does not work correctly label Jul 2, 2024
Copy link
Member

@bastimeyer bastimeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

I've had a quick look at the changes, and the plugin fixes seemed to work. There are a few things which require an update though.

Before any of the plugin fixes can be merged though, all the linting issues will have to be fixed first.

Copy link
Member

@bastimeyer bastimeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is much better now, but still requires some changes.

Also please don't forget to fix the linting issues (double-quotes for strings, commas, etc.):
https://github.com/streamlink/streamlink/actions/runs/9763170863/job/26952954913?pr=6058

@bastimeyer
Copy link
Member

bastimeyer commented Jul 2, 2024

403 Client Error

$ streamlink -l debug https://www.huya.com/fukua tx_source
[cli][debug] OS:         Linux-6.9.7-1-git-x86_64-with-glibc2.39
[cli][debug] Python:     3.12.4
[cli][debug] OpenSSL:    OpenSSL 3.3.1 4 Jun 2024
[cli][debug] Streamlink: 6.8.1+12.g2d835e5e
[cli][debug] Dependencies:
[cli][debug]  certifi: 2024.6.2
[cli][debug]  isodate: 0.6.1
[cli][debug]  lxml: 5.2.2
[cli][debug]  pycountry: 24.6.1
[cli][debug]  pycryptodome: 3.20.0
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.32.3
[cli][debug]  trio: 0.25.1
[cli][debug]  trio-websocket: 0.11.1
[cli][debug]  typing-extensions: 4.12.2
[cli][debug]  urllib3: 2.2.2
[cli][debug]  websocket-client: 1.8.0
[cli][debug] Arguments:
[cli][debug]  url=https://www.huya.com/fukua
[cli][debug]  stream=['tx_source']
[cli][debug]  --loglevel=debug
[cli][debug]  --player=/usr/bin/mpv
[cli][info] Found matching plugin huya for URL https://www.huya.com/fukua
[plugins.huya][debug] QUALITY_WEIGHTS: {'al_source': 9223372036854775807, 'al_8000k': 8000, 'al_4000k': 4000, 'al_2000k': 2000, 'al_500k': 500, 'tx_source': 9223372036854775807, 'tx_8000k': 8000, 'tx_4000k': 4000, 'tx_2000k': 2000, 'tx_500k': 500, 'hw_source': 9223372036854775807, 'hw_8000k': 8000, 'hw_4000k': 4000, 'hw_2000k': 2000, 'hw_500k': 500, 'hs_source': 9223372036854775807, 'hs_8000k': 8000, 'hs_4000k': 4000, 'hs_2000k': 2000, 'hs_500k': 500, 'hy_source': 9223372036854775807, 'hy_8000k': 8000, 'hy_4000k': 4000, 'hy_2000k': 2000, 'hy_500k': 500}
[cli][info] Available streams: al_500k (worst), tx_500k, hw_500k, hs_500k, hy_500k, al_2000k, tx_2000k, hw_2000k, hs_2000k, hy_2000k, al_4000k, tx_4000k, hw_4000k, hs_4000k, hy_4000k, al_8000k, tx_8000k, hw_8000k, hs_8000k, hy_8000k, al_source, tx_source, hw_source, hs_source, hy_source (best)
[cli][info] Opening stream: tx_source (http)
[cli][info] Starting player: /usr/bin/mpv
[cli][error] Try 1/1: Could not open stream <HTTPStream ['http', 'https://tx.flv.huya.com/src/3696254-3696254-15875290047709184-7515964-10057-A-0-1-imgplus.flv?wsSecret=b850db928c03d65ef3249619f5967dbe&wsTime=6684520d&ctype=huya_live&fs=bgct&seqid=1719960134927&u=3160372224&sdk_sid=1719947789723&ratio=0&platform_id=100&ver=1&sv=2401090219&codec=264']> (Could not open stream: Unable to open URL: https://tx.flv.huya.com/src/3696254-3696254-15875290047709184-7515964-10057-A-0-1-imgplus.flv (403 Client Error: Forbidden for url: https://tx.flv.huya.com/src/3696254-3696254-15875290047709184-7515964-10057-A-0-1-imgplus.flv?wsSecret=b850db928c03d65ef3249619f5967dbe&wsTime=6684520d&ctype=huya_live&fs=bgct&seqid=1719960134927&u=3160372224&sdk_sid=1719947789723&ratio=0&platform_id=100&ver=1&sv=2401090219&codec=264))
error: Could not open stream <HTTPStream ['http', 'https://tx.flv.huya.com/src/3696254-3696254-15875290047709184-7515964-10057-A-0-1-imgplus.flv?wsSecret=b850db928c03d65ef3249619f5967dbe&wsTime=6684520d&ctype=huya_live&fs=bgct&seqid=1719960134927&u=3160372224&sdk_sid=1719947789723&ratio=0&platform_id=100&ver=1&sv=2401090219&codec=264']>, tried 1 times, exiting

@v2wy
Copy link
Contributor Author

v2wy commented Jul 3, 2024

403 Client Error

$ streamlink -l debug https://www.huya.com/fukua tx_source
[cli][debug] OS:         Linux-6.9.7-1-git-x86_64-with-glibc2.39
[cli][debug] Python:     3.12.4
[cli][debug] OpenSSL:    OpenSSL 3.3.1 4 Jun 2024
[cli][debug] Streamlink: 6.8.1+12.g2d835e5e
[cli][debug] Dependencies:
[cli][debug]  certifi: 2024.6.2
[cli][debug]  isodate: 0.6.1
[cli][debug]  lxml: 5.2.2
[cli][debug]  pycountry: 24.6.1
[cli][debug]  pycryptodome: 3.20.0
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.32.3
[cli][debug]  trio: 0.25.1
[cli][debug]  trio-websocket: 0.11.1
[cli][debug]  typing-extensions: 4.12.2
[cli][debug]  urllib3: 2.2.2
[cli][debug]  websocket-client: 1.8.0
[cli][debug] Arguments:
[cli][debug]  url=https://www.huya.com/fukua
[cli][debug]  stream=['tx_source']
[cli][debug]  --loglevel=debug
[cli][debug]  --player=/usr/bin/mpv
[cli][info] Found matching plugin huya for URL https://www.huya.com/fukua
[plugins.huya][debug] QUALITY_WEIGHTS: {'al_source': 9223372036854775807, 'al_8000k': 8000, 'al_4000k': 4000, 'al_2000k': 2000, 'al_500k': 500, 'tx_source': 9223372036854775807, 'tx_8000k': 8000, 'tx_4000k': 4000, 'tx_2000k': 2000, 'tx_500k': 500, 'hw_source': 9223372036854775807, 'hw_8000k': 8000, 'hw_4000k': 4000, 'hw_2000k': 2000, 'hw_500k': 500, 'hs_source': 9223372036854775807, 'hs_8000k': 8000, 'hs_4000k': 4000, 'hs_2000k': 2000, 'hs_500k': 500, 'hy_source': 9223372036854775807, 'hy_8000k': 8000, 'hy_4000k': 4000, 'hy_2000k': 2000, 'hy_500k': 500}
[cli][info] Available streams: al_500k (worst), tx_500k, hw_500k, hs_500k, hy_500k, al_2000k, tx_2000k, hw_2000k, hs_2000k, hy_2000k, al_4000k, tx_4000k, hw_4000k, hs_4000k, hy_4000k, al_8000k, tx_8000k, hw_8000k, hs_8000k, hy_8000k, al_source, tx_source, hw_source, hs_source, hy_source (best)
[cli][info] Opening stream: tx_source (http)
[cli][info] Starting player: /usr/bin/mpv
[cli][error] Try 1/1: Could not open stream <HTTPStream ['http', 'https://tx.flv.huya.com/src/3696254-3696254-15875290047709184-7515964-10057-A-0-1-imgplus.flv?wsSecret=b850db928c03d65ef3249619f5967dbe&wsTime=6684520d&ctype=huya_live&fs=bgct&seqid=1719960134927&u=3160372224&sdk_sid=1719947789723&ratio=0&platform_id=100&ver=1&sv=2401090219&codec=264']> (Could not open stream: Unable to open URL: https://tx.flv.huya.com/src/3696254-3696254-15875290047709184-7515964-10057-A-0-1-imgplus.flv (403 Client Error: Forbidden for url: https://tx.flv.huya.com/src/3696254-3696254-15875290047709184-7515964-10057-A-0-1-imgplus.flv?wsSecret=b850db928c03d65ef3249619f5967dbe&wsTime=6684520d&ctype=huya_live&fs=bgct&seqid=1719960134927&u=3160372224&sdk_sid=1719947789723&ratio=0&platform_id=100&ver=1&sv=2401090219&codec=264))
error: Could not open stream <HTTPStream ['http', 'https://tx.flv.huya.com/src/3696254-3696254-15875290047709184-7515964-10057-A-0-1-imgplus.flv?wsSecret=b850db928c03d65ef3249619f5967dbe&wsTime=6684520d&ctype=huya_live&fs=bgct&seqid=1719960134927&u=3160372224&sdk_sid=1719947789723&ratio=0&platform_id=100&ver=1&sv=2401090219&codec=264']>, tried 1 times, exiting

Sorry, I got the parameter name wrong. I have fixed the issue.

@bastimeyer bastimeyer added the PR: squash commits Commits need to be squashed as a single commit - eg. multiple commits for a single component label Jul 3, 2024
@bastimeyer bastimeyer merged commit 6d953ef into streamlink:master Jul 3, 2024
23 checks passed
@bastimeyer
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin issue A Plugin does not work correctly PR: squash commits Commits need to be squashed as a single commit - eg. multiple commits for a single component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

plugins.huya: stream not opening
2 participants