Skip to content

Commit bef0f0a

Browse files
authored
Merge branch 'master' into beta
2 parents aaf490b + add3089 commit bef0f0a

File tree

6 files changed

+224
-71
lines changed

6 files changed

+224
-71
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
# push:
16+
# branches: [ master, beta ]
17+
# pull_request:
18+
# # The branches below must be a subset of the branches above
19+
# branches: [ master, beta ]
20+
schedule:
21+
- cron: '0 4 * * 6'
22+
workflow_dispatch:
23+
24+
jobs:
25+
analyze:
26+
name: Analyze
27+
runs-on: ubuntu-latest
28+
permissions:
29+
actions: read
30+
contents: read
31+
security-events: write
32+
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
language: [ 'python' ]
37+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
38+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
39+
40+
steps:
41+
- name: Checkout repository
42+
uses: actions/checkout@v3
43+
44+
# Initializes the CodeQL tools for scanning.
45+
- name: Initialize CodeQL
46+
uses: github/codeql-action/init@v2
47+
with:
48+
languages: ${{ matrix.language }}
49+
# If you wish to specify custom queries, you can do so here or in a config file.
50+
# By default, queries listed here will override any specified in a config file.
51+
# Prefix the list here with "+" to use these queries and those in the config file.
52+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
53+
54+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55+
# If this step fails, then you should remove it and run the build manually (see below)
56+
- name: Autobuild
57+
uses: github/codeql-action/autobuild@v2
58+
59+
# ℹ️ Command-line programs to run using the OS shell.
60+
# 📚 https://git.io/JvXDl
61+
62+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63+
# and modify them (or add more) to build your code if your project
64+
# uses a compiled language
65+
66+
#- run: |
67+
# make bootstrap
68+
# make release
69+
70+
- name: Perform CodeQL Analysis
71+
uses: github/codeql-action/analyze@v2

