Skip to content
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

Decode feature flags for protonvpn s #368

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

marcel-engelke
Copy link

@marcel-engelke marcel-engelke commented Mar 24, 2024

This fixes the problem described in #367 while also refactoring the change of #337 into a common decoding function.

Closes #367

@marcel-engelke
Copy link
Author

@Rafficer ping for attention

Copy link

@zPhoeniqz zPhoeniqz left a comment

Choose a reason for hiding this comment

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

From the ProtonVPN API code:

SECURE_CORE = 1 << 0  # 1
TOR = 1 << 1  # 2
P2P = 1 << 2  # 4
STREAMING = 1 << 3  # 8
IPV6 = 1 << 4  # 16

IPv6 needs to be added as well.

@marcel-engelke
Copy link
Author

marcel-engelke commented Dec 12, 2024

Thanks @zPhoeniqz, I have added your commit to this MR

@@ -115,11 +115,13 @@ def get_servers():
# Sort server IDs by Tier
return [server for server in servers if server["Tier"] <= user_tier and server["Status"] == 1] # noqa


Choose a reason for hiding this comment

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

@marcel-engelke Are these extra linefeeds necessary?

for bit_flag in features:
if (feat & bit_flag) != 0:
servers_features.append(features[bit_flag])
server_features = get_server_features(servername, servers)

Choose a reason for hiding this comment

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

@marcel-engelke Is this variable rename necessary? It forces 3 other changes that are not code fixes per se. (maybe these little 'extras' are blocking a good review and merge?)

@guyboertje
Copy link

@marcel-engelke if you wish to resolve my comments made in-line then I think that this patch LGTM.

@Rafficer do you agree? It is about time this was fixed and merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] "protonvpn s" doesn't work anymore
3 participants