Skip to content

plugins.huya: rewrite and fix plugin #4685

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 1 commit into from
Jul 29, 2022

Conversation

bastimeyer
Copy link
Member

Resolves #4684

I've once again tried adding HLSStreams instead of having the plugin yield progressive HTTPStreams (see #4609 (comment)), but to no luck. Server response 403 using the same URL logic as the HTTP "FLV" streams.

The issue from the report in #4684 was stream data sometimes not being base64 encoded, so a different regex and validation logic was needed. Because of this, I rewrote and cleaned up the entire plugin in one go, and also added stream metadata.

$ streamlink -l debug 'https://www.huya.com/688062'
[cli][debug] OS:         Linux-5.18.14-1-git-x86_64-with-glibc2.35
[cli][debug] Python:     3.10.5
[cli][debug] Streamlink: 4.2.0+26.gad51118e
[cli][debug] Dependencies:
[cli][debug]  isodate: 0.6.1
[cli][debug]  lxml: 4.9.0
[cli][debug]  pycountry: 22.3.5
[cli][debug]  pycryptodome: 3.14.1
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.28.1
[cli][debug]  websocket-client: 1.3.2
[cli][debug] Arguments:
[cli][debug]  url=https://www.huya.com/688062
[cli][debug]  --loglevel=debug
[cli][debug]  --player=mpv
[cli][info] Found matching plugin huya for URL https://www.huya.com/688062
[plugins.huya][debug] QUALITY_WEIGHTS: {'source_ws': 100, 'source_al': 0, 'source_tx': -1, 'source_hw': -1, 'source_bd': -1}
Available streams: source_tx (worst), source_hw, source_bd, source_al, source_ws (best)
$ streamlink -l debug 'https://www.huya.com/dongerlol'
[cli][debug] OS:         Linux-5.18.14-1-git-x86_64-with-glibc2.35
[cli][debug] Python:     3.10.5
[cli][debug] Streamlink: 4.2.0+26.gad51118e
[cli][debug] Dependencies:
[cli][debug]  isodate: 0.6.1
[cli][debug]  lxml: 4.9.0
[cli][debug]  pycountry: 22.3.5
[cli][debug]  pycryptodome: 3.14.1
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.28.1
[cli][debug]  websocket-client: 1.3.2
[cli][debug] Arguments:
[cli][debug]  url=https://www.huya.com/dongerlol
[cli][debug]  --loglevel=debug
[cli][debug]  --player=mpv
[cli][info] Found matching plugin huya for URL https://www.huya.com/dongerlol
[plugins.huya][debug] QUALITY_WEIGHTS: {'source_al': 0, 'source_tx': -1, 'source_hw': -1, 'source_bd': 100}
Available streams: source_tx (worst), source_hw, source_al, source_bd (best)

@bastimeyer bastimeyer added the plugin issue A Plugin does not work correctly label Jul 29, 2022
@gravyboat gravyboat merged commit b8e5f27 into streamlink:master Jul 29, 2022
@bastimeyer bastimeyer deleted the plugins/huya/rewrite branch July 29, 2022 19:18
@OdinTemple
Copy link

Do I need to wait until the next version to release? or does the modification effect already?(If the plugin is always got from remote resource) Becaust I still can't use it:

X:>streamlink -l debug https://www.huya.com/676673
[cli][debug] OS: Windows 10
[cli][debug] Python: 3.8.3
[cli][debug] Streamlink: 4.2.0
[cli][debug] Dependencies:
[cli][debug] isodate: 0.6.0
[cli][debug] lxml: 4.9.1
[cli][debug] pycountry: 22.3.5
[cli][debug] pycryptodome: 3.10.1
[cli][debug] PySocks: 1.7.1
[cli][debug] requests: 2.28.1
[cli][debug] websocket-client: 1.3.3
[cli][debug] Arguments:
[cli][debug] url=https://www.huya.com/676673
[cli][debug] --loglevel=debug
[cli][info] Found matching plugin huya for URL https://www.huya.com/676673
error: No playable streams found on this URL: https://www.huya.com/676673

@bastimeyer
Copy link
Member Author

bastimeyer commented Aug 1, 2022

[cli][debug] Streamlink: 4.2.0

If the plugin is always got from remote resource

No, what makes you think that it would? That would be stupid...

Install from the master branch if you don't want to wait for the next release (see the Windows nightly builds).
https://streamlink.github.io/latest/install.html

Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request Aug 3, 2022
- fix py2 int validation if value is of type long
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

huya live not work
3 participants