imseldrith commited on
Commit
9a7fe9d
Β·
1 Parent(s): 0cee3b2

Upload 3 files

Browse files
Files changed (3) hide show
  1. unzipper/README.md +72 -0
  2. unzipper/__init__.py +31 -0
  3. 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()