From eb63cf4cdf91811d9db4054fd5845bc7cbf636f8 Mon Sep 17 00:00:00 2001 From: Sorunome Date: Wed, 1 Apr 2020 18:09:21 +0200 Subject: [PATCH] stuff and things --- package-lock.json | 10 +++++----- package.json | 2 +- src/client.ts | 5 ++++- src/skype.ts | 5 ++++- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 37c2e01..03db039 100644 --- a/package-lock.json +++ b/package-lock.json @@ -231,9 +231,9 @@ } }, "@types/tough-cookie": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.6.tgz", - "integrity": "sha512-wHNBMnkoEBiRAd3s8KTKwIuO9biFtTf0LehITzBhSco+HQI0xkXZbLOD55SW3Aqw3oUkHstkm5SPv58yaAdFPQ==" + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.7.tgz", + "integrity": "sha512-rMQbgMGxnLsdn8e9aPVyuN+zMQLrZ2QW8xlv7eWS1mydfGXN+tsTKffcIzd8rGCcLdmi3xvQw2MDaZI1bBNTaw==" }, "@types/undertaker": { "version": "1.2.2", @@ -3619,8 +3619,8 @@ } }, "skype-http": { - "version": "git://github.com/Sorunome/skype-http.git#3ee89d05d3ff78d7adae17fcba544cdb9b2c8966", - "from": "git://github.com/Sorunome/skype-http.git#3ee89d05d3ff78d7adae17fcba544cdb9b2c8966", + "version": "git://github.com/Sorunome/skype-http.git#8f1c71e7654ac5e04c31c552eff847f4ff63b8fa", + "from": "git://github.com/Sorunome/skype-http.git#8f1c71e7654ac5e04c31c552eff847f4ff63b8fa", "requires": { "@types/cheerio": "^0.22.12", "@types/escape-html": "0.0.20", diff --git a/package.json b/package.json index c938be0..7d81434 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "mx-puppet-bridge": "0.0.35-1", "node-emoji": "^1.10.0", "node-html-parser": "^1.2.13", - "skype-http": "git://github.com/Sorunome/skype-http#3ee89d05d3ff78d7adae17fcba544cdb9b2c8966", + "skype-http": "git://github.com/Sorunome/skype-http#8f1c71e7654ac5e04c31c552eff847f4ff63b8fa", "tslint": "^5.17.0", "typescript": "^3.7.4" }, diff --git a/src/client.ts b/src/client.ts index c6a0f1f..6e4c83d 100644 --- a/src/client.ts +++ b/src/client.ts @@ -222,7 +222,10 @@ export class Client extends EventEmitter { } return await Util.DownloadFile(url, { cookies: this.api.context.cookies, - headers: { Authorization: "skype_token " + this.api.context.skypeToken.value }, + headers: { + Authorization: "skypetoken=" + this.api.context.skypeToken.value, + RegistrationToken: this.api.context.registrationToken.raw, + }, }); } diff --git a/src/skype.ts b/src/skype.ts index 7225630..22fbf67 100644 --- a/src/skype.ts +++ b/src/skype.ts @@ -206,8 +206,11 @@ export class Skype { }, MINUTE); } else { log.error("baaaad error"); - await this.puppet.sendStatusMessage(puppetId, "Super bad error, stopping puppet. Please restart the service to start it up again. This is for debugging purposes and will not be needed in the future"); + await this.puppet.sendStatusMessage(puppetId, "Super bad error, restarting in a minute. This is stupid. And will hopefully be fixed in the future."); await this.stopClient(puppetId); + setTimeout(async () => { + await this.startClient(puppetId); + }, MINUTE); } }); try {