From dd2439e9b8eb5a4341adabe33f44e7d78645c656 Mon Sep 17 00:00:00 2001 From: Anton Grigoryev Date: Wed, 11 Mar 2015 18:42:20 +0300 Subject: [PATCH 1/6] README.md file First Readme commit --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..e4bda737 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +# About this repo +This is Telegram API for python. +Main aim is to implement MTProto protocol Telegram API on pure Python (not wrapped CLI) +We'll try to make it work on Python 2 as well as 3. + +Detailed description of API and protokol can be found here: +https://core.telegram.org/api +https://core.telegram.org/mtproto + +Repo doesn't contain any credentials to connect Telegram servers. +You can get your credentials from http://my.telegram.org + +You shoud plase in the root of your repo 2 files: +- credentials +- rsa.pub + +Config example for "credentials" file: + +``` +[App data] +api_id: 12345 +api_hash: 1234567890abcdef1234567890abcdef +ip_adress: 112.134.156.178 +port: 443 +``` +rsa.pub contains your RSA key. + + +# testing.py + +testing.py is used to test functionality of modules. +Now it makes steps from https://core.telegram.org/mtproto/samples-auth_key: +- sends PQ request to server +- parses the result +- factorizes PQ From d92d969e137c73492ddce80962dbff644413386e Mon Sep 17 00:00:00 2001 From: chidea Date: Thu, 12 Mar 2015 00:46:02 +0900 Subject: [PATCH 2/6] gitignore fix for jetbrains ide --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 633e675f..651f3957 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# JetBrains IDE +.idea/ + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] From 9f023c2c7871080d4321944daafd47a860c45c5a Mon Sep 17 00:00:00 2001 From: Anton Grigoryev Date: Wed, 11 Mar 2015 19:05:34 +0300 Subject: [PATCH 3/6] Update README.md --- README.md | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e4bda737..1b6da783 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,23 @@ This is Telegram API for python. Main aim is to implement MTProto protocol Telegram API on pure Python (not wrapped CLI) We'll try to make it work on Python 2 as well as 3. -Detailed description of API and protokol can be found here: +Detailed description of API and protocol can be found here: https://core.telegram.org/api https://core.telegram.org/mtproto -Repo doesn't contain any credentials to connect Telegram servers. -You can get your credentials from http://my.telegram.org +# Structure -You shoud plase in the root of your repo 2 files: +- mtproto.py +- testing.py +- prime.py +- credentials +- rsa.pub + +## Credentials +Repo doesn't contain any credentials to connect Telegram servers. +You can get yours from http://my.telegram.org + +You should place 2 files in the root of your repo: - credentials - rsa.pub @@ -25,11 +34,25 @@ port: 443 ``` rsa.pub contains your RSA key. +## mtproto.py -# testing.py +Contains functions to work with MTproto protocol: +- TL schema parsing +- serializing and deserializing +- manage connections to server +- send and receive messages + +## testing.py testing.py is used to test functionality of modules. Now it makes steps from https://core.telegram.org/mtproto/samples-auth_key: - sends PQ request to server - parses the result - factorizes PQ + +## prime.py +prime.py is used in PQ factorization. It has been copied from https://stackoverflow.com/questions/4643647/fast-prime-factorization-module + +## TL schema +We use JSON format TL Shema. TL Schema file contains information about objects and methods, it is located in TL_schema.JSON file in the root of repo. It is fully equivalent to JSON TL Schema from +https://core.telegram.org/schema/mtproto-json From f11a55e7d6d3f39c9c6e7d9830c48cb9d8dd9617 Mon Sep 17 00:00:00 2001 From: Anton Grigoryev Date: Wed, 11 Mar 2015 19:21:30 +0300 Subject: [PATCH 4/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1b6da783..819d842d 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Config example for "credentials" file: [App data] api_id: 12345 api_hash: 1234567890abcdef1234567890abcdef -ip_adress: 112.134.156.178 +ip_address: 112.134.156.178 port: 443 ``` rsa.pub contains your RSA key. From ec4904f20504582f9a6791a080d4348e9d72cc40 Mon Sep 17 00:00:00 2001 From: chidea Date: Thu, 12 Mar 2015 01:52:28 +0900 Subject: [PATCH 5/6] readme.md - added chat room link, structured descriptions and future plan --- README.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 819d842d..03b9c450 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,23 @@ +[![Join the chat at https://gitter.im/griganton/telepy](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/griganton/telepy?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + # About this repo This is Telegram API for python. Main aim is to implement MTProto protocol Telegram API on pure Python (not wrapped CLI) -We'll try to make it work on Python 2 as well as 3. +### Future plan +1. [ ] We'll try to make it work on Python 2 as well as 3. +2. [ ] Follow up the same functionality of CLI API. + 1. [ ] Serialize/Deserialize + 2. [ ] Send and receive PQ authorization with server [doc] (https://core.telegram.org/mtproto/samples-auth_key) + 3. [ ] Send and receive service messages with server like logging in to server [doc] (https://core.telegram.org/mtproto/service_messages) + +### Useful start points to join Detailed description of API and protocol can be found here: -https://core.telegram.org/api -https://core.telegram.org/mtproto +* https://core.telegram.org/api +* https://core.telegram.org/mtproto + +API registration is needed to be done by yourself at http://my.telegram.org +Follow Structure - Credentials for provide it your API information. # Structure @@ -49,7 +61,7 @@ Now it makes steps from https://core.telegram.org/mtproto/samples-auth_key: - sends PQ request to server - parses the result - factorizes PQ - + ## prime.py prime.py is used in PQ factorization. It has been copied from https://stackoverflow.com/questions/4643647/fast-prime-factorization-module From 19d4f5a9582941e8df9c031d1a43a80b09741ce6 Mon Sep 17 00:00:00 2001 From: chidea Date: Thu, 12 Mar 2015 01:54:52 +0900 Subject: [PATCH 6/6] readme.md fix --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 03b9c450..ab38eb89 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,11 @@ This is Telegram API for python. Main aim is to implement MTProto protocol Telegram API on pure Python (not wrapped CLI) ### Future plan -1. [ ] We'll try to make it work on Python 2 as well as 3. -2. [ ] Follow up the same functionality of CLI API. - 1. [ ] Serialize/Deserialize - 2. [ ] Send and receive PQ authorization with server [doc] (https://core.telegram.org/mtproto/samples-auth_key) - 3. [ ] Send and receive service messages with server like logging in to server [doc] (https://core.telegram.org/mtproto/service_messages) +- [ ] We'll try to make it work on Python 2 as well as 3. +- [ ] Follow up the same functionality of CLI API. + - [ ] Serialize/Deserialize + - [ ] Send and receive PQ authorization with server [doc] (https://core.telegram.org/mtproto/samples-auth_key) + - [ ] Send and receive service messages with server like logging in to server [doc] (https://core.telegram.org/mtproto/service_messages) ### Useful start points to join Detailed description of API and protocol can be found here: