Skip to content

Commit

Permalink
v1.0 - Stable (Itz-fork#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
Itz-fork authored Jul 24, 2022
1 parent a1b8ca5 commit 3b3e340
Show file tree
Hide file tree
Showing 55 changed files with 2,167 additions and 1,387 deletions.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# v1.0

- Refactored the code
- Rewrote most of the modules
- Better logging
- Better error handling
- Multi-language support
- Cache data to reduce database reads
- Added progress bar for direct link downloads
- Added support for multi-part 7z archives (archives ends with file extensions like `.001`, `.002`, etc.)
- Changed thumbnail database to [telegra.ph](https://telegra.ph/)
- Fixed various bugs
- Fixed RPCErrors:
- `REPLY_MARKUP_TOO_LONG`
- `ENTITY_BOUNDS_INVALID`
- Fixed `RuntimeWarning: coroutine 'x' was never awaited` caused due to calling async function synchronously
- Fixed saving upload mode in banned users database collection
15 changes: 7 additions & 8 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2022 Itz-fork. <https://github.com/Itz-fork>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this telegram Bot, but changing it is not allowed.
of this license document, but changing it is not allowed.

Preamble

Expand Down Expand Up @@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

Unzipper-Bot An Open Source Telegram Bot Project to Extract Various Types Of Archives.
Copyright (C) 2022 Itz-fork
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -645,15 +645,14 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

Unzipper-Bot Copyright (C) 2022 Itz-fork

<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
Expand All @@ -672,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
<https://www.gnu.org/licenses/why-not-lgpl.html>.
61 changes: 38 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,39 @@
A Telegram Bot to Extract Various Types Of Archives
</p>

</br></br>
</br>

## Table of content

- [Features](#features)
- [Config vars](#configs-)
- [Deployment](#deploy-)
- [Heroku](#with-heroku)
- [Self-hosting](#self-hosting)
- [Bug report](#found-a-bug-)
- [Support](#support-)
- [License and Copyright](#license--copyright-)

</br>

## Features

- Extract various types of archives like `rar`, `zip`, `tar`, `7z`, `tar.xz` etc.
- Password support for extracting
- Extract archives from direct links
- Support for multipart archives (archives ending with `.001`, `.002`, etc.)
- Support for multi-part 7z archives (archives ends with file extensions like `.001`, `.002`, etc.)
- Custom thumbnail support
- Muti-language support ([More info](https://github.com/Itz-fork/Unzipper-Bot/tree/main/unzipper/localization#readme))
- Upload files larger than 2GB to gofile.io
- Backup extracted files to gofile.io
- Custom thumbnail support
- Broadcast Messages to users
- Broadcast messages to users
- Ban / Unban users from using your bot
- Check stats of the bot (users, hardware usage, etc.)
- Send logs in a private channel

And Some other features 🔥!

</br>

## Configs 📖

Expand All @@ -35,38 +50,40 @@ And Some other features 🔥!
- Add your bot to the channel as an admin
- Send a message and copy it's link
- The link'll be something like `https://t.me/c/12345/1`. Simply copy the `12345` part from it and add `-100` to the beginning of it. Now it'll be something like `-10012345`. That's your channel id!
- `DB_CHANNEL` - Private channel to save thumbnails. Defaults to `LOGS_CHANNEL` value. However it's **recommended** to use separate channel
- `GOFILE_TOKEN` - Your gofile.io API token from your [profile page](https://gofile.io/myProfile)

</br>


## Deploy 👀

Deploying is easy 🤫! You can deploy this bot in Heroku or in a VPS ♥️! **Star 🌟 Fork 🍴 and Deploy**

> Note ⚠️
> This branch is using arch linux.
>
> But Why 🤔? Cuz arch's p7zip package is the only maintained version of [original p7zip](http://p7zip.sourceforge.net/) package with some additional features
Deploying is easy 🤫! You can deploy this bot in Heroku or in a linux VPS ♥️! **Star 🌟 Fork 🍴 and Deploy**

#### With Heroku
### With Heroku

<a href="https://www.heroku.com/deploy?template=https://github.com/Itz-fork/Unzipper-Bot/tree/arch">
<img src="https://www.herokucdn.com/deploy/button.svg">
</a>

---

#### Self-Hosting
### Self-Hosting

> Note ⚠️
>
> It's recomended to use a arch linux based distro to deploy this bot as the original author of the p7zip package has not made an update since 2016, but the arch linux's version is packaged from an active fork.
```bash
git clone -b arch https://github.com/Itz-fork/Unzipper-Bot.git
git clone https://github.com/Itz-fork/Unzipper-Bot.git
cd Unzipper-Bot
pip3 install -r requirements.txt

# Arch linux only
sudo pacman -S p7zip
# Arch linux
sudo pacman -Syyu
sudo pacman -S zstd p7zip

# Ubuntu
sudo add-apt-repository universe
sudo apt update
sudo apt install p7zip-full p7zip-rar zstd
```

<h4 align="center">Edit config.py with your own values</h4>
Expand All @@ -75,20 +92,17 @@ sudo pacman -S p7zip
bash start.sh
```

---

**DONE 🥳, Enjoy The Bot! Be sure to Follow Me on [Github](https://github.com/Itz-fork) and Star 🌟 this repo to Show some support 😍!**

</br>


## Found a bug 🐞?

If you found a bug in this bot please open an [issue](https://github.com/Itz-fork/Unzipper-Bot/issues) or report it at the [Support Group](#support).
If you found a bug in this bot please open an [issue](https://github.com/Itz-fork/Unzipper-Bot/issues) or report it at the [Support group](#support).

</br>


## Support 💙

<a href="https://t.me/NexaBotsUpdates">
Expand All @@ -107,5 +121,6 @@ If you found a bug in this bot please open an [issue](https://github.com/Itz-for
Copyright (c) 2022 Itz-fork
This Unzipper-Bot repository is licensed under GPLv3 License (https://github.com/Itz-fork/Unzipper-Bot/blob/master/LICENSE)
Copying or Modifying Any Part of the code without permission is strictly prohibited
Copying or modifying any part of this code without permission or proper credits is strictly prohibited
```
10 changes: 4 additions & 6 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"name": "Unzipper Bot",
"name": "Unzip Bot",
"description": "A Telegram Bot to Extract Various Types Of Archives",
"logo": "https://telegra.ph/file/dab7c08182e6d9e03bcef.jpg",
"keywords": [
"7z",
"Telegram Bot",
"unzipper bot"
"unzip bot",
"unarchive bot",
"extractor bot"
],
"website": "https://t.me/NexaBotsUpdates",
"repository": "https://github.com/Itz-fork/Unzipper-Bot",
Expand Down Expand Up @@ -35,10 +37,6 @@
"description": "Make a private channel and forward a message from that channel to @ChannelidHEXbot and Get this",
"required": true
},
"DB_CHANNEL": {
"description": "Make a private channel and forward a message from that channel to @ChannelidHEXbot and Get this",
"required": true
},
"GOFILE_TOKEN": {
"description": "Your gofile.io API token from your profile page",
"required": true
Expand Down
11 changes: 6 additions & 5 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
import os

class Config(object):
# Mandotory
APP_ID = int(os.environ.get("APP_ID"))
API_HASH = os.environ.get("API_HASH")
BOT_TOKEN = os.environ.get("BOT_TOKEN")
LOGS_CHANNEL = int(os.environ.get("LOGS_CHANNEL"))
DB_CHANNEL = int(os.environ.get("DB_CHANNEL")) or LOGS_CHANNEL
MONGODB_URL = os.environ.get("MONGODB_URL")
BOT_OWNER = int(os.environ.get("BOT_OWNER"))
MONGODB_URL = os.environ.get("MONGODB_URL")
GOFILE_TOKEN = os.environ.get("GOFILE_TOKEN")
# Optional
MAX_DOWNLOAD_SIZE = int(os.environ.get("MAX_DOWNLOAD_SIZE")) if os.environ.get("MAX_DOWNLOAD_SIZE") else 10737418240
# Constents
DOWNLOAD_LOCATION = f"{os.path.dirname(__file__)}/NexaBots"
TG_MAX_SIZE = 2040108421
# Gofile.io token
GOFILE_TOKEN = os.environ.get("GOFILE_TOKEN")
# Default chunk size (0.005 MB) Increase if you need faster downloads
CHUNK_SIZE = 1024 * 6
7 changes: 5 additions & 2 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/usr/bin/bash

VERSION="v1.0"
echo "
||| Unzipper Bot |||
||| Unzipper Bot - $VERSION |||
Copyright (c) 2022 Itz-fork
--> Join @NexaBotsUpdates
--> Follow Itz-fork on Github
"
python3 -m unzipper
python3 -m unzipper
72 changes: 72 additions & 0 deletions unzipper/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Unzipper
This is where the main stuff happens.

# TOC
- [Directory structure](#directory-structure)
- [Folders](#folders)

## Directory structure
Directory tree structure of [unzipper](/unzipper) folder.

```
├── client
│   ├── caching.py
│   ├── __init__.py
│   ├── patcher.py
│   └── pyro_client.py
├── database
│   ├── cloud.py
│   ├── __init__.py
│   ├── language.py
│   ├── split_arc.py
│   ├── thumbnail.py
│   ├── upload_mode.py
│   └── users.py
├── helpers_nexa
│   ├── buttons.py
│   ├── checks.py
│   ├── __init__.py
│   └── utils.py
├── __init__.py
├── lib
│   ├── backup_tool
│   │   └── __init__.py
│   ├── downloader
│   │   ├── errors.py
│   │   └── __init__.py
│   ├── extractor
│   │   ├── errors.py
│   │   └── __init__.py
│   └── __init__.py
├── localization
│   ├── defaults
│   │   └── buttons.json
│   ├── en
│   │   ├── messages.json
│   │   └── README.md
│   ├── languages.json
│   ├── README.md
│   ├── si
│   │   ├── messages.json
│   │   └── README.md
│   └── templates
│   └── messages-template.json
├── __main__.py
├── modules
│   ├── admin.py
│   ├── callbacks.py
│   ├── extract.py
│   ├── __init__.py
│   ├── settings.py
│   └── user_utils.py
└── README.md
```


## Folders
- [client](client) - Contains the custom client (inherited from `pyrogram.Client` class)
- [database](database) - Contains functions to handle database queries
- [modules](modules) - Contains pyrogram modules
- [lib](lib) - Contains modules (downloader, extractor)
- [helpers_nexa](helpers_nexa) - Contains helper functions, classes
- [localization](localization) - Contains language files and templates
Loading

0 comments on commit 3b3e340

Please sign in to comment.