CreateMongoDB.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# How to create a MongoDB URL in 10min ?
2+
###### (if you are lazy to do that, go on [`personal usage only`](https://github.com/EDM115/unzip-bot/tree/personal_only) branch
3+
4+
1. Go to [MongoDB website](https://mongodb.com/cloud/atlas/register)
5+
*(skip steps 2 and 3 if you already have an account, just create a new cluster)*
6+
2. On the account setup page, choose wisely your Organization name and Project name (you can't change that). Select Python as preferred language
7+
3. Choose `Create a cluster` on the `Shared Clusters` category (the free one)
8+
4. Choose `Azure` as provider and `Netherlands` as region, then click on `Create Cluster` (it takes 1-5 minutes, but don't close the window !)
9+
5. When it's done, click on `Network Access` on left panel
10+
1. `Add IP Address`
11+
2. `Allow access from anywhere` (because Heroku IP addresses changes everytime)
12+
3. `Confirm` (it can take up to 2 minutes)
13+
6. Click on `Clusters` on left panel
14+
1. `Connect`
15+
2. Create a Database User (remember the credentials you choose !)
16+
3. `Choose a connection method`
17+
4. `Connect with your application`
18+
5. Choose `Python` as Driver
19+
6. Choose `3.6 or later` as Version
20+
7. Copy the URL
21+
7. Replace `<password>` with the one you chosen at step 6.ii
22+
23+
## You're done :partying_face:
24+
### Now use that as `MONGODB_URL`

README.md

Lines changed: 89 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div align="center">
2-
3-
# Unarchiver Bot **BETA**
2+
3+
# Unarchiver Bot
44

55
## A Telegram bot to extract various types of archives
66

@@ -11,64 +11,93 @@
1111

1212
</div>
1313

14-
## Demo 🥰
15-
16-
[@unzip_edm115bot](https://t.me/unzip_edm115bot)
17-
⚠️ From 22h to 06h UTC+1, this beta version is running. Try it at your own risks…
18-
19-
## **THIS IS BETA BRANCH, DON'T BE MAD AT ME IF IT'S BUGGY 😞**
20-
21-
## Important note : it may no longer be deployable. More informations here : https://blog.heroku.com/next-chapter
22-
23-
## WORKAROUNDS (bugs to fix and features to add) 💀
24-
25-
- [ ] The ETA isn't accurate
26-
- [x] Adding a `/db` command that returns a list of all users + banned ones **WILL BE IMPROVED**
27-
- [x] Add a translation (start a CrowdIn dude) [![Crowdin](https://badges.crowdin.net/unzip-bot-edm115/localized.svg)](https://crowdin.com/project/unzip-bot-edm115)
28-
- [ ] Get informations with smth like `/user {id}`, that returns his state (banned or not) + lastly uploaded files (5 last with link to channel/group message) + how many files he sent + size of all of them. The user could also get those infos with a `/me` command
29-
- [x] Add a `/dbdive` that returns an url where we can visualize the db online **CAN BE IMPROVED**
30-
- [x] Add status of extraction in logs (uploaded, started, extracted, failed (+ error), what is the password, …) **HALF-DONE**
31-
- [ ] Add more things to `/stats` like average speed, …
32-
- [ ] Add cancel process button for downloads and an emergency `/redbutton` one
33-
- [x] Add an emergency `/restart` command that can be run **even** if the bot hanged up
34-
- [x] Add permathumb support `/addthumb` `/delthumb`
35-
- [x] Auto use `/clean` when a task failed **NOT 100% accurate**
36-
- [x] Keep the archives 5 hours in server just in case someone resend the same (no download twice) **Will probably NOT be implemented**
37-
- [ ] Add group support. You add bot to group as admin, then reply to any file with `/extract`. Then you choose where goes the files (group or PM), and drop here do the instructions (pass or no, what to upload, …)
38-
39-
## Things to work with on v5 :
40-
41-
Check [issue #38](https://github.com/EDM115/unzip-bot/issues/38)
42-
43-
### Possible v6 ...?
44-
45-
- [ ] Web interface
46-
- [ ] Match with nextgenleech
47-
- [ ] yt-dlp included. because why not
48-
- [ ] Integration with upcomming ARCHIVER BOT 👀
49-
- [ ] Compatibility with premium accounts (4Gb upload)
50-
51-
## Fixed/added :partying_face:
52-
53-
#### Fixed :
54-
55-
- [x] _Download speed stays constant, depending of what we have at begining. If the download started at 3 Mb/s, it will stay like that through all the process and can't evolve_ Fixed with new PyroGram | **Since the latest update I did, download speed is fastest than ever (8-10 Mb/s) and upload speed is around 20-25 Mb/s**
56-
- [x] _Unzipping normally a password protected archive makes crash the bot 😭_ Fixed here : [1](https://github.com/EDM115/unzip-bot/commit/41adcb26d11fa0df2425e7aa1654c88d5a4b2151), [2](https://github.com/EDM115/unzip-bot/commit/e933acdf3b61ee1cc92a194cb53c491537405c8f), [3](https://github.com/EDM115/unzip-bot/commit/db59780a14cbde2da53e739f62462719a3c95cd4), [4](https://github.com/EDM115/unzip-bot/commit/9ed2bb8621f8fb874912d8d7b103af83075c0202), [5](https://github.com/EDM115/unzip-bot/commit/5d6004aaae3a494b2e2a83b9c980cb3c4b94c731)
57-
- [x] _Looks like some "blank" users are added to the db, including a banned one Actually, the banned db can exist only if at least 1 value is inside. So, since owner have all rights, his ID can be added into it, the owner status will bypass it. But I noticed also other banned users while no `/ban` command were done_ [Fix here](https://github.com/EDM115/unzip-bot/commit/6b69084cd7337453effb7e9015d2c77da83f8d81)
58-
- [x] [_Reply markup error_](https://github.com/EDM115/unzip-bot/issues/2)
59-
- [x] _Some profile links doesn't work_ Fixed with replacing `.` with `_`
60-
61-
#### Added :
62-
63-
- [x] _Adding file name in description while uploading_ [Added here](https://github.com/EDM115/unzip-bot/commit/37e534873baba858583729f27927f42da368ed86)
64-
- [x] _Add a `/cleanall` for forcing the server reset and freeing space_
65-
66-
## Take a look about the [changelog](https://github.com/EDM115/unzip-bot/blob/beta/changelog.md) 😏
67-
68-
[![Deploy me 🥺](https://www.herokucdn.com/deploy/button.svg)](https://www.heroku.com/deploy?template=https://github.com/EDM115/unzip-bot/tree/beta)
69-
[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/ENIia-?referralCode=EDM115)
14+
</br></br>
7015

16+
## Demo 🥰
17+
[@unzip_edm115bot](https://t.me/unzip_edm115bot)
18+
⚠️ From 00h to 08h UTC+1, the [beta](https://github.com/EDM115/unzip-bot/tree/beta) version is running. Try it at your own risks…
19+
20+
## Features 👀
21+
- Extract various types of archives like `rar`, `zip`, `tar`, `7z`, `tar.xz`, …
22+
- Supports password protected archives
23+
- Extract archives from direct links
24+
- Broadcast messages to users
25+
- Ban / Unban users from using your bot
26+
- Send logs in a private channel/group
27+
- Can run only one extract per user at a time
28+
- Download speed : 4-12 Mb/s, can be even more if you're lucky
29+
- Upload speed : 15-25 Mb/s, unexpectedly
30+
- Fast to answer and process tasks
31+
- And some other features 🔥 Dive into the code to find them 🤭
32+
33+
## Simple version 😌
34+
I made a special version if you only want to use it personally. Works smoother but with less features.
35+
[**👉 Try it here 👈**](https://github.com/EDM115/unzip-bot/tree/personal_only)
36+
37+
## Bugs to fix and features to add 💀
38+
[**Check the beta branch to find them. They normally also are on the master one**](https://github.com/EDM115/unzip-bot/blob/beta/README.md#bugs-to-fix-and-features-to-add-)
39+
Those are things that are fixed/added regarding to [`original repo`](https://github.com/EDM115/unzip-bot#license--copyright-%EF%B8%8F)
40+
41+
## Config vars 📖
42+
- `APP_ID` - Your APP ID. Get it from [my.telegram.org](my.telegram.org)
43+
- `API_HASH` - Your API_HASH. Get it from [my.telegram.org](my.telegram.org)
44+
- `BOT_OWNER` - Your Telegram Account ID. Get it from [@MissRose_bot](https://t.me/MissRose_bot) (Start the bot and send <samp>/info</samp> command).
45+
- `BOT_TOKEN` - Bot Token of Your Telegram Bot. Get it from [@BotFather](https://t.me/BotFather)
46+
- `MONGODB_URL` - Your MongoDB URL ([**tutorial here**](./CreateMongoDB.md))
47+
- `LOGS_CHANNEL` - Make a private channel and get its ID (search on Google if you don't know how to do). Using a group works as well, just add [`Rose`](https://t.me/MissRose_bot?startgroup=startbot), then send `/id` (In both cases, make sure to add your bot to the channel/group as an admin !)
48+
49+
## Commands ✍️
50+
Copy-paste those to BotFather when he asks you for them
51+
```
52+
clean - Remove your archives from my servers 🚮♻️
53+
mode - Upload things as Doc 📄 or Video 📹 (alias : /setmode)
54+
start - Alive check 😪 Also useful after updates 🥰
55+
```
56+
Admin only commands (better to not include them)
57+
```
58+
stats - Get detailed stats about users and server
59+
broadcast - Reply with this to a message to send it at every user
60+
ban - {id of user}
61+
unban - {id of user}
62+
```
63+
64+
## Deploy 🚧
65+
Deploying is easy 🥰 You can deploy this bot in Heroku or in a VPS ♥️
66+
**Star 🌟 Fork 🍴 and Deploy 📤**
67+
68+
> ⚠️ Note :
69+
> We are using arch linux. But why 🤔
70+
>
71+
> Because arch’s p7zip package is the only maintained version of the [original p7zip](http://p7zip.sourceforge.net/) package with some additional features !
72+
---
73+
#### The lazy way
74+
[![Deploy me 🥺](https://www.herokucdn.com/deploy/button.svg)](https://www.heroku.com/deploy?template=https://github.com/EDM115/unzip-bot/tree/master)
75+
(if you're in a fork, make sure to replace the template URL with your repo’s one)
76+
77+
---
78+
#### The legacy way
79+
```bash
80+
git clone -b master https://github.com/EDM115/unzip-bot.git
81+
cd unzip-bot
82+
pip3 install -r requirements.txt
83+
# Arch linux only ↓
84+
sudo pacman -S p7zip
85+
# Edit config.py with your own values
86+
bash start.sh
87+
```
88+
---
89+
**DONE 🥳 enjoy the bot !** Be sure to follow me on [Github](https://github.com/EDM115) and Star 🌟 this repo to show some support 🥺
90+
91+
7192
## Found a bug 🐞
72-
73-
If you found a bug in this beta version please open an [issue](https://github.com/EDM115/unzip-bot/issues) or report it at [me](https://t.me/EDM115)
93+
If you found a bug in this bot please open an [issue](https://github.com/EDM115/unzip-bot/issues) or report it at [me](https://t.me/EDM115)
7494
Same if you have any feature request ☺️
95+
96+
## License & Copyright 👮‍♀️
97+
```
98+
Copyright (c) 2022 EDM115
99+
100+
This Unarchiver Bot repository is licensed under MIT License (https://github.com/EDM115/unzip-bot/blob/master/LICENSE)
101+
Enjoy copying and modifying, but always mention me
102+
```
103+
• Inspired by Itz-fork/Nexa’s work, but with additional features and bug fixes. This is a maintained repo of the [original](https://github.com/Itz-fork/Unzipper-Bot)

app.json

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,42 @@
11
{
2-
"name": "Unzipper Bot [BETA VERSION]",
3-
"description": "A Telegram Bot to Extract Various Types Of Archives",
4-
"logo": "https://telegra.ph/file/00e96e3c5dda1c9ab40da.jpg",
5-
"keywords": ["7z", "zip", "rar", "Telegram Bot", "unzipper bot"],
6-
"website": "https://t.me/EDM115bots",
7-
"repository": "https://github.com/EDM115/unzip-bot",
8-
"success_url": "https://t.me/EDM115bots",
9-
"env": {
10-
"APP_ID": {
11-
"description": "Your APP_ID from my.telegram.org",
12-
"required": true
2+
"name": "Unzipper Bot",
3+
"description": "A Telegram Bot to Extract Various Types Of Archives",
4+
"logo": "https://telegra.ph/file/426207477776ffa00519f.png",
5+
"keywords": [
6+
"7z",
7+
"zip",
8+
"rar",
9+
"Telegram Bot",
10+
"unzipper bot"
11+
],
12+
"website": "https://t.me/EDM115bots",
13+
"repository": "https://github.com/EDM115/unzip-bot",
14+
"success_url": "https://t.me/EDM115bots",
15+
"env": {
16+
"APP_ID": {
17+
"description": "Your APP_ID from my.telegram.org",
18+
"required": true
19+
},
20+
"API_HASH": {
21+
"description": "Your API_HASH from my.telegram.org",
22+
"required": true
23+
},
24+
"BOT_OWNER": {
25+
"description": "Telegram Id of your account",
26+
"required": true
27+
},
28+
"BOT_TOKEN": {
29+
"description": "Your Bot Token From @BotFather",
30+
"required": true
31+
},
32+
"MONGODB_URL": {
33+
"description": "Your MongoDB url, Get it from https://www.mongodb.com/",
34+
"required": true
35+
},
36+
"LOGS_CHANNEL": {
37+
"description": "Id of a channel, can also be a group",
38+
"required": true
39+
}
1340
},
1441
"API_HASH": {
1542
"description": "Your API_HASH from my.telegram.org",

unzipper/modules/bot_data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ class Messages:
9191
START_TEXT = """
9292
Hi **{}** 👋, I'm **Unarchiver bot** 🥰
9393
94+
9495
I can extract archives like `zip`, `rar`, `tar`, …
9596
9697
**Made with ❤️ by @EDM115bots**

unzipper/modules/commands.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ async def clean_my_files(_, message: Message):
5454
reply_markup=Buttons.CLN_BTNS)
5555

5656

57+
5758
@Client.on_message(filters.command("help"))
5859
async def help_me(_, message: Message):
5960
await message.reply_text(text=Messages.HELP_TXT,

0 commit comments

Comments
 (0)