Thanks to visit codestin.com
Credit goes to github.com

Skip to content

plugins.twitcasting: add support for private/password-protected streams#3505

Merged
back-to merged 5 commits into
masterfrom
unknown repository
Jan 30, 2021
Merged

plugins.twitcasting: add support for private/password-protected streams#3505
back-to merged 5 commits into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Jan 22, 2021

Copy link
Copy Markdown

Description

Add a --twitcasting-password option to the TwitCasting plugin, supporting private (password-protected) TwitCasting streams.

closes #3504

How it works

If the command line option is used, then we append &word={md5_encrypted_password} to real_stream_url.

How to test

You can easily start a livestream from Twitcasting by hovering the blue "Broadcast" button at the top right of the site then clicking "Web broadcasting". Scroll down to set a password then back up to start an audio-only livestream. If you do not have an account, you can quickly login with a Twitter or Facebook account if you have one.

This is my first ever pull request, in a language I have essentially no experience with. I hope everything is OK.

@mkbloke

mkbloke commented Jan 22, 2021

Copy link
Copy Markdown
Member

Don't worry about the linting too much (the extra commits will be squashed), but just in case you didn't know, you can install the dev-requirements and then run flake8 locally to get it right on your initial PR: https://streamlink.github.io/developing.html

@bastimeyer bastimeyer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just reviewing the code changes, not the actual password implementation because I don't want to create an account and create a stream for this site.

This is my first ever pull request, in a language I have essentially no experience with. I hope everything is OK.

No problem. If you need help, just ask.

Comment thread src/streamlink/plugins/twitcasting.py Outdated
Comment thread src/streamlink/plugins/twitcasting.py Outdated
Comment thread src/streamlink/plugins/twitcasting.py Outdated
Comment thread src/streamlink/plugins/twitcasting.py Outdated
@bastimeyer bastimeyer added the plugin enhancement A new feature for a working Plugin label Jan 23, 2021
- remove redundant prefix
- read the password argument only once
- rename hash variable to more accurate name
- use update_qsd to update the URL's query string
@ghost

ghost commented Jan 23, 2021

Copy link
Copy Markdown
Author

Thanks for the review! I've committed the changes you suggested and made sure that the option still works. No problem with it on my end.

@bastimeyer bastimeyer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code changes are looking good now. As said, this is just a code review and I can't tell whether this is the correct implementation, because I didn't validate it.

As a potential improvement, if the site returns an error response for wrong passwords, this could be caught here and handled with a respective error message. Tests for the newly added plugin argument are not really needed, as the plugin's stream URL resolving logic isn't tested anyway.

To the one who merges this, please make sure that no @-mentions are included in the squashed commit message body, thanks.

@bastimeyer bastimeyer added the PR: squash commits Commits need to be squashed as a single commit - eg. multiple commits for a single component label Jan 23, 2021
@back-to back-to merged commit 7e50278 into streamlink:master Jan 30, 2021
Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin enhancement A new feature for a working Plugin 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.

Support for password-protected TwitCasting streams

3 participants