-
Notifications
You must be signed in to change notification settings - Fork 204
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
base: master
Are you sure you want to change the base?
Conversation
6da664e
to
d5b8465
Compare
@Rafficer ping for attention |
There was a problem hiding this 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.
Add IPv6 to server features
Thanks @zPhoeniqz, I have added your commit to this MR |
protonvpn_cli/utils.py
Outdated
@@ -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 | |||
|
|||
|
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?)
@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. |
This fixes the problem described in #367 while also refactoring the change of #337 into a common decoding function.
Closes #367