-
Notifications
You must be signed in to change notification settings - Fork 20
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
updated app ids #34
base: master
Are you sure you want to change the base?
updated app ids #34
Conversation
Can confirm, fixes #33 - thank you! |
This PR needs to merge ASAP, the Ubisoft Connect plugin does not work at all anymore, as of 1/25/2022. @FriendsOfGalaxy could you prioritize reviewing it? |
Works for me too. |
Any reason why this isn't getting merged? |
@FriendsOfGalaxy seems inactive since last September, maybe they stopped maintaining the plugins.. |
Works for me too. Hope someone could fix the problem by merging the fix with the master. |
Updated GOG Client to 2.0.46 Beta (Feb 16, 2022), but disconnect remains... just updated Ids like this PR, and started working again |
Can we get some attention on this PR, please? We have a known-working fix here. Seems like a quick and safe merge. (assuming maintainer wouldn't want the two commits squashed to one, that is) |
Wonder if anybody else in GoG has commit access to this account. It has a email address, so if anybody is willing to ping them with email... |
I pinged friendsofgalaxy per email, but am not confident, that he responds, since the github user seems inactive for half a year now. |
I have tried to file support request in GoG client, but things don't look good so far:
Although I'd like to hope for situation improving in future, but please also prepare for the worst too -- we players are on our own now. |
As it is clearly stated in GOG Galaxy, they are not responsible for 3rd party integrations so they can do nothing about this anyway and we shouldn't bug them about it, we have always been on our own regarding this. The GOG client is already understuffed and hanging by a thread, let's please not waste their limited time with things that are out of their control. Friends of galaxy is a community project, the bad news is that the maintainer has gone dark for the past months. |
is it possible to change integration url that is embedded in GOG Galaxy official client? |
@muhasturk Nope, that's why I think official intervention is needed. But, well, check the comment above. Not gonna discuss anymore, situation won't change anyway. GoG had possibly pulled the plug on python integration development as a whole, as the main workhorse developer has quitted or at least no longer working on it. Right now manual modification of ID is the way to go. |
@milroneth @turbo25 @yessenbayev |
We already have, and you can too! An approval on GitHub is just the proper way to say "this works as intended and the code looks good, I approve of this, please merge it", instead of commenting without offering anything more. That way the maintainer can easily see that a PR has a certain number of approvals without reading and counting comments, and go ahead and merge it. None of us has the power to merge, only the (now disappeared) maintainer of the repo. |
@milroneth thanks for explaining reviewers don't get merge rights, never realized that. Is the disappeared maintainer at the repo or the org (FriendsOfGalaxy) level? I always thought folks at the org level can take control of any repo in the org? |
In the worst case scenario, if the maintainer is no longer available, we can collaborate with GOG, by cloning the integrations to a new user/organization and asking GOG to pull integrations from that new cloned repo. |
Thank you |
Updated the IDs in the PR in case it ever gets merged... |
Well I noticed another pull request that had been merged with a similar id
at first and then I canceled this one - since I noticed it was already in
the repo history. Thank you! Sorry for the confusion :)
…On Sat, Aug 6, 2022 at 6:12 PM Bjarne Krottjé ***@***.***> wrote:
Any idea when this will be merged?
—
Reply to this email directly, view it on GitHub
<#34 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANG2ZZQREBGMVXCWKA7DUTVX3WMJANCNFSM5MTGPT5A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
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.
So they changed the IDs AGAIN.
Looking at them today they seem to be the following.
CLUB_APPID = "314d4fef-e568-454a-ae06-43e3bece12a6"
CLUB_GENOME_ID = "85c31714-0941-4876-a18d-2c7e9dce8d40"
EDIT: It should be possible to retrieve these actively. So this constantly changing may end.
If I find the time I might try implementing that in a few days.
They can be found in one of the get requests to https://ubisoftconnect.com/invalid
or any other invalid page at that domain one of the GET requests sent by the 404 page contains them in the request header
https://connect.ubisoft.com/sdk.html?env=PROD&appId=314d4fef-e568-454a-ae06-43e3bece12a6&genomeId=85c31714-0941-4876-a18d-2c7e9dce8d40&thirdPartyfalse=&lang=en-US&nextUrl=https://ubisoftconnect.com/invalid?isSso=true&host=https://ubisoftconnect.com
Here is a one-liner to quickly check/get the IDs: # short version
curl -s https://ubisoftconnect.com/invalid | grep -Eo 'APP_ID.{0,40}|GENOME_ID.{0,40}'
# long version, readable parameter
curl --silent https://ubisoftconnect.com/invalid | grep --extended-regexp --only-matching 'APP_ID.{0,40}|GENOME_ID.{0,40}' I'm sure this can be enhanced, but for me it helps. 😄 Let's hope GOG sorts out the Plugin updates / repo access fuu soonish. Has been a year now since the last update in this repo. 😞 |
Have taken what @drmaxx has suggested above, and written it in python to replace what's currently hardcoded in to the consts.py file for this plugin. So long as they don't go changing the urls/response format, this should keep itself updated rather than needing a code change each time the APP_ID/GENOME_ID changes.
|
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.
import requests
ids_url = 'https://ubisoftconnect.com/invalid'
ids_response = requests.get(ids_url)
regex_ids_response = re.findall('APP_ID.{0,40}|GENOME_ID.{0,40}', ids_response.text)
ids_result = []
for sub in regex_ids_response:
sub = sub.replace('"','')
if ':' in sub:
ids_result.append(map(str.strip, sub.split(':', 1)))
ids_result = dict(ids_result)
CLUB_APPID = ids_result.get('APP_ID','')
CLUB_GENOME_ID = ids_result.get('GENOME_ID','')
Thanks for implementing it. That is exactly what I suggested doing, just did not have the time yet. import requests
ids_url = 'https://ubisoftconnect.com/invalid'
try:
ids_response = requests.get(ids_url)
regex_ids_response = re.findall('APP_ID.{0,40}|GENOME_ID.{0,40}', ids_response.text)
ids_result = []
for sub in regex_ids_response:
sub = sub.replace('"','')
if ':' in sub:
ids_result.append(map(str.strip, sub.split(':', 1)))
ids_result = dict(ids_result)
CLUB_APPID = ids_result.get('APP_ID','')
CLUB_GENOME_ID = ids_result.get('GENOME_ID','')
except requests.exceptions.ConnectionError:
CLUB_APPID = "314d4fef-e568-454a-ae06-43e3bece12a6"
CLUB_GENOME_ID = "85c31714-0941-4876-a18d-2c7e9dce8d40" but then again, if fetching the url does not work, there should be no connection anyway, so maybe this is unnecessary. Now lets hope that it will eventually be merged. EDIT: @wearepariah I suggest you should submit it as a PR to @fl4shback fork of this repo. |
thanks @KS-HTK - i have created the pull request to @fl4shback repo. |
import requests
ids_url = 'https://ubisoftconnect.com/invalid'
old_app_id = CLUB_APPID
old_genome_id = CLUB_GENOME_ID
try:
ids_response = requests.get(ids_url)
regex_ids_response = re.findall('APP_ID.{0,40}|GENOME_ID.{0,40}', ids_response.text)
ids_result = []
for sub in regex_ids_response:
sub = sub.replace('"','')
if ':' in sub:
ids_result.append(map(str.strip, sub.split(':', 1)))
ids_result = dict(ids_result)
CLUB_APPID = ids_result.get('APP_ID','')
CLUB_GENOME_ID = ids_result.get('GENOME_ID','')
except requests.exceptions.ConnectionError:
CLUB_APPID = old_app_id
CLUB_GENOME_ID = old_genome_id Maybe this can do the trick? |
No it won't. It would require saving them to a file. |
I tried this but now the add-on is constantly timing out. What did I do wrong? |
Difficult to say without seeing how you modified try replacing yours with that one. |
That helped Me fix it. Thanks! I believe I was missing a couple of lines at the top. |
This works much longer for me, but it's not a permanent fix. After a few hours I must reconnect (including pulling out my goddamn phone for the stupid 2 factor authentication). Before it would instantly disconnect in a second after connecting, so this new consts.py is much better, but not a real full solution. |
I am not sure that's caused by this change, the constant changing of the ID's could indicate that Ubi have changed something else at their end causing this - the Ubisoft Connect app on my machine has forced me to log back in a bunch of times in the past week, correlation in timing rather than causation. |
No, this is not a fix for a disconnect every 5-6h this is a fix for not being able to connect at all. I am not sure there is going to be a fix for that any time soon. |
I am about to make the most useless of comments but I got fed up that Ubisoft wasn't showing up in my GoG library so I decided to dig a bit. I verified Backend.py and it does support OAUTH2 and it does handle refreshing tokens already, but I've noticed disconnection there. I have looked through some of my logs and the originator of the issue seems to begin from a call to _do_safe_request which receives a weird answer. Not wanting to wait, I decided to log to file the tokens and expiry dates, and to subtract a good chunk of time from expiry time.... and it just called _refresh_auth properly? And then again and again and again. So using the fix by @wearepariah in combination by just refreshing the token long before it expires, I seem to be doing good. There is no refresh token rotation. Always the same refresh token. Now, I am not sure what happens if I turn off GoG for a couple of hours, but combing through the code I've found a couple potential issues, the main ones revolving around improper handling of errors on requests. We have 3 layers of requests. We have request which handles the actual request. If it fails, it raises an error, it uses an handle_exception function. We have _do_request which is a wrapper around request, it has zero error handling. We have _do_safe_request which is a wrapper around _do_request. It has a preemptive ticket refresh (which is what I used) and a try/except situation to refresh auth but only on AccessDenied, AuthenticationRequired errors, as defined by handle_exception, any errors outside of those 2 is a dead end. My take aways right now are: Gotta refactor requests so that they always fallback to refreshing auth if it fails and if that fails, kill stored credentials. Request and _do_request are called and can cause this situation. There will probably need to be some method of fallback for exceptions. Some errors I've noticed is that a request returns 401 but the handle_exception doesn't know what to do with it, so it returns unknown handle. We do have situations where we get 401 while doing a token refresh. Oh and for some reasons _do_options_request has an hardcoded appID |
This is one of the most useful comments instead, but I agree, it's also useless because we have no control on the PRs and merges so these changes will never go live for anyone |
We do not on this repo. But you could pull a different fork with some of the fixes and manually do git pull if it has an update. I use @fl4shback 's fork instead of this one. |
FYI It's been one full (fun) year, I'm pulling the plug on this. Set my repo to archive mode, won't research any future fixes. Good luck to those who choose to keep using Galaxy 😄 More info here if you want: |
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.
LGTM
Some parts of the Ubisoft API recently started to reject requests made by the legacy "Ubisoft Club" app IDs.
I changed the IDs to the new ones.
Fixes #33, #37