├── requirements_tele.txt ├── requirements_pyro.txt ├── LICENSE ├── genstring_pyro.py ├── genstring_tele.py └── README.md /requirements_tele.txt: -------------------------------------------------------------------------------- 1 | Telethon 2 | -------------------------------------------------------------------------------- /requirements_pyro.txt: -------------------------------------------------------------------------------- 1 | pyrogram==2.0.106 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 HEIMAN PICTURES 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /genstring_pyro.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021 HEIMAN PICTURES 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | 10 | # The above copyright notice and this permission notice shall be included in all 11 | # copies or substantial portions of the Software. 12 | 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | # SOFTWARE. 20 | 21 | 22 | import pyrogram 23 | from pyrogram import Client 24 | 25 | heiman_ = """ 26 | xx xx xxxxxx xx xxx xxx xxx xxx xx 27 | xx xx xx xx xxxx xxxx xx xx xxxx xx 28 | xxxxxxxx xxxxxx xx xx xx xx xx xxxxxxx xx xx xx 29 | xx xx xx xx xx xxx xx xx xx xx xxxx 30 | xx xx xxxxxx xx xx x xx xx xx xx xxx 31 | ▲ ---➤ HeimanPictures/String-Session HC▼ 32 | 33 | Copyright (C) 2021 by HeimanPictures@Github, < https://github.com/HeimanPictures >. 34 | This file is part of dev project, 35 | and is released under the "MIT License Agreement". 36 | Please see < https://github.com/HeimanPictures/String-Session/blob/Main/LICENSE > 37 | All rights reserved. 38 | """ 39 | 40 | print(heiman_) 41 | api_id = input("Enter Your API ID: \n") 42 | api_hash = input("Enter Your API HASH : \n") 43 | 44 | with Client("Heiman", api_id=api_id, api_hash=api_hash) as bot_: 45 | first_name = (bot_.get_me()).first_name 46 | string_session_ = f"String Session For {first_name} \nThanks To @HeimanSupports \n{bot_.export_session_string()}" 47 | bot_.send_message("me", string_session_) 48 | print(f"String Has Been Sent To Your Saved Message : {first_name}") 49 | -------------------------------------------------------------------------------- /genstring_tele.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021 HEIMAN PICTURES 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | 10 | # The above copyright notice and this permission notice shall be included in all 11 | # copies or substantial portions of the Software. 12 | 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | # SOFTWARE. 20 | 21 | 22 | from telethon.sessions import StringSession 23 | from telethon.sync import TelegramClient 24 | 25 | heiman_ = """ 26 | xx xx xxxxxx xx xxx xxx xxx xxx xx 27 | xx xx xx xx xxxx xxxx xx xx xxxx xx 28 | xxxxxxxx xxxxxx xx xx xx xx xx xxxxxxx xx xx xx 29 | xx xx xx xx xx xxx xx xx xx xx xxxx 30 | xx xx xxxxxx xx xx x xx xx xx xx xxx 31 | ▲ ---➤ HeimanPictures/String-Session HC▼ 32 | 33 | Copyright (C) 2021 by HeimanPictures@Github, < https://github.com/HeimanPictures >. 34 | This file is part of dev project, 35 | and is released under the "MIT License Agreement". 36 | Please see < https://github.com/HeimanPictures/String-Session/blob/Main/LICENSE > 37 | All rights reserved. 38 | """ 39 | 40 | print(heiman_) 41 | api_id = input("Enter Your API ID: \n") 42 | api_hash = input("Enter Your API HASH : \n") 43 | 44 | with TelegramClient(StringSession(), api_id, api_hash) as client: 45 | print("Check your Telegram Saved Messages to copy the STRING_SESSION value") 46 | session_string = client.session.save() 47 | saved_messages_template = """Support: @HeimanSupports 48 | STRING_SESSION: {} 49 | ⚠️ Please be carefull to pass this value to third parties""".format(session_string) 50 | client.send_message("me", saved_messages_template, parse_mode="html") 51 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # String-Session 2 | 3 | ## Instructions 4 | 5 | This is a String Session Generator Script Which Is Accessible By Using environment (eg. Termux). It Quite Fast So Use It. Useful To Heroku User In Making Userbots. 6 | 7 | Made With ❤️ Using By Heiman 8 | 9 | 10 | ## Installation 11 | 12 | - [Pyrogram String](https://github.com/HeimanPictures/String-Session/wiki/Installation#pyrogram-session) 13 | 14 | - [Telethon String](https://github.com/HeimanPictures/String-Session/wiki/Installation#telethon) 15 | 16 | 17 | ## Wiki 18 | 19 | - [How To Get API](https://github.com/HeimanPictures/String-Session/wiki/APIs#telegram-apis) 20 | 21 | - [Installation](https://github.com/HeimanPictures/String-Session/wiki/Installation#installation-to-get-string-session) 22 | 23 | - [Pyrogram String](https://github.com/HeimanPictures/String-Session/wiki/Installation#pyrogram-session) 24 | 25 | - [Telethon String](https://github.com/HeimanPictures/String-Session/wiki/Installation#telethon) 26 | 27 | 28 | ## My Experience 29 | 30 | Its Fast Then I Thought. Its Good For Users Who Use Userbot Or Other Bot Which are Deployed(Hosted) Through VPS By One Click 31 | This Will Help You In Getting The String Session in Two Unique Python Library Which Are Pyrogram And Telethon Library. The 32 | Session Will Be Sent To Your Accounts Saved Message. 33 | 34 | If Any Issues Open An [Issues](https://github.com/HeimanPictures/String-Session/issues/new/choose) Or Contact Me Through My [Support](https://github.com/HeimanPictures/String-Session/blob/Main/README.md#support) Group.. 35 | 36 | ### Remember 37 | 38 | - Don't Ever Share Session Code With Others And Change Session Codes, if you have Shared. 39 | - Don't Depend On Others For This Little Job. 40 | - Try Using Phone Number When Running The Script As It Will Not Give Error and Won't Be Lost. 41 | - The Verification Code Will Be Sent To Telegram Account. So, There Is No Need Of Your Phone 42 | Number On Your Device (For Virtual Number Users). 43 | - Don't Use Single String To All Bots Which Needs String Session As Vars. As You Can Generate 44 | New Session. 45 | 46 | ### To-Do 47 | 48 | - Add Repl.it Support ( Coming Soon ) 49 | - If Any Issues Then Resolving It.. 50 | 51 | ## Support 52 | 53 | 54 | ## [License](./LICENSE) 55 | 56 | ``` 57 | Copyright (c) 2021 HEIMAN PICTURES 58 | Permission is hereby granted, free of charge, to any person obtaining a copy 59 | of this software and associated documentation files (the "Software"), to deal 60 | in the Software without restriction, including without limitation the Rights 61 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 62 | copies of the Software, and to permit persons to whom the Software is 63 | furnished to do so, subject to the following conditions: 64 | The above copyright notice and this permission notice shall be included in all 65 | copies or substantial portions of the Software. 66 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 67 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 68 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 69 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 70 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 71 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 72 | SOFTWARE. 73 | ``` 74 | 75 | ## Credits 76 | 77 | - [HeimanCreation](https://telegram.dog/HeimanCreation) 78 | - Thanks To [Dan's](https://github.com/delivrance) [Pyrogram Library](https://github.com/pyrogram/pyrogram) 79 | - Thanks To [Lonami's](https://github.com/Lonami) [Telethon Library](https://github.com/LonamiWebs/Telethon) 80 | --------------------------------------------------------------------------------