ocilo / skype-http Goto Github PK
View Code? Open in Web Editor NEWUnofficial Skype API for Node.js via HTTP
Home Page: https://ocilo.github.io/skype-http
License: MIT License
Unofficial Skype API for Node.js via HTTP
Home Page: https://ocilo.github.io/skype-http
License: MIT License
Had to install incident still as it it still in use ie: https://github.com/ocilo/skype-http/blob/master/src/lib/connect.ts (and several others). Just needs to be added back into deps.
I can submit a PR for small items like this or an issue report depending on your preference.
While working on other projects, I continually improved my project management tools. It resulted in turbo-gulp
and a few shell scripts.
Some improvements are still planned (especially for documentation) but the bulk of the work is there so I'd like to start applying it to this project.
Compared to the version currently used by skype-http
([email protected]
), the main changes are:
import {Api} from "skype-http/types"
)And a few other goodies. I am actively working on ESM modules support for Node (.mjs
) so it should hopefully land there soon.
Additional changes that need to be done manually:
The sendImage
method uses an XML string. This string is currently built by concatenating the attributes inside the template. These attributes are not properly escaped currently.
We should either leverage cherio to build the string or add some utilities to better handle XML.
I get the following error when invoking api.getContacts()
TypeError: Cannot read property 'first' of undefined
at contactToPerson (/home/keyvan/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/utils/formatters.js:114:68)
at formatContact (/home/keyvan/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/utils/formatters.js:43:12)
at arrayMap (/home/keyvan/matrix-puppet-skype/node_modules/lodash/lodash.js:660:23)
at Function.map (/home/keyvan/matrix-puppet-skype/node_modules/lodash/lodash.js:9571:14)
at Object.<anonymous> (/home/keyvan/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/api/get-contacts.js:29:18)
at Generator.next (<anonymous>)
at fulfilled (/home/keyvan/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/api/get-contacts.js:4:58)
at process._tickCallback (internal/process/next_tick.js:109:7)
When you login with email, it sets the context username to the email so that getting contacts fails in addition to anything that depends on the username.
{
"username": REDACTED"@outlook.com",
"skypeToken": {
"value": REDACTED,
"expirationDate": REDACTED
},
"registrationToken": {
"value": REDACTED,
"expirationDate": REDACTED,
"endpointId": "{78ee4110-26ee-42f1-b487-10e6de41228c}",
"raw": "registrationToken="REDACTED,
"host": "bn2-client-s.gateway.messenger.live.com"
}
}
I am getting an error when trying to login: (in microsoft-account.ts @116)
export async function getLiveKeys(options: LoadLiveKeysOptions): Promise<LiveKeys> { try { const uri: string = url.resolve(skypeLoginUri, path.posix.join("oauth", "microsoft"));
For some reason path.posix is undefined. I have the latest version of node.js. Any ideas why this would be the case?
Hi there.
Nice library! I like how verbose this error is -- it's very clear what the problem is. My question is whether or not dealing with this scenario is in scope of skype-http
-- I'm assuming it is not:
For context, this is happening when logging in on a machine which has not logged into skype before through a normal client (i.e. I am guessing we are running into a security measure when Microsoft notices a login from a strange IP such as a virtual private server).
MicrosoftAccountLogin: Unable to login with MicrosoftAccount.
caused by GetLiveToken: Unable to get the Live token for Skype
caused by LiveTokenNotFound: Unable to find the Live token. This token is normally found in the HTML response as the value of the element with the id "t". This error may be caused by a change in the Microsoft login workflow. HTML page: "<html><head><noscript>JavaScript required to sign in<meta http-equiv=\"Refresh\" content=\"0; URL=https://login.live.com/jsDisabled.srf?mkt=EN-US&lc=1033\"/></noscript><title>Continue</title><script type=\"text/javascript\">function OnBack(){}function OnNext(){}function DoSubmit(){var subt=false;if(!subt){subt=true;document.fmHF.submit();}}</script></head><body onload=\"javascript:DoSubmit();\"><form name=\"fmHF\" id=\"fmHF\" action=\"https://account.live.com/identity/confirm?ru=https://login.live.com/login.srf%3flc%3d1033%26sf%3d1%26id%3d293290%26tw%3d18000%26fs%3d0%26ts%3d-1%26sec%3d%26mspp_shared%3d1%26seclog%3d10%26claims%3d%26wa%3dwsignin1.0%26wp%3dMBI_SSL%26ru%3dhttps://lw.skype.com/login/oauth/proxy%253fclient_id%253d578134%2526site_name%253dlw.skype.com%2526redirect_uri%253dhttps%25253A%25252F%25252Fweb.skype.com%25252F%26contextid%3d20B63404CFB06BE2&mkt=EN-US&uiflavor=web&id=293290&uaid=ef101e26ba7ac7723c7241ecaca40cb1\" method=\"post\" target=\"_top\"><input type=\"hidden\" name=\"ipt\" id=\"ipt\" value=\"Dfk7QGQf8!GGva9nb6r*2iXDtuYzpFtbqyInAWOdXUL*6GEcPBL!yWlm4koF!w1BByhraPWpkN7HdGaZ5nFvaugs7g5AxtaZD95BUmvmVyec9GqyRQcFJsP2POnu!avtdMFUwHRF54CdPc3yyqQMAcj6hQE*pTG2Pzxbql2W9emzQzTjE2k0i6RtyC1SNkH3e4bpWvCyTb0*ZV4Yov69k3Jm9CqJblo8pN3TdarmZoKwD8Bo0xgnujcEVcdqQjqX50gDUtq6P1udIjmYUv!WUZAUtNeluy*Yj7z!BIu8CZnoQjqOizc5WOyOl5MQMSn4KsdFiPye5XzJDSsK5iNUgz4aNmrPhPgC6OWohhYpOG!SkLRAHd1mMvDf*TxBhc2eHJDTVs6eK!rwjVbByXwbw0U6QMpnmvN84PEifvfqKfRn0pKSWYfkC1Md0hDPo8xTFHDQARpLXvl93AHCs1A3dII$\"></form></body></html>"
at Object.create (/home/keyvan/code/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/errors/microsoft-account/get-live-token.js:17:16)
at scrapLiveToken (/home/keyvan/code/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/providers/microsoft-account.js:221:61)
at /home/keyvan/code/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/providers/microsoft-account.js:138:20
at Generator.next (<anonymous>)
at fulfilled (/home/keyvan/code/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/providers/microsoft-account.js:4:58)
at process._tickCallback (internal/process/next_tick.js:109:7)
name: 'MicrosoftAccountLogin',
data: {},
cause:
{ GetLiveToken: Unable to get the Live token for Skype
caused by LiveTokenNotFound: Unable to find the Live token. This token is normally found in the HTML response as the value of the element with the id "t". This error may be caused by a change in theMicrosoft login workflow. HTML page: "<html><head><noscript>JavaScript required to sign in<meta http-equiv=\"Refresh\" content=\"0; URL=https://login.live.com/jsDisabled.srf?mkt=EN-US&lc=1033\"/></noscript><title>Continue</title><script type=\"text/javascript\">function OnBack(){}function OnNext(){}function DoSubmit(){var subt=false;if(!subt){subt=true;document.fmHF.submit();}}</script></head><body onload=\"javascript:DoSubmit();\"><form name=\"fmHF\" id=\"fmHF\" action=\"https://account.live.com/identity/confirm?ru=https://login.live.com/login.srf%3flc%3d1033%26sf%3d1%26id%3d293290%26tw%3d18000%26fs%3d0%26ts%3d-1%26sec%3d%26mspp_shared%3d1%26seclog%3d10%26claims%3d%26wa%3dwsignin1.0%26wp%3dMBI_SSL%26ru%3dhttps://lw.skype.com/login/oauth/proxy%253fclient_id%253d578134%2526site_name%253dlw.skype.com%2526redirect_uri%253dhttps%25253A%25252F%25252Fweb.skype.com%25252F%26contextid%3d20B63404CFB06BE2&mkt=EN-US&uiflavor=web&id=293290&uaid=ef101e26ba7ac7723c7241ecaca40cb1\" method=\"post\" target=\"_top\"><input type=\"hidden\" name=\"ipt\" id=\"ipt\" value=\"Dfk7QGQf8!GGva9nb6r*2iXDtuYzpFtbqyInAWOdXUL*6GEcPBL!yWlm4koF!w1BByhraPWpkN7HdGaZ5nFvaugs7g5AxtaZD95BUmvmVyec9GqyRQcFJsP2POnu!avtdMFUwHRF54CdPc3yyqQMAcj6hQE*pTG2Pzxbql2W9emzQzTjE2k0i6RtyC1SNkH3e4bpWvCyTb0*ZV4Yov69k3Jm9CqJblo8pN3TdarmZoKwD8Bo0xgnujcEVcdqQjqX50gDUtq6P1udIjmYUv!WUZAUtNeluy*Yj7z!BIu8CZnoQjqOizc5WOyOl5MQMSn4KsdFiPye5XzJDSsK5iNUgz4aNmrPhPgC6OWohhYpOG!SkLRAHd1mMvDf*TxBhc2eHJDTVs6eK!rwjVbByXwbw0U6QMpnmvN84PEifvfqKfRn0pKSWYfkC1Md0hDPo8xTFHDQARpLXvl93AHCs1A3dII$\"></form></body></html>"
at Object.create (/home/keyvan/code/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/errors/microsoft-account/get-live-token.js:17:16)
at scrapLiveToken (/home/keyvan/code/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/providers/microsoft-account.js:221:61)
at /home/keyvan/code/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/providers/microsoft-account.js:138:20
at Generator.next (<anonymous>)
at fulfilled (/home/keyvan/code/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/providers/microsoft-account.js:4:58)
at process._tickCallback (internal/process/next_tick.js:109:7)
name: 'GetLiveToken',
data: {},
cause:
{ LiveTokenNotFound: Unable to find the Live token. This token is normally found in the HTML response as the value of the element with the id "t". This error may be caused by a change in the Microsoft login workflow. HTML page: "<html><head><noscript>JavaScript required to sign in<meta http-equiv=\"Refresh\" content=\"0; URL=https://login.live.com/jsDisabled.srf?mkt=EN-US&lc=1033\"/></noscript><title>Continue</title><script type=\"text/javascript\">function OnBack(){}function OnNext(){}function DoSubmit(){var subt=false;if(!subt){subt=true;document.fmHF.submit();}}</script></head><body onload=\"javascript:DoSubmit();\"><form name=\"fmHF\" id=\"fmHF\" action=\"https://account.live.com/identity/confirm?ru=https://login.live.com/login.srf%3flc%3d1033%26sf%3d1%26id%3d293290%26tw%3d18000%26fs%3d0%26ts%3d-1%26sec%3d%26mspp_shared%3d1%26seclog%3d10%26claims%3d%26wa%3dwsignin1.0%26wp%3dMBI_SSL%26ru%3dhttps://lw.skype.com/login/oauth/proxy%253fclient_id%253d578134%2526site_name%253dlw.skype.com%2526redirect_uri%253dhttps%25253A%25252F%25252Fweb.skype.com%25252F%26contextid%3d20B63404CFB06BE2&mkt=EN-US&uiflavor=web&id=293290&uaid=ef101e26ba7ac7723c7241ecaca40cb1\" method=\"post\" target=\"_top\"><input type=\"hidden\" name=\"ipt\" id=\"ipt\" value=\"Dfk7QGQf8!GGva9nb6r*2iXDtuYzpFtbqyInAWOdXUL*6GEcPBL!yWlm4koF!w1BByhraPWpkN7HdGaZ5nFvaugs7g5AxtaZD95BUmvmVyec9GqyRQcFJsP2POnu!avtdMFUwHRF54CdPc3yyqQMAcj6hQE*pTG2Pzxbql2W9emzQzTjE2k0i6RtyC1SNkH3e4bpWvCyTb0*ZV4Yov69k3Jm9CqJblo8pN3TdarmZoKwD8Bo0xgnujcEVcdqQjqX50gDUtq6P1udIjmYUv!WUZAUtNeluy*Yj7z!BIu8CZnoQjqOizc5WOyOl5MQMSn4KsdFiPye5XzJDSsK5iNUgz4aNmrPhPgC6OWohhYpOG!SkLRAHd1mMvDf*TxBhc2eHJDTVs6eK!rwjVbByXwbw0U6QMpnmvN84PEifvfqKfRn0pKSWYfkC1Md0hDPo8xTFHDQARpLXvl93AHCs1A3dII$\"></form></body></html>"
at Object.create (/home/keyvan/code/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/errors/microsoft-account/get-live-token.js:17:16)
at scrapLiveToken (/home/keyvan/code/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/providers/microsoft-account.js:221:61)
at /home/keyvan/code/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/providers/microsoft-account.js:138:20
at Generator.next (<anonymous>)
at fulfilled (/home/keyvan/code/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/providers/microsoft-account.js:4:58)
at process._tickCallback (internal/process/next_tick.js:109:7)
name: 'LiveTokenNotFound',
data: [Object],
message: 'LiveTokenNotFound: Unable to find the Live token. This token is normally found in the HTML response as the value of the element with the id "t". This error may be caused by a change in the Microsoft login workflow. HTML page: "<html><head><noscript>JavaScript required to sign in<meta http-equiv=\\"Refresh\\" content=\\"0; URL=https://login.live.com/jsDisabled.srf?mkt=EN-US&lc=1033\\"/></noscript><title>Continue</title><script type=\\"text/javascript\\">function OnBack(){}function OnNext(){}function DoSubmit(){var subt=false;if(!subt){subt=true;document.fmHF.submit();}}</script></head><body onload=\\"javascript:DoSubmit();\\"><form name=\\"fmHF\\" id=\\"fmHF\\" action=\\"https://account.live.com/identity/confirm?ru=https://login.live.com/login.srf%3flc%3d1033%26sf%3d1%26id%3d293290%26tw%3d18000%26fs%3d0%26ts%3d-1%26sec%3d%26mspp_shared%3d1%26seclog%3d10%26claims%3d%26wa%3dwsignin1.0%26wp%3dMBI_SSL%26ru%3dhttps://lw.skype.com/login/oauth/proxy%253fclient_id%253d578134%2526site_name%253dlw.skype.com%2526redirect_uri%253dhttps%25253A%25252F%25252Fweb.skype.com%25252F%26contextid%3d20B63404CFB06BE2&mkt=EN-US&uiflavor=web&id=293290&uaid=ef101e26ba7ac7723c7241ecaca40cb1\\" method=\\"post\\" target=\\"_top\\"><input type=\\"hidden\\" name=\\"ipt\\" id=\\"ipt\\" value=\\"Dfk7QGQf8!GGva9nb6r*2iXDtuYzpFtbqyInAWOdXUL*6GEcPBL!yWlm4koF!w1BByhraPWpkN7HdGaZ5nFvaugs7g5AxtaZD95BUmvmVyec9GqyRQcFJsP2POnu!avtdMFUwHRF54CdPc3yyqQMAcj6hQE*pTG2Pzxbql2W9emzQzTjE2k0i6RtyC1SNkH3e4bpWvCyTb0*ZV4Yov69k3Jm9CqJblo8pN3TdarmZoKwD8Bo0xgnujcEVcdqQjqX50gDUtq6P1udIjmYUv!WUZAUtNeluy*Yj7z!BIu8CZnoQjqOizc5WOyOl5MQMSn4KsdFiPye5XzJDSsK5iNUgz4aNmrPhPgC6OWohhYpOG!SkLRAHd1mMvDf*TxBhc2eHJDTVs6eK!rwjVbByXwbw0U6QMpnmvN84PEifvfqKfRn0pKSWYfkC1Md0hDPo8xTFHDQARpLXvl93AHCs1A3dII$\\"></form></body></html>"\n at Object.create (/home/keyvan/code/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/errors/microsoft-account/get-live-token.js:17:16)\n at scrapLiveToken (/home/keyvan/code/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/providers/microsoft-account.js:221:61)\n at /home/keyvan/code/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/providers/microsoft-account.js:138:20\n at Generator.next (<anonymous>)\n at fulfilled (/home/keyvan/code/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/providers/microsoft-account.js:4:58)\n at process._tickCallback (internal/process/next_tick.js:109:7)' },
message: 'GetLiveToken: Unable to get the Live token for Skype\n caused by LiveTokenNotFound: Unable to find the Live token. This token is normally found in the HTML response as the value of the element with the id "t". This error may be caused by a change in the Microsoft login workflow. HTML page: "<html><head><noscript>JavaScript required to sign in<meta http-equiv=\\"Refresh\\" content=\\"0; URL=https://login.live.com/jsDisabled.srf?mkt=EN-US&lc=1033\\"/></noscript><title>Continue</title><script type=\\"text/javascript\\">function OnBack(){}function OnNext(){}function DoSubmit(){var subt=false;if(!subt){subt=true;document.fmHF.submit();}}</script></head><body onload=\\"javascript:DoSubmit();\\"><form name=\\"fmHF\\" id=\\"fmHF\\" action=\\"https://account.live.com/identity/confirm?ru=https://login.live.com/login.srf%3flc%3d1033%26sf%3d1%26id%3d293290%26tw%3d18000%26fs%3d0%26ts%3d-1%26sec%3d%26mspp_shared%3d1%26seclog%3d10%26claims%3d%26wa%3dwsignin1.0%26wp%3dMBI_SSL%26ru%3dhttps://lw.skype.com/login/oauth/proxy%253fclient_id%253d578134%2526site_name%253dlw.skype.com%2526redirect_uri%253dhttps%25253A%25252F%25252Fweb.skype.com%25252F%26contextid%3d20B63404CFB06BE2&mkt=EN-US&uiflavor=web&id=293290&uaid=ef101e26ba7ac7723c7241ecaca40cb1\\" method=\\"post\\" target=\\"_top\\"><input type=\\"hidden\\" name=\\"ipt\\" id=\\"ipt\\" value=\\"Dfk7QGQf8!GGva9nb6r*2iXDtuYzpFtbqyInAWOdXUL*6GEcPBL!yWlm4koF!w1BByhraPWpkN7HdGaZ5nFvaugs7g5AxtaZD95BUmvmVyec9GqyRQcFJsP2POnu!avtdMFUwHRF54CdPc3yyqQMAcj6hQE*pTG2Pzxbql2W9emzQzTjE2k0i6RtyC1SNkH3e4bpWvCyTb0*ZV4Yov69k3Jm9CqJblo8pN3TdarmZoKwD8Bo0xgnujcEVcdqQjqX50gDUtq6P1udIjmYUv!WUZAUtNeluy*Yj7z!BIu8CZnoQjqOizc5WOyOl5MQMSn4KsdFiPye5XzJDSsK5iNUgz4aNmrPhPgC6OWohhYpOG!SkLRAHd1mMvDf*TxBhc2eHJDTVs6eK!rwjVbByXwbw0U6QMpnmvN84PEifvfqKfRn0pKSWYfkC1Md0hDPo8xTFHDQARpLXvl93AHCs1A3dII$\\"></form></body></html>"\n at Object.create (/home/keyvan/code/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/errors/microsoft-account/get-live-token.js:17:16)\n at scrapLiveToken (/home/keyvan/code/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/providers/microsoft-account.js:221:61)\n at /home/keyvan/code/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/providers/microsoft-account.js:138:20\n at Generator.next (<anonymous>)\n at fulfilled (/home/keyvan/code/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/providers/microsoft-account.js:4:58)\n at process._tickCallback (internal/process/next_tick.js:109:7)' } }
Would be great if you could update the node npm package and publish an @types/skype-http package as well.
I tried doing things like:
"dependencies": {
"skype-http": "git+https://github.com/ocilo/skype-http",
and then:
import { Api as SkypeApi } from "./node_modules/skype-http/src/lib/api";
import * as skypeHttp from "./node_modules/skype-http/src/lib/connect";
import * as events from "./node_modules/skype-http/src/lib/interfaces/api/events";
however ts-node doesn't support import so that fails (for the sub modules).
Could not get typings to install from repo using something like:
typings install --save github:ocilo/skype-http
These work:
npm install --save skype-http
typings install --save npm:skype-http
but are out of date I would assume.
"Tell the package author to fix their package.json file. JSON.parse"
This repo is pretty active but the demo doesn't function without an old account; what gives?
I have one as I registered it ages ago, but after some research it looks like you MUST have a MS Live account when you register for Skype.
Is there some gotcha to this?
Is there a way to use something like keytar so that I don't have to store the user's password in plain text/encrypted?
I'll use this issue for the roadmap of the library until 0.1.0
.
First of all, thanks for all the people using this library and reporting issues/sending PRs. I started the library about two years ago and since then the library was mostly maintained only to ensure that it keeps working, but this was not enough to move it beyond the prototype state.
Goals:
Non-goals:
Challenges:
Roadmap:
native-api
and api
). This kind of higher-level abstraction should be handled by other libraries.skype-http
currently offers a getState
method to export the Skype session and endpoint state, but you then have to recreate a new instance (involving some reconnections) to use it.skype-http
, the goal would be to have any potential error defined in src/errors
so you can then catch the errors, switch on the name and handle them with the available data. For example an unexpected Skype responses should result in an UnexpectedResponseBody
error with a body
and request
data so you can implement a quickfix until a patch is merged into the library. The second library (Kryo) offers a mostly declarative API to build runtime representations of types. This allows to test if a value matches a given type and help with serialization. For example it's intermediate model is richer than JSON so it can deal with Date
objects out of the box. It also supports renames between JS keys and serialized keys. These runtime types were introduced in #70 for contacts and #87 introduces it for conversations/messages/events. An idea to track Skype's non-breaking changes would be to generate two representations for each resource: a strict one rejecting objects with extra keys and using strong assumptions, and a weaker-one that ignore extra keys and has weaker checks. Then, the objects would be first parsed with strict representation: if it fails but succeeds with the weak one a warning is issued; if it also fails with the weak one it means there was a breaking change in the Skype API and an error is thrown as described above.request
: its automagic cookie management makes it hard to keep track of the API state, it also complicates abstracting the HTTP layer to mock it.The contacts returned by .getContacts should be prefixed by their type (as 8:
for human users).
Currently when trying to login I get the error
scrapping: Unable to retrieve the pie and etm keys from the login page
logging in with skyweb works however.
Is there a way to interact with group chats? (Not the old p2p. The new ones. Like that random one I created 2 days ago.)
A change in the Skype API caused a regression in the library. The library is no longer able to fetch the contact data. This can be seen by running the example. We get a large number of errors of the following form:
{ statusCode: 403,
body: '{"status":{"code":40300,"text":"User \'<local-username>\' is not authorized to request resource of user \'<contact-username>\'"}}',
headers:
{ server: 'nginx/1.7.8',
date: 'Tue, 09 May 2017 19:29:31 GMT',
'content-type': 'application/json; ver=1.0; charset=utf-8',
'content-length': '118',
connection: 'close',
'x-stratus-processing-time': '0.0188',
'x-skype-request-id': '7ee0275d',
'x-stratus-request-id': '7ee0275d',
'cache-control': 'no-cache, must-revalidate, stratus-cache-per-request=true',
'x-frame-options': 'SAMEORIGIN',
'x-content-type-options': 'nosniff',
'x-xss-protection': '1; mode=block',
'strict-transport-security': 'max-age=31536000; includeSubdomains;' } }
{ net: Unable to fetch contact
at Object.<anonymous> (/data/projects/various/skype-http/build/example/lib/api/get-contact.js:33:35)
at Generator.next (<anonymous>)
at fulfilled (/data/projects/various/skype-http/build/example/lib/api/get-contact.js:4:58)
at process._tickCallback (internal/process/next_tick.js:109:7) name: 'net', data: {} }
Hi everyone, I am working with Skpy, I have used following code for two months, but this morning it suddenly returns this error
########################################################################
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\skpy\main.py", line 67, in init
self.conn.readToken()
File "C:\ProgramData\Anaconda3\lib\site-packages\skpy\conn.py", line 301, in readToken
raise SkypeAuthException("Token file has expired")
skpy.core.SkypeAuthException: Token file has expired
########################################################################
Here is my code:
from skpy import Skype
import time
i = 0
j = 0
k = 0
Skype('xxxx', 'xxxx', ".tokens-fred.2")
sk = Skype(tokenFile=".tokens-fred.2")
print(sk.conn)
while True:
j += 1
if j>8:
time.sleep(200)
ms = sk.chats["VIP"].getMsgs()
if len(ms)>= 10:
print("init..." + str(len(ms)))
elif len(ms)!=0:
if i != 0:
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
print(ms)
i += 1
else:
k += 1
print("checking..." + str(k))
When the credentials use an email address ({username: "[email protected]", password: "bar"}
), the getContacts
api fails.
It sends a request to https://contacts.skype.com/contacts/v1/users/[email protected]/contacts
and receives a 401 - Unauthorized response with the body:
{"message":"Skype token validation failed!","stackTrace":null}
In this case, it should have sent the request to https://contacts.skype.com/contacts/v1/users/live:example/contacts
.
It means that there should be some translation between the email address and corresponding Skype username to fix this issue.
Reference: ShyykoSerhiy/skyweb#19
https://{host}/v1/users/{user}/conversations/{conversationId}/messages
{
content: editedContent // empty string to remove
contenttype: "text"
messagetype: "RichText"
skypeeditedid: "4059726727402763698" // clientmessageid
}
Hi,
I get a Unable to register an endpoint
error.
Just wondering what triggers this?
Thanks,
James
Not working with my Skype for business account.
(node:21336) UnhandledPromiseRejectionWarning: MicrosoftAccountLogin: Unable to login with MicrosoftAccount.
caused by WrongCredentials: Wrong credentials for the user "[email protected]"
I started receiving the following error last night. My account is no longer able to log in to skype using this library. Is it possible that the api has changed?
Unable to login with MicrosoftAccount.
MicrosoftAccountLogin: Unable to login with MicrosoftAccount.
caused by GetLiveToken: Unable to get the Live token for Skype
caused by LiveTokenNotFound: Unable to find the Live token. This token is normally found in the HTML response as the value of the element with the id "t". This error may be caused by a change in the Microsoft login workflow. HTML page: "<html><head><noscript>JavaScript required to sign in<meta http-equiv=\"Refresh\" content=\"0; URL=https://login.live.com/jsDisabled.srf?mkt=EN-US&lc=1033&uaid=08766b033f8f450ca7ad755e627193ec&client_flight=ReservedFlight33,ReservedFligh\"/></noscript><title>Continue</title><script type=\"text/javascript\">function OnBack(){}function OnNext(){}function DoSubmit(){var subt=false;if(!subt){subt=true;document.fmHF.submit();}}</script></head><body onload=\"javascript:DoSubmit();\"><form name=\"fmHF\" id=\"fmHF\" action=\"https://account.live.com/apps/upsell?app=Authenticator&mkt=EN-US&uiflavor=web&id=293290&ru=https://login.live.com/login.srf%3fid%3d293290%26opid%3d8F099F11057090DA%26opidt%3d1552929230\" method=\"post\" target=\"_top\"><input type=\"hidden\" name=\"client_flight\" id=\"client_flight\" value=\"ReservedFlight33,ReservedFligh\"><input type=\"hidden\" name=\"ipt\" id=\"ipt\" value=\"DU3HcN59A5aRRYHqRRY!A7pxEWFw7LWZ4Y!x1yNGsFfbHZTi4NIQPsjCeI*g21R3HB*lLAj9F9HHIdB8KQr9LFL2ETp46pT!YObubWX5Oma*DxSCS!W5M9r2mTqumIukKtjnu4hKqBFOW3uvPdVlkieVYhel1QiB3ZmwIMfTrHsbdh!Ogf8zDuFjTygkJYAIXU8cefAMOu62BXdHzGJu!yAEoI8MVJ4Gw6yq5ZrIu*tYzQ*4sPFLU8KynDh7fiDBF6Pf*8kiod0oiLkA47MlPT*!8k8mfTNHxoLCa5waRMNjDBtCZ7lq00rdTPxASLhdZvWlnv2d*bafEmrwnrwjKfdgMHVZaiGPdYLPFu7KPeUVsAb60pRs7eIRLMGmIAqM*NucQM088OjlZICfXU8hPuuHPvYuxkRxrdRJErU!VZ3eo*wqxgQdNhulH4E*Sf3mUx17KJZNLhYbuH*54FcJlFIMs9es0zqOX!fQRxc!P78s\"><input type=\"hidden\" name=\"pprid\" id=\"pprid\" value=\"e152605252064532\"><input type=\"hidden\" name=\"uaid\" id=\"uaid\" value=\"08766b033f8f450ca7ad755e627193ec\"></form></body></html>"
Hello! Nice work) We use your project in matrix-skype-puppet. Is there any way to add someone from contacts to the chat group/conversation using your api? Maybe it's somehow possible by sending them 'share link' but I can't find how to get it?
function login(){
const statePath = sysPath.resolve(__dirname, "api-state.json");
try {
const stateContent = fs.readFileSync(statePath).toString("utf8");
const apiContext = JSON.parse(stateContent);
return skypeHttp.connect({
state: apiContext,
verbose: false
});
} catch (err) {
return promptCredentials()
.then((credentials) => skypeHttp.connect({
credentials: credentials,
verbose: false
}));
}
}
If I use this then in the resultant api object getState is not defined.
Hello!
It's seems to me the best solution should be to add "X-Client-Version": "0/0.0.0.0"
to headers in send-image.js
. It helps me in my project, I can make pull request with it. But maybe there is some other problems which i can't catch.
async function run() {
const api: Api = await connect({credentials: {username: "", password: ""}});
for (const contact of await api.getContacts()) {
console.log(contact);
}
}
Returns only perhaps a dozen contacts. Do you know how a "contact" is defined by Skype? I have hundreds of contacts and I'm curious if I need to use paging or something to work through them all?
Thanks for this.
In the following snippet you can see that it is assumed that ev.resource.from.username
is defined, but then, the existence of ev.resource
is checked. So if ev.resource
is definitely there, why check for it? Should the conditional be changed, then, to not assume ev.resource.from.username
is a true object path in every event?
For context, I am looking at this because I'm actually interested in self-sent messages. I'm puzzled as to why there is a comment here saying there would be an infinite-loop. I'm using the generic event
event in order to pick up self-sent messages now as a result, although I'd have preferred the Text/RichText
ones.
Lines 93 to 101 in 08666d1
// Prevent infinite-loop (echo itself)
if (ev.resource.from.username === this.context.username) {
return;
}
if (ev && ev.resource && ev.resource.type === "Text") {
this.emit("Text", ev.resource);
} else if (ev && ev.resource && ev.resource.type === "RichText") {
this.emit("RichText", ev.resource);
If getMessages
is not called for more than 2 minutes, the current endpoint is disconnected.
Trying to perform any call with the registrationToken
leads to an error 404: {"errorCode":729,"message":"You must create an endpoint before performing this operation."}
.
We should detect this kind of error and register a new endpoint.
i'm trying to make text bold (using asterisks) or italic (using underscores_) and send it to skype, but skype does not render it correctly. Is there a way how I can force text to be formatted when i'm sending it over skype-http ?
Thanks,
Alex
i'm using the "getConact" method to get the details of a bot user, and the display name is empty.
is there a different way to get the display name?
For example calling after awaiting the connect:
fs.writeFileSync("state.json", JSON.stringify(await api.getState()));
then for when connecting doing:
let state = fs.readFileSync("state.json", 'utf8');
let api = await skypeHttp.connect({ verbose: true, state: JSON.parse(state) });
will periodically not connect properly, and will not throw an error either. I have added inside the normal connect T/C:
await api.setStatus("Online");
as if it doesn't connect right this command will fail.
skypeHttp.connect
state resuming should always throw an error if resuming from state does not work (even if we have to make a no-op call after loading state to the skype service to make sure we are all good).
#36 added project files for Visual Studio 2017.
Ideally, the project should be independent of the IDE / editor. The current project files have hard-coded directory paths and forced us to comment the editorconfig setting for encoding. This is not an ideal solution but at least it allows to work with VS2017. I'd like to keep this issue open until the issue is fixed in VS2017.
If you use VS2017, please let me know if the project and solution files are still needed.
We should provide a way to perform a clean disconnection.
when you have an invalid login the error (even with a full BT) is a bit cryptic:
Unhandled rejection due to: [object Promise]={}: Error: Expected value of Skype token to be a string
at Object.<anonymous> (C:\temp\skytest\node_modules\skype-http\dist\lib-es2015\lib\providers\lib\providers\microsoft-account.ts:77:11)
at Generator.next (<anonymous>)
at fulfilled (C:\temp\skytest\node_modules\skype-http\dist\lib-es2015\lib\providers\microsoft-account.js:4:58)
at process._tickDomainCallback (internal/process/next_tick.js:135:7)
Do you want to try/catch on this to make it more apartent or better inspect the returned data to determine if it is a login failure? I can submit a PR if you want to specify direction.
Acquired SkypeToken
Acquired RegistrationToken
{ net: Unable to subscribe to resources: statusCode: 403 body:
at /laptop/node_modules/skype-http/dist/lib-es2015/lib/login.js:163:35
at Generator.next ()
at fulfilled ( /laptop/node_modules/skype-http/dist/lib-es2015/lib/login.js:4:58)
at process._tickCallback (internal/process/next_tick.js:109:7) name: 'net', data: {} }
Looking at the logs it seems that in april this would happen at a maximum a few times a day (and on average maybe once every few days)
"An error happened while processing the polled messages":
Error: read ECONNRESET
at exports._errnoException (util.js:1050:11)
at TLSWrap.onread (net.js:581:26)
However recently it has become near constant. Upon connect it can almost certainly occur (sometimes during the login itself). Reconnecting right away using the new token also fails falling back to user/pass.
Using a proxy through the same server the web client does not exhibit similar behavior (all poll requests are successful).
Hi everyone, I am working with Skpy, I have used following code for two months, but this morning it suddenly returns this error
########################################################################
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\skpy\main.py", line 67, in init
self.conn.readToken()
File "C:\ProgramData\Anaconda3\lib\site-packages\skpy\conn.py", line 301, in readToken
raise SkypeAuthException("Token file has expired")
skpy.core.SkypeAuthException: Token file has expired
########################################################################
Here is my code:
import time
from pygame import mixer
while True:
localtime = time.localtime(time.time())
if localtime[3] >= 9 and localtime[3] < 16:
break
print("already break at " + str(localtime[3]) + ":" + str(localtime[4]))
i = 0
j = 0
k = 0
Skype('xxxx', 'xxxx', ".tokens-fred.2")
sk = Skype(tokenFile=".tokens-fred.2")
print(sk.conn)
mixer.init()
mixer.music.load("666.mp3") # the music should be under same folder with this file
while True:
j += 1
if j>8:
time.sleep(200)
ms = sk.chats["xxxx.ac"].getMsgs()
if len(ms)>= 10:
print("init..." + str(len(ms)))
elif len(ms)!=0:
if i != 0:
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
print(ms)
mixer.music.play()
i += 1
else:
k += 1
print("checking..." + str(k))
Since v0.0.5
, the rewrite of library is almost finished.
We should update the REAMDE.md
to reflect the current state of the package.
Hello, I keep getting
(node:16828) UnhandledPromiseRejectionWarning: net: Failed to accept contact
after using
const invites = await api.getContactInvites() console.log(
${invites.length} pending invitation) await api.acceptContactRequest(invites[0].mri)
invites[0].mri is valid name, I added a console.log on accept-request-contact.js, its seems it retourn 404 page
Edit :
console.log(apiUri.authRequestAccept(apiContext.username, contactUsername))
is returning
https://api.skype.com/users/<myskype>/contacts/auth-request/<invites[0].mri id>/accept
so url seems correctly formated, but not working anymore?
node:3103) UnhandledPromiseRejectionWarning: MicrosoftAccountLogin: Unable to login with MicrosoftAccount.
caused by GetLiveToken: Unable to get the Live token for Skype
caused by LiveTokenNotFound: Unable to find the Live token. This token is normally found in the HTML response as the value of the element with the id "t". This error may be caused by a change in the Microsoft login workflow. HTML page: "<!-- Copyright (C) Microsoft Corporation. All rights reserved. --><!DOCTYPE html><!-- ServerInfo: BY1PPF45C32AC58 2019.12.11.17.32.58 Live1 Unknown LocVer:0 --><!-- PreprocessInfo: azbldrun:AzBuildCU-Ha11, 2019-12-11T17:27:10.0518177-08:00 - Version: 16,0,28426,6 --><!-- RequestLCID: 1033, Market:EN-US, PrefCountry: US, LangLCID: 1033, LangISO: EN --><html dir=\"ltr\" lang=\"EN-US\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/><meta http-equiv=\"X-U
Hello! How can i add new user using this API after he ask me for adding on Skype?
2.48.0
to 2.48.1
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
@types/request is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
typings install --save npm:skype-http
typings ERR! message Unable to read typings for "request". The author of "skype-http" needs to check the entry paths in "package.json" are up to date
typings ERR! caused by ENOENT: no such file or directory, open 'C:\temp\skytest\node_modules\skype-http\node_modules\request\index.d.ts\index.d.ts'
typings ERR!
I am not a typings expert for how these imports normally go, it seems it reads from the local folder so not requiring a remote source to be updated. I am guessing it is because request does not have any typings locally. I am guessing modifying typings.json to specify the npm typings source (not sure why it doesn't pickup from package.json). I can investigate further if the immediate answer is not apparent to someone more familiar.
I'm using Javascript and and I'm doing the following code
skypeHttp.connect(
{ credentials: {
username: "**********",
password: "***********"
},
verbose: true
}).then(function(skypeAccount) {
//var contacts = skypeHttp.Api.getContacts();
var contacts = skypeAccount.Api.getContacts();
response.send(200, JSON.stringify(contacts, null,2));
}).catch(function(error) {
var data = { error: "true", message: error.message};
response.send(422,data);
});
I get the following error
Cannot read property 'getContacts' of undefined
Am I doing something wrong?
It is not possible to compile a program using skype-http and typescript 3. The reason is that you are using an old version of kryo that includes *.ts files in the package. And these *.ts files are now no longer compilable with standard tsconfig compiler options. I am attaching a package.json and index.js that illustrates the problem.
To reproduce:
npm i
./node_modules/.bin/tsc
You will get a bunch of compile errors like the ones in compilation-results.txt
in the sample project.
To fix this, I believe you will have to upgrade to the latest kryo version, but looks like there are API changes to handle as well.
To provide guarantees about the interfaces of the objects returned by the API, we use a models for the responses and check the types at runtime (as of v0.0.14
).
We would like this model to be relatively strict to detect API changes as quickly as possible and provide a faithful documentation of the data. This strict model combined with thrown errors on failure makes it currently hard to use the library in the face of unexpected responses due to changes.
A quick fix was merged to ignore extra keys.
To improve the situation, here is the approach I'd like to follow:
.getContacts
and .rawGetContacts
).console.warn(...)
)This kind of support will be rolled out over multiple versions but I wanted to write down the general direction for this part of the lib.
Hey!
I've noticed you were working on skyweb, but now you've created this fork. It appears you plan on working a bit on this. What's the current state of the library? Would you recommend this to replace skyweb?
I've had a few issues with skyweb not throwing catchable errors. Will you be implementing an 'error' event, and/or a 'disconnected' event?
Thanks,
Phil
There appears to be some kind of memory leak after running this for a longer period of time (only noticed after a few days)
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [node]
2: 0x55f2e3fefb6e [node]
3: v8::Utils::ReportOOMFailure(char const*, bool) [node]
4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [node]
5: v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [node]
6: v8::internal::String::SlowFlatten(v8::internal::Handle<v8::internal::ConsString>, v8::internal::PretenureFlag) [node]
7: v8::internal::String::Flatten(v8::internal::Handle<v8::internal::String>, v8::internal::PretenureFlag) [node]
8: v8::String::WriteUtf8(char*, int, int*, int) const [node]
9: node::StringBytes::Write(v8::Isolate*, char*, unsigned long, v8::Local<v8::Value>, node::encoding, int*) [node]
10: node::StreamBase::Writev(v8::FunctionCallbackInfo<v8::Value> const&) [node]
11: void node::StreamBase::JSMethod<node::TLSWrap, &node::StreamBase::Writev>(v8::FunctionCallbackInfo<v8::Value> const&) [node]
12: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) [node]
13: 0x55f2e36f5236 [node]
14: v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [node]
15: 0x15935b1840bd
While right before that i get a bunch of
An error was detected:
{ poll: Unable to poll the messages
caused by UnexpectedHttpStatus: Received response with the HTTP status code `404` but expected one of [200]. Request: {"uri":"https://db5-client-s.gateway.messenger.live.com/v1/users/ME/endpoints/SELF/subscriptions/0/poll","cookies":{"idx":{"skype.com":{"/":{"SC":{"key":"SC","value":"CC=:CCY=:LC=en:LIM=:TM=1500725790:TS=1500725790:TZ=:VAT=:VER=","expires":"2018-07-22T12:16:30.000Z","maxAge":31536000,"domain":"skype.com","path":"/","hostOnly":false,"creation":"2017-07-22T12:16:30.744Z","lastAccessed":"2017-07-22T12:16:34.025Z"}}},"login.skype.com":{"/":{"login-vi":{"key":"login-vi","value":"-snip-","domain":"login.skype.com","path":"/","hostOnly":true,"creation":"2017-07-22T12:16:30.745Z","lastAccessed":"2017-07-22T12:16:30.746Z"}}},"login.live.com":{"/":{"uaid":{"key":"uaid","value":"-snip-","domain":"login.live.com","path":"/","secure":true,"httpOnly":true,"extensions":["version=1"],"hostOnly":false,"creation":"2017-07-22T12:16:31.279Z","lastAccessed":"2017-07-22T12:16:31.818Z"},"MSPRequ":{"key":"MSPRequ","value":"lt=1500725791&co=1&id=293290","domain":"login.live.com","path":"/","secure":true,"httpOnly":true,"extensions":["version=1"],"hostOnly":true,"creation":"2017-07-22T12:16:31.280Z","lastAccessed":"2017-07-22T12:16:31.350Z"},"MSPOK":{"key":"MSPOK","expires":"1980-10-30T16:00:00.000Z","domain":"login.live.com","path":"/","httpOnly":true,"extensions":["version=1"],"hostOnly":false,"creation":"2017-07-22T12:16:31.280Z","lastAccessed":"2017-07-22T12:16:31.819Z"},"CkTst":{"key":"CkTst","value":"1500725791349","domain":"login.live.com","path":"/","hostOnly":true,"pathIsDefault":true,"creation":"2017-07-22T12:16:31.349Z","lastAccessed":"2017-07-22T12:16:31.350Z"},"PPAuth":{"key":"PPAuth","value":"-snip-","domain":"login.live.com","path":"/","secure":true,"httpOnly":true,"extensions":["version=1"],"hostOnly":false,"creation":"2017-07-22T12:16:31.819Z","lastAccessed":"2017-07-22T12:16:31.819Z"},"MSPShared":{"key":"MSPShared","expires":"1980-10-30T16:00:00.000Z","domain":"login.live.com","path":"/","httpOnly":true,"hostOnly":false,"creation":"2017-07-22T12:16:31.819Z","lastAccessed":"2017-07-22T12:16:31.819Z"},"MSPPre":{"key":"MSPPre","value":"-snip-","expires":"2037-12-30T16:00:00.000Z","domain":"login.live.com","path":"/","secure":true,"hostOnly":false,"creation":"2017-07-22T12:16:31.820Z","lastAccessed":"2017-07-22T12:16:31.820Z"},"MSPCID":{"key":"MSPCID","value":"-snip-","expires":"2037-12-30T16:00:00.000Z","domain":"login.live.com","path":"/","secure":true,"httpOnly":true,"hostOnly":false,"creation":"2017-07-22T12:16:31.820Z","lastAccessed":"2017-07-22T12:16:31.820Z"},"WLOpt":{"key":"WLOpt","value":"credtype=1&act=[1]","expires":"2037-12-30T16:00:00.000Z","domain":"login.live.com","path":"/","secure":true,"hostOnly":false,"creation":"2017-07-22T12:16:31.820Z","lastAccessed":"2017-07-22T12:16:31.820Z"},"MSPVis":{"key":"MSPVis","value":"$293290","domain":"login.live.com","path":"/","secure":true,"hostOnly":false,"creation":"2017-07-22T12:16:31.820Z","lastAccessed":"2017-07-22T12:16:31.820Z"},"LOpt":{"key":"LOpt","value":"1","domain":"login.live.com","path":"/","extensions":["version=1"],"hostOnly":false,"creation":"2017-07-22T12:16:31.820Z","lastAccessed":"2017-07-22T12:16:31.820Z"},"SDIDC":{"key":"SDIDC","value":"-snip-","expires":"2037-12-30T16:00:00.000Z","domain":"login.live.com","path":"/","secure":true,"httpOnly":true,"extensions":["version=1"],"hostOnly":false,"creation":"2017-07-22T12:16:31.821Z","lastAccessed":"2017-07-22T12:16:31.821Z"},"MSPSoftVis":{"key":"MSPSoftVis","value":"@72198325083833620@:@","domain":"login.live.com","path":"/","secure":true,"extensions":["version=1"],"hostOnly":false,"creation":"2017-07-22T12:16:31.821Z","lastAccessed":"2017-07-22T12:16:31.821Z"},"MSPBack":{"key":"MSPBack","value":"0","domain":"login.live.com","path":"/","extensions":["version=1"],"hostOnly":false,"creation":"2017-07-22T12:16:31.821Z","lastAccessed":"2017-07-22T12:16:31.821Z"}}},"live.com":{"/":{"PPLState":{"key":"PPLState","value":"1","domain":"live.com","path":"/","extensions":["version=1"],"hostOnly":false,"creation":"2017-07-22T12:16:31.819Z","lastAccessed":"2017-07-22T16:52:10.263Z"}}}}},"headers":{"RegistrationToken":"registrationToken=-snip-; expires=1500812190; endpointId={2b4a70a9-4ff3-493c-8371-d21e1b46f2c8}"}}, Response: [object Object]
at Object.create (/home/sorunome/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/errors/http.js:21:16)
at MessagesPoller.<anonymous> (/home/sorunome/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/polling/messages-poller.js:300:68)
at Generator.next (<anonymous>)
at fulfilled (/home/sorunome/matrix-puppet-skype/node_modules/skype-http/dist/lib-es2015/lib/polling/messages-poller.js:4:58)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:169:7)
name: 'poll',
data: {},
cause:
Where at cause it just keeps on repeating those.
Perhaps the polling is written in some recursive way which would also explain the memory leak? Is it handled already to automatically re-authenticate after your token expires?
When I authenticate with email & password. I got the error message like this
(node:25289) UnhandledPromiseRejectionWarning: MicrosoftAccountLogin: Unable to login with MicrosoftAccount.
caused by GetLiveToken: Unable to get the Live token for Skype
caused by LiveTokenNotFound: Unable to find the Live token. This token is normally found in the HTML response as the value of the element with the id "t". This error may be caused by a change in the Microsoft login workflow. HTML page: "<html><head><noscript>JavaScript required to sign in<meta http-equiv=\"Refresh\" content=\"0; URL=https://login.live.com/jsDisabled.srf?mkt=EN-US&lc=1033\"/></noscript><title>Continue</title><script type=\"text/javascript\">function OnBack(){}function OnNext(){}function DoSubmit(){var subt=false;if(!subt){subt=true;document.fmHF.submit();}}</script></head><body onload=\"javascript:DoSubmit();\"><form name=\"fmHF\" id=\"fmHF\" action=\"https://account.live.com/profile/accrue?ru=https://login.live.com/login.srf%3flc%3d1033%26sf%3d1%26id%3d293290%26tw%3d18000%26fs%3d0%26ts%3d-1%26sec%3d%26mspp_shared%3d1%26seclog%3d10%26claims%3d%26wa%3dwsignin1.0%26wp%3dMBI_SSL%26ru%3dhttps://lw.skype.com/login/oauth/proxy%253fclient_id%253d578134%2526site_name%253dlw.skype.com%2526redirect_uri%253dhttps%25253A%25252F%25252Fweb.skype.com%25252F%26scft%3dDbdixGEEsYVYtSMRexvtSGz9dkNyQGDZqkClix2G*znkYP0Hh*qQBICgyxa4nloaROWzMeZ1Olo2J8iVNX14EPDHkItfZyFEUxFcDbgXPrQcHRcrEVrEbV*wM3*gEnwpTZIiDqV7sMXApnlOM3R*yQad!nbKO4gJwGsguQc4TJjqgiQkZUyZ5GGWpDkqf3HOkpMi30USNdGg4E5VxONytUg%2524%26contextid%3d1421ED09C4944B7A&mkt=EN-US&uiflavor=web&id=293290&uaid=bd7e9c2899ec4619ba5eebe1dc1c5189&if=80000000&af=20&saf=0\" method=\"post\" target=\"_top\"><input type=\"hidden\" name=\"ipt\" id=\"ipt\" value=\"DVgh6HqomK5mjRaCJ3kLLyDwHwx7!20*wDdWEaSXAg!1SM15T8OkkASM6*sxwzkaDHexcYGIKM25!8GwSj05TnJA!UhFFP!DjKkncKG!pMUR*DCiPVSDo5Eo2vou6fSOWKtcjWEzzocvKbDbSaIvG!fodZMcvVQtZqVTInrOh!67c1bN2dC1pa*Q8eSMQ1LoEZ6IdF0n0uTKcNOLaAhNOM!gi7VHft4jOp36xYOjDwCk02CJVQ5wYMqHJXjyl3fT1lKTp!dHPnGgvBZOiWqfroaSxbl0cUmlycEySH6Q8Sve*NRp0F98KBYYAb*nhh*Upf8MsosizDC7mT!GMxC3qiZPAPe2rJs7iINpnBpsXXhytoGswCeLa2RUq75JaQdmSrJbeisUSYREnsXfIBi5Zj42rWUMXG27iqgGzAeCJ2HX6OR4F14TneU5I!Q1CJZHAaPDitV5FN31vkCBmGMaXMKEpkksUKvC2g3OSdSXGs2N\"><input type=\"hidden\" name=\"pprid\" id=\"pprid\" value=\"5ea9cd736ac21d19\"></form></body></html>"
at Object.create (/home/devops/grablingo-api/node_modules/skype-http/errors/microsoft-account/get-live-token.js:17:16)
at scrapLiveToken (/home/devops/grablingo-api/node_modules/skype-http/providers/microsoft-account.js:216:61)
at getLiveToken (/home/devops/grablingo-api/node_modules/skype-http/providers/microsoft-account.js:138:16)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:25289) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:25289) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
This is the code I used:
const api = await connect({
credentials: {
username: process.env.skype_email,
password: process.env.skype_password,
}
});
It ran successfullly on my local computer. But when I deployed it on DigitalOcean (a server service). It raised the above error.
I have no idea how to deal with it. Any suggestions for me?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.