-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
plugins.twitcasting: rewrite plugin #5255
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.twitcasting: rewrite plugin #5255
Conversation
|
Was testing on random streams and noticed If I try to open it directly in a new browser tab (i.e. no Referrer, etc. headers) I get "Forbidden". |
|
Results of some tests. WebSocketSeems to work just as fine as it worked before this PR. Something I have noticed is that for some streams the web player has options for High, Medium and Low qualities, for other just High and Low, and for other there is no quality option as there is only one WebSocket stream available. It looks like they correspond to the HLSAs streamlink/src/streamlink/plugins/twitcasting.py Lines 116 to 117 in becd39d
part to force it to use HLS on other channels that have both WebSocket and HLS. HLS seems to be broken: |
Yes, this is what the JSON response data refers to in the
This looks more like the stream went offline after you started watching. Before I submitted this PR, I tested HLS streams on various live channels and they all worked fine for several minutes, so this also excludes some kind of playlist/segment URL expiration. I'll check again later. |
You are probably right, I'm no longer able to reproduce this, it seems to work now. By the way, if the stream goes offline, streamlink should terminate instead of trying to download next HLS segments indefinitely, getting HTTP 404. |
|
- Refactor API query - Add HLS streams, but prefer websocket streams due to lower latency - Enforce TLS for HLS and websocket streams
becd39d to
9f9e256
Compare
|
The plugin now returns all available websocket and HLS streams, but websocket streams get ranked higher than HLS streams due to latency reasons. "llfmp4" websocket streams get ignored, because they caused video/audio desync in my tests. Quality-wise, there's no difference and latency-wise there's no difference either from what I could observe. The HLS stream URL from the "dvr" JSON field also gets ignored because of the 403 response. These changes should be fine now. Example of a stream with all available qualities for both websocket and HLS streams: |
Fixes #5254
@nurupo please test.
Either sideload the plugin from here:
https://raw.githubusercontent.com/bastimeyer/streamlink/plugins/twitcasting/rewrite/src/streamlink/plugins/twitcasting.py
https://streamlink.github.io/cli/plugin-sideloading.html
Or install from my branch via
pip:https://streamlink.github.io/install.html#pypi-package-and-source-code
pip install -U "git+https://github.com/bastimeyer/streamlink.git@plugins/twitcasting/rewrite"Notes:
media=source. I don't know if that's correct, as there's thesourcefield in the JSON response. The websocket streams have different quality options for the different API responses, but the HLS streams do not in the current implementation."fmp4"websocket streams, the API response also includes"llfmp4"streams which the website seems to be using. This is currently not implemented, but this could be changed in another PR. The current websocket streams are still working fine.