ocilo / skype-http

Unofficial Skype API for Node.js via HTTP
https://ocilo.github.io/skype-http
MIT License
51 stars 24 forks source link

Unable to login: scrapping: Unable to retrieve the pie and etm keys from the login page #18

Closed mitchcapper closed 7 years ago

mitchcapper commented 7 years ago

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.

demurgos commented 7 years ago

Hi, thank you for opening this issue. Sorry for the response delay, I had some busy weeks lately. I still plan to support to skype-http and would like to work more on this in the next week.

I'll take some time in the next few days to at least fix the login issue and publish the missing releases to npm.

mitchcapper commented 7 years ago

Perfect, it would be good if there was some documentation on the goals of this project vs skyweb. The organization and code flow for this one seems better but I am not exactly aware of what the goals are.

demurgos commented 7 years ago

Hi, I finally took some time to work on your issue. It seems that it was related to the fact that the published package was outdated compared to the git repo. It used the old login method. I just published the current repo to npm so it should work (I also updated some dependencies and fixed the entry-point of the package).

The running example works for me. I am able to connect to Skype with the library and echo the messages. Unfortunately, I noticed that there is a problem when fetching the contacts, I'll look into that. I also did not completely checked yet if all the interfaces are properly exported.

If you look at the commit history of the project, you'll notice that it's a fork of Skyweb. I forked it about a year ago. I started by contributing to Skyweb, but the maintainer is not an active Github user so I had some troubles to merge my patches. The more I worked on it, the more I felt that the library had some design issues: there were some un-catchable errors, no checks for the received resources and even if the library was written in Typescript I feel that it wasn't really using its features. Even it has benefit a few patches, I had already made my decision to fork it. I started by writing all the type definitions for all the dependency tree of the library (I joined the types organization behind typings) and defining the interfaces for the API, and then implement it. My goal is to provide stronger guarantees about the objects returned by the API (through checks and normalization) and better error management, because scrapping/unofficial API calls are unreliable so the library should be resilient. I spent the last few months working on a library to formalize runtime checks for Typescript interfaces (I feel that it has now enough features to express the types used by skype-http but I feel it a bit heavy to write for the moment) and better errors based on Typescript's discriminated union types.

Overall, I am almost done with my other projects so I'll have more time to work on skype-http again. I agree that the priority will be to document it. I'll try to publish the version 0.1.0 by the end of June.

mitchcapper commented 7 years ago

Thanks @demurgos I am testing the new version now. Thanks for the background, I can submit a PR for the readme if you want that included on it for some backround. I think the goals of the project are great (and are happy to try and help).

mitchcapper commented 7 years ago

This is fixed can login and get events with the new version, also noticed the contact error covered in #20 .