Skip to content

Commit

Permalink
Merge pull request #17 from rdavydov/login-fix
Browse files Browse the repository at this point in the history
temporary login fix (only by browser cookie)
  • Loading branch information
rdavydov authored Oct 29, 2022
2 parents 7e7fdea + e51306b commit 1e3b9c3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion TwitchChannelPointsMiner/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
__version__ = "1.3.4"
__version__ = "1.3.5"
from .TwitchChannelPointsMiner import TwitchChannelPointsMiner

__all__ = [
Expand Down
11 changes: 7 additions & 4 deletions TwitchChannelPointsMiner/classes/TwitchLogin.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ def login_flow(self):
"undelete_user": False,
"remember_me": True,
}

use_backup_flow = False
# login-fix
#use_backup_flow = False
use_backup_flow = True

for attempt in range(0, 25):
password = (
Expand Down Expand Up @@ -118,7 +119,9 @@ def login_flow(self):

# If the user didn't load the password from run.py we can just ask for it again.
break
elif err_code == 1000:
# login-fix
#elif err_code == 1000:
elif err_code in [1000, 5022]:
logger.info(
"Console login unavailable (CAPTCHA solving required)."
)
Expand Down Expand Up @@ -148,7 +151,7 @@ def set_token(self, new_token):
self.session.headers.update({"Authorization": f"Bearer {self.token}"})

def send_login_request(self, json_data):
response = self.session.post("https://passport.twitch.tv/login", json=json_data)
response = self.session.post("https://passport.twitch.tv/protected_login", json=json_data)
return response.json()

def login_flow_backup(self):
Expand Down
3 changes: 2 additions & 1 deletion TwitchChannelPointsMiner/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
IRC = "irc.chat.twitch.tv"
IRC_PORT = 6667
WEBSOCKET = "wss://pubsub-edge.twitch.tv/v1"
CLIENT_ID = "kd1unb4b3q4t58fwlpcbzcbnm76a8fp"
CLIENT_ID = "kd1unb4b3q4t58fwlpcbzcbnm76a8fp" # Android App
#CLIENT_ID = "851cqzxpb9bqu9z6galo155du" # iOS App
DROP_ID = "c2542d6d-cd10-4532-919b-3d19f30a768b"
CLIENT_VERSION = "32d439b2-bd5b-4e35-b82a-fae10b04da70"

Expand Down

0 comments on commit 1e3b9c3

Please sign in to comment.