Spaces:
Build error
Build error
Commit
Β·
9a7fe9d
1
Parent(s):
0cee3b2
Upload 3 files
Browse files- unzipper/README.md +72 -0
- unzipper/__init__.py +31 -0
- unzipper/__main__.py +38 -0
unzipper/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Unzipper
|
| 2 |
+
This is where the main stuff happens.
|
| 3 |
+
|
| 4 |
+
# TOC
|
| 5 |
+
- [Directory structure](#directory-structure)
|
| 6 |
+
- [Folders](#folders)
|
| 7 |
+
|
| 8 |
+
## Directory structure
|
| 9 |
+
Directory tree structure of [unzipper](/unzipper) folder.
|
| 10 |
+
|
| 11 |
+
```
|
| 12 |
+
βββ client
|
| 13 |
+
βΒ Β βββ caching.py
|
| 14 |
+
βΒ Β βββ __init__.py
|
| 15 |
+
βΒ Β βββ patcher.py
|
| 16 |
+
βΒ Β βββ pyro_client.py
|
| 17 |
+
βββ database
|
| 18 |
+
βΒ Β βββ cloud.py
|
| 19 |
+
βΒ Β βββ __init__.py
|
| 20 |
+
βΒ Β βββ language.py
|
| 21 |
+
βΒ Β βββ split_arc.py
|
| 22 |
+
βΒ Β βββ thumbnail.py
|
| 23 |
+
βΒ Β βββ upload_mode.py
|
| 24 |
+
βΒ Β βββ users.py
|
| 25 |
+
βββ helpers_nexa
|
| 26 |
+
βΒ Β βββ buttons.py
|
| 27 |
+
βΒ Β βββ checks.py
|
| 28 |
+
βΒ Β βββ __init__.py
|
| 29 |
+
βΒ Β βββ utils.py
|
| 30 |
+
βββ __init__.py
|
| 31 |
+
βββ lib
|
| 32 |
+
βΒ Β βββ backup_tool
|
| 33 |
+
βΒ Β βΒ Β βββ __init__.py
|
| 34 |
+
βΒ Β βββ downloader
|
| 35 |
+
βΒ Β βΒ Β βββ errors.py
|
| 36 |
+
βΒ Β βΒ Β βββ __init__.py
|
| 37 |
+
βΒ Β βββ extractor
|
| 38 |
+
βΒ Β βΒ Β βββ errors.py
|
| 39 |
+
βΒ Β βΒ Β βββ __init__.py
|
| 40 |
+
βΒ Β βββ __init__.py
|
| 41 |
+
βββ localization
|
| 42 |
+
βΒ Β βββ defaults
|
| 43 |
+
βΒ Β βΒ Β βββ buttons.json
|
| 44 |
+
βΒ Β βββ en
|
| 45 |
+
βΒ Β βΒ Β βββ messages.json
|
| 46 |
+
βΒ Β βΒ Β βββ README.md
|
| 47 |
+
βΒ Β βββ languages.json
|
| 48 |
+
βΒ Β βββ README.md
|
| 49 |
+
βΒ Β βββ si
|
| 50 |
+
βΒ Β βΒ Β βββ messages.json
|
| 51 |
+
βΒ Β βΒ Β βββ README.md
|
| 52 |
+
βΒ Β βββ templates
|
| 53 |
+
βΒ Β βββ messages-template.json
|
| 54 |
+
βββ __main__.py
|
| 55 |
+
βββ modules
|
| 56 |
+
βΒ Β βββ admin.py
|
| 57 |
+
βΒ Β βββ callbacks.py
|
| 58 |
+
βΒ Β βββ extract.py
|
| 59 |
+
βΒ Β βββ __init__.py
|
| 60 |
+
βΒ Β βββ settings.py
|
| 61 |
+
βΒ Β βββ user_utils.py
|
| 62 |
+
βββ README.md
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
## Folders
|
| 67 |
+
- [client](client) - Contains the custom client (inherited from `pyrogram.Client` class)
|
| 68 |
+
- [database](database) - Contains functions to handle database queries
|
| 69 |
+
- [modules](modules) - Contains pyrogram modules
|
| 70 |
+
- [lib](lib) - Contains modules (downloader, extractor)
|
| 71 |
+
- [helpers_nexa](helpers_nexa) - Contains helper functions, classes
|
| 72 |
+
- [localization](localization) - Contains language files and templates
|
unzipper/__init__.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ===================================================================== #
|
| 2 |
+
# Copyright (c) 2022 Itz-fork #
|
| 3 |
+
# #
|
| 4 |
+
# This program is distributed in the hope that it will be useful, #
|
| 5 |
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
| 6 |
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
|
| 7 |
+
# See the GNU General Public License for more details. #
|
| 8 |
+
# #
|
| 9 |
+
# You should have received a copy of the GNU General Public License #
|
| 10 |
+
# along with this program. If not, see <http://www.gnu.org/licenses/> #
|
| 11 |
+
# ===================================================================== #
|
| 12 |
+
|
| 13 |
+
import logging
|
| 14 |
+
from pyromod import listen
|
| 15 |
+
from .client import UnzipperBot
|
| 16 |
+
from .client.caching import update_cache
|
| 17 |
+
|
| 18 |
+
# Logging stuff
|
| 19 |
+
logging.getLogger().setLevel(logging.INFO)
|
| 20 |
+
logging.getLogger("pyrogram").setLevel(logging.WARNING)
|
| 21 |
+
|
| 22 |
+
# Update cache
|
| 23 |
+
update_cache()
|
| 24 |
+
|
| 25 |
+
# CLient
|
| 26 |
+
unzip_client = UnzipperBot()
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
# Buttons
|
| 30 |
+
from .helpers_nexa.buttons import Unzipper_Buttons
|
| 31 |
+
Buttons = Unzipper_Buttons()
|
unzipper/__main__.py
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ===================================================================== #
|
| 2 |
+
# Copyright (c) 2022 Itz-fork #
|
| 3 |
+
# #
|
| 4 |
+
# This program is distributed in the hope that it will be useful, #
|
| 5 |
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
| 6 |
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
|
| 7 |
+
# See the GNU General Public License for more details. #
|
| 8 |
+
# #
|
| 9 |
+
# You should have received a copy of the GNU General Public License #
|
| 10 |
+
# along with this program. If not, see <http://www.gnu.org/licenses/> #
|
| 11 |
+
# ===================================================================== #
|
| 12 |
+
|
| 13 |
+
import logging
|
| 14 |
+
from pyrogram import idle
|
| 15 |
+
from os import makedirs, path
|
| 16 |
+
from config import Config
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
if __name__ == "__main__":
|
| 20 |
+
logging.info(" >> Checking download location...")
|
| 21 |
+
if not path.isdir(Config.DOWNLOAD_LOCATION):
|
| 22 |
+
makedirs(Config.DOWNLOAD_LOCATION)
|
| 23 |
+
|
| 24 |
+
logging.info(" >> Applying custom methods...")
|
| 25 |
+
from .client import init_patch
|
| 26 |
+
init_patch()
|
| 27 |
+
|
| 28 |
+
logging.info(" >> Starting client...")
|
| 29 |
+
from unzipper import unzip_client
|
| 30 |
+
from unzipper.modules import *
|
| 31 |
+
unzip_client.start()
|
| 32 |
+
|
| 33 |
+
logging.info(" >> Checking Log Channel...")
|
| 34 |
+
from .helpers_nexa.checks import check_log_channel
|
| 35 |
+
check_log_channel()
|
| 36 |
+
|
| 37 |
+
logging.info("Bot is active Now! Join @NexaBotsUpdates")
|
| 38 |
+
idle()
|