mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 09:26:37 +03:00
Removed references to TLSharp since they're "ads"
See their #197 issue.
This commit is contained in:
parent
a7c7fdd2e4
commit
0fe0cdf682
17
README.md
17
README.md
|
@ -1,10 +1,6 @@
|
||||||
# Telethon
|
# Telethon
|
||||||
**Telethon** is Telegram client implementation in Python. This project's _core_ is **completely based** on
|
**Telethon** is Telegram client implementation in Python which uses the latest available API of Telegram.
|
||||||
[TLSharp](https://github.com/sochix/TLSharp). All the files which are fully based on it will have a notice
|
The project's **core only** is based on TLSharp, a C# Telegram client implementation.
|
||||||
on the top of the file. Also don't forget to have a look to the original project.
|
|
||||||
|
|
||||||
The files without the previously mentioned notice are no longer part of TLSharp itself, or have enough modifications
|
|
||||||
to make them entirely different.
|
|
||||||
|
|
||||||
# Table of contents
|
# Table of contents
|
||||||
- [Why Telethon?](#why-telethon)
|
- [Why Telethon?](#why-telethon)
|
||||||
|
@ -20,19 +16,20 @@ to make them entirely different.
|
||||||
- [Plans for the future](#plans-for-the-future)
|
- [Plans for the future](#plans-for-the-future)
|
||||||
|
|
||||||
## Why Telethon?
|
## Why Telethon?
|
||||||
> Why should I bother with Telethon? You already mentioned [TLSharp](https://github.com/sochix/TLSharp).
|
> Why should I bother with Telethon? There are more mature projects already, such as
|
||||||
> [telegram-cli](https://github.com/vysheng/tg) has also been around for a long while. And we have the
|
> [telegram-cli](https://github.com/vysheng/tg) with even (limited) Python support. And we have the
|
||||||
> [official](https://github.com/telegramdesktop/tdesktop) [clients](https://github.com/DrKLO/Telegram)!
|
> [official](https://github.com/telegramdesktop/tdesktop) [clients](https://github.com/DrKLO/Telegram)!
|
||||||
|
|
||||||
With Telethon you don't really need to know anything before using it. Create a client with your settings.
|
With Telethon you don't really need to know anything before using it. Create a client with your settings.
|
||||||
Connect. You're ready to go.
|
Connect. You're ready to go.
|
||||||
|
|
||||||
Being written on Python, Telethon can run as a script under any environment you wish, (yes,
|
Being written **entirely** on Python, Telethon can run as a script under any environment you wish, (yes,
|
||||||
[Android too](https://f-droid.org/repository/browse/?fdfilter=termux&fdid=com.termux)). You can schedule it,
|
[Android too](https://f-droid.org/repository/browse/?fdfilter=termux&fdid=com.termux)). You can schedule it,
|
||||||
or use it in any other script you have. Want to send a message to someone when you're available? Write a script.
|
or use it in any other script you have. Want to send a message to someone when you're available? Write a script.
|
||||||
Do you want check for new messages at a given time and find relevant ones? Write a script.
|
Do you want check for new messages at a given time and find relevant ones? Write a script.
|
||||||
|
|
||||||
An official client has a feature which Telethon doesn't? [Implement it easily](#how-to-add-more-functions-to-telegramclient).
|
Hungry for more API calls which the `TelegramClient` class doesn't _seem_ to have implemented?
|
||||||
|
Please read [this section](#using-more-than-just-telegramclient).
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
### Python modules
|
### Python modules
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# This file is based on TLSharp
|
|
||||||
# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/MTProto/Crypto/AES.cs
|
|
||||||
import pyaes
|
import pyaes
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# This file is based on TLSharp
|
|
||||||
# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/MTProto/Crypto/AuthKey.cs
|
|
||||||
from utils import BinaryWriter, BinaryReader
|
from utils import BinaryWriter, BinaryReader
|
||||||
import utils
|
import utils
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# This file is based on TLSharp
|
|
||||||
# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/MTProto/Crypto/Factorizator.cs
|
|
||||||
from random import randint
|
from random import randint
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# This file is based on TLSharp
|
|
||||||
# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/MTProto/Crypto/RSA.cs
|
|
||||||
import utils
|
import utils
|
||||||
from utils import BinaryWriter
|
from utils import BinaryWriter
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,3 @@
|
||||||
# This file is based on TLSharp
|
|
||||||
# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/Auth/Authenticator.cs
|
|
||||||
# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/Auth/Step1_PQRequest.cs
|
|
||||||
# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/Auth/Step2_DHExchange.cs
|
|
||||||
# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/Auth/Step3_CompleteDHExchange.cs
|
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import utils
|
import utils
|
||||||
from utils import BinaryWriter, BinaryReader
|
from utils import BinaryWriter, BinaryReader
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# This file is based on TLSharp
|
|
||||||
# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/Network/MtProtoPlainSender.cs
|
|
||||||
import time
|
import time
|
||||||
import random
|
import random
|
||||||
from utils import BinaryWriter, BinaryReader
|
from utils import BinaryWriter, BinaryReader
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# This file is based on TLSharp
|
|
||||||
# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/Network/MtProtoSender.cs
|
|
||||||
import gzip
|
import gzip
|
||||||
from errors import *
|
from errors import *
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# This file is based on TLSharp
|
|
||||||
# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/Network/TcpTransport.cs
|
|
||||||
from network import TcpClient
|
from network import TcpClient
|
||||||
from binascii import crc32
|
from binascii import crc32
|
||||||
from errors import *
|
from errors import *
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# This file structure is based on TLSharp
|
|
||||||
# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/TelegramClient.cs
|
|
||||||
import platform
|
import platform
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from hashlib import md5
|
from hashlib import md5
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# This file is based on TLSharp
|
|
||||||
# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/Requests/MTProtoRequest.cs
|
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# This file is based on TLSharp
|
|
||||||
# https://github.com/sochix/TLSharp/blob/master/TLSharp.Core/Session.cs
|
|
||||||
from os.path import isfile as file_exists
|
from os.path import isfile as file_exists
|
||||||
import time
|
import time
|
||||||
import pickle
|
import pickle
|
||||||
|
|
|
@ -50,7 +50,7 @@ class UtilsTests(unittest.TestCase):
|
||||||
with BinaryWriter() as writer:
|
with BinaryWriter() as writer:
|
||||||
writer.write_int(0x60469778)
|
writer.write_int(0x60469778)
|
||||||
buffer = writer.get_bytes()
|
buffer = writer.get_bytes()
|
||||||
valid = b'\x78\x97\x46\x60' # Tested written bytes using TLSharp and C#'s MemoryStream
|
valid = b'\x78\x97\x46\x60' # Tested written bytes using C#'s MemoryStream
|
||||||
|
|
||||||
assert buffer == valid, "Written type should be {} but is {}".format(list(valid), list(buffer))
|
assert buffer == valid, "Written type should be {} but is {}".format(list(valid), list(buffer))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user