├── setup
├── __init__.py
└── updater.py
├── runtime.txt
├── Procfile
├── Aptfile
├── heroku.yml
├── Dockerfile
├── stringsetup.py
├── requirements.txt
├── README.md
├── app.json
└── start
/setup/__init__.py:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/runtime.txt:
--------------------------------------------------------------------------------
1 | python-3.9.6
2 |
--------------------------------------------------------------------------------
/Procfile:
--------------------------------------------------------------------------------
1 | worker: bash start
2 |
--------------------------------------------------------------------------------
/Aptfile:
--------------------------------------------------------------------------------
1 | pv
2 | tree
3 | mediainfo
4 | p7zip-full
5 |
--------------------------------------------------------------------------------
/heroku.yml:
--------------------------------------------------------------------------------
1 | build:
2 | docker:
3 | worker: Dockerfile
4 | run:
5 | worker: python3 -m userbot
6 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM JMTHON-AR/JM-THON:alpine
2 |
3 | #clonning repo
4 | RUN git clone https://github.com/JMTHON-AR/JM-THON.git /root/userbot
5 | #working directory
6 | WORKDIR /root/userbot
7 |
8 | # Install requirements
9 | RUN pip3 install -U -r requirements.txt
10 |
11 | ENV PATH="/home/userbot/bin:$PATH"
12 |
13 | CMD ["python3","-m","userbot"]
14 |
--------------------------------------------------------------------------------
/stringsetup.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # (c) https://t.me/TelethonChat/37677
3 | # This Source Code Form is subject to the terms of the GNU
4 | # General Public License, v.3.0. If a copy of the GPL was not distributed with this
5 | # file, You can obtain one at https://www.gnu.org/licenses/gpl-3.0.en.html.
6 |
7 | from telethon.sessions import StringSession
8 | from telethon.sync import TelegramClient
9 |
10 | print(
11 | """Please go-to my.telegram.org
12 | Login using your Telegram account
13 | Click on API Development Tools
14 | Create a new application, by entering the required details"""
15 | )
16 | APP_ID = int(input("Enter APP ID here: "))
17 | API_HASH = input("Enter API HASH here: ")
18 |
19 | with TelegramClient(StringSession(), APP_ID, API_HASH) as client:
20 | print(client.session.save())
21 | client.send_message("me", client.session.save())
22 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | aiofiles
2 | aiohttp
3 | apscheduler
4 | cairosvg
5 | cloudscraper
6 | colour
7 | covid
8 | cowpy
9 | dataclasses
10 | DateTime
11 | emoji
12 | fonttools
13 | geopy
14 | gitpython
15 | glitch_this
16 | google-api-python-client
17 | google-auth-httplib2
18 | google-auth-oauthlib
19 | googletrans==4.0.0-rc1
20 | gtts
21 | hachoir
22 | heroku3
23 | html-telegraph-poster
24 | humanize
25 | IMDbPY
26 | jikanpy
27 | justwatch
28 | lottie
29 | lyricsgenius
30 | markdown
31 | motor
32 | moviepy
33 | nekos.py
34 | opencv-python-headless
35 | Pillow
36 | prettytable
37 | psutil
38 | psycopg2
39 | PyDictionary
40 | pyfiglet
41 | PyGithub
42 | pygments
43 | pylast
44 | pymediainfo
45 | PyMuPDF
46 | pySmartDL
47 | python-barcode
48 | python-dotenv
49 | pytz
50 | qrcode
51 | randomstuff.py
52 | regex
53 | requests
54 | search-engine-parser
55 | selenium
56 | setuptools
57 | ShazamAPI
58 | spamwatch
59 | speedtest-cli
60 | sqlalchemy-json
61 | sqlalchemy==1.3.23
62 | telegraph
63 | git+https://github.com/JMTHON-AR/Telethon
64 | tgcrypto
65 | tswift
66 | ujson
67 | urlextract
68 | validators
69 | vcsi
70 | wand
71 | wget
72 | git+https://github.com/goldsmith/Wikipedia
73 | youtube-search-python
74 | youtube_dl
75 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
🇮🇶 سـورس جـمثون
2 | 🧸♥ مـرحبا بـك في سـورس جـمثون
3 |
4 | [](https://github.com/JMTHON-AR/JM-THON)
5 | [](https://github.com/ellerbrock/open-source-badges/)
6 | [](https://GitHub.com/JMTHON-AR/JM-THON/graphs/commit-activity)
7 | 
8 |
9 |
10 | ### استخراج كود تيرمكس ##
11 | [](https://replit.com/@JMTHONAR/stringsession)
12 | - احصل على الايبي هاش والايبي ايدي من [هـنا](https://my.telegram.org/)
13 |
14 | ### التنصيب عبر هيروكو ##
15 | [](https://heroku.com/deploy?template=https://github.com/JMTHON-AR/JMTHON-PACK)
16 |
17 | ## الـقـناة ##
18 |
19 | -
20 |
--------------------------------------------------------------------------------
/setup/updater.py:
--------------------------------------------------------------------------------
1 | import asyncio
2 | import difflib
3 | import shlex
4 | from typing import Tuple
5 | import sys
6 |
7 | # if any requirements are cahnged then install that requirement
8 | async def lines_differnce(file1, file2):
9 | with open(file1) as f1:
10 | lines1 = f1.readlines()
11 | lines1 = [line.rstrip("\n") for line in lines1]
12 | with open(file2) as f2:
13 | lines2 = f2.readlines()
14 | lines2 = [line.rstrip("\n") for line in lines2]
15 | diff = difflib.unified_diff(
16 | lines1, lines2, fromfile=file1, tofile=file2, lineterm="", n=0
17 | )
18 | lines = list(diff)[2:]
19 | added = [line[1:] for line in lines if line[0] == "+"]
20 | removed = [line[1:] for line in lines if line[0] == "-"]
21 | additions = [i for i in added if i not in removed]
22 | removedt = [i for i in removed if i not in added]
23 | return additions, removedt
24 |
25 |
26 | async def runcmd(cmd: str) -> Tuple[str, str, int, int]:
27 | args = shlex.split(cmd)
28 | process = await asyncio.create_subprocess_exec(
29 | *args, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE
30 | )
31 | stdout, stderr = await process.communicate()
32 | return (
33 | stdout.decode("utf-8", "replace").strip(),
34 | stderr.decode("utf-8", "replace").strip(),
35 | process.returncode,
36 | process.pid,
37 | )
38 |
39 |
40 | async def update_requirements(main , test):
41 | a, r = await lines_differnce(main, test)
42 | try:
43 | for i in a:
44 | await runcmd(f"pip install {i}")
45 | print(f"Succesfully installed {i}")
46 | except Exception as e:
47 | print(f"Error while installing requirments {str(e)}")
48 |
49 |
50 | loop = asyncio.get_event_loop()
51 | loop.run_until_complete(update_requirements(sys.argv[1] , sys.argv[2]))
52 | loop.close()
53 |
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "بوتريو",
3 | "description": "بـوت ريوثون الرسمي اوامر عربيه ممطروقه ",
4 | "logo": "https://telegra.ph/file/a1e9a83240489e7aed967.jpg",
5 | "keywords": [
6 | "plugin",
7 | "modular",
8 | "productivity"
9 | ],
10 | "repository": "https://github.com/aabas2297/https-github.com-JMTHON-AR-JMTHON-PACK",
11 | "website": "#TODO",
12 | "success_url": "#TODO",
13 | "env": {
14 | "ALIVE_NAME": {
15 | "description": "هـنا ضع اسم حسابك الخاص بالتلي",
16 | "value": ""
17 | },
18 | "APP_ID": {
19 | "description": "هـنا ضع ايبي ايدي احصل عليه من : my.telegram.org",
20 | "value": ""
21 | },
22 | "API_HASH": {
23 | "description": "هـنا ضع ايبي هاش احصل عليه من my.telegram.org",
24 | "value": ""
25 | },
26 | "STRING_SESSION": {
27 | "description": "هـنا ضع كـود تيرمكس ",
28 | "value": ""
29 | },
30 | "TG_BOT_USERNAME": {
31 | "description": " @ هنـا ضع معرف بوت التلي الخاص بك بدون ",
32 | "value": ""
33 | },
34 | "TG_BOT_TOKEN": {
35 | "description": "هنـا ضع توكن بوتك .",
36 | "value": ""
37 | },
38 | "COMMAND_HAND_LER": {
39 | "description": "لا تغيـرها ابدا",
40 | "value": ".",
41 | "required": false
42 | },
43 | "ENV": {
44 | "description": "لا تغيـرها ابدا.",
45 | "value": "ANYTHING",
46 | "required": false
47 | },
48 | "HEROKU_API_KEY": {
49 | "description": "ايبـي هيروكو احصل عليه من هذا الرابط مطلوبة ! https://dashboard.heroku.com/account",
50 | "value": ""
51 | },
52 | "HEROKU_APP_NAME": {
53 | "description": "اسم التطبيق اول اسم خليته ",
54 | "value": ""
55 | },
56 | "DEFAULT_BIO": {
57 | "description": "هنا خلي نبذتك حسابك الي تطلع وي البايو الوقتي ",
58 | "value": "",
59 | "required": false
60 | },
61 | "TZ": {
62 | "description": "هنـا ضع المنطقه الزمنية الخاص بك احصل عليه من http://www.timezoneconverter.com/cgi-bin/findzone.tzc",
63 | "value": "Asia/Baghdad",
64 | "required": false
65 | },
66 | "UPSTREAM_REPO": {
67 | "description": "لا تغيـرها ابدا",
68 | "value": "Jmthon-iq",
69 | "required": false
70 | }
71 | },
72 | "addons": [{
73 | "plan": "heroku-postgresql",
74 | "options": {
75 | "version": "12"
76 | }
77 | }],
78 | "buildpacks": [{
79 | "url": "https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest"
80 | },{
81 | "url":"https://github.com/heroku/heroku-buildpack-google-chrome"
82 | },{
83 | "url":"https://github.com/heroku/heroku-buildpack-chromedriver"
84 | },{
85 | "url": "https://github.com/opendoor-labs/heroku-buildpack-p7zip"
86 | },{
87 | "url": "https://github.com/heroku/heroku-buildpack-apt.git"
88 | },{
89 | "url": "https://github.com/chrismytton/heroku-buildpack-jq"
90 | },{
91 | "url": "heroku/python"
92 | }]
93 | }
94 |
--------------------------------------------------------------------------------
/start:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | _get_ziplink () {
4 | local regex
5 | regex='(https?)://github.com/.+/.+'
6 | if [[ $UPSTREAM_REPO == "Jmthon-iq" ]]
7 | then
8 | echo "aHR0cHM6Ly9naXRodWIuY29tL0pNVEhPTi1BUi9KTVRIT04tUEFDSy9hcmNoaXZlL21hc3Rlci56aXA" | base64 -d
9 | elif [[ $UPSTREAM_REPO =~ $regex ]]
10 | then
11 | if [[ $UPSTREAM_REPO_BRANCH ]]
12 | then
13 | echo "${UPSTREAM_REPO}/archive/${UPSTREAM_REPO_BRANCH}.zip"
14 | else
15 | echo "${UPSTREAM_REPO}/archive/master.zip"
16 | fi
17 | else
18 | echo "aHR0cHM6Ly9naXRodWIuY29tL0pNVEhPTi1BUi9KTVRIT04tUEFDSy9hcmNoaXZlL21hc3Rlci56aXA" | base64 -d
19 | fi
20 | }
21 |
22 | _get_repolink () {
23 | local regex
24 | local rlink
25 | regex='(https?)://github.com/.+/.+'
26 | if [[ $UPSTREAM_REPO == "Jmthon-iq" ]]
27 | then
28 | rlink=`echo "aHR0cHM6Ly9naXRodWIuY29tL0pNVEhPTi1BUi9KTS1USE9O=" | base64 -d`
29 | elif [[ $UPSTREAM_REPO =~ $regex ]]
30 | then
31 | rlink=`echo "${UPSTREAM_REPO}"`
32 | else
33 | rlink=`echo "aHR0cHM6Ly9naXRodWIuY29tL0pNVEhPTi1BUi9KTS1USE9O=" | base64 -d`
34 | fi
35 | echo "$rlink"
36 | }
37 |
38 |
39 | _run_python_code() {
40 | python3${pVer%.*} -c "$1"
41 | }
42 |
43 | _run_catpack_git() {
44 | $(_run_python_code 'from git import Repo
45 | import sys
46 |
47 | OFFICIAL_UPSTREAM_REPO = "https://github.com/JMTHON-AR/CATPACK"
48 | ACTIVE_BRANCH_NAME = "master"
49 |
50 | repo = Repo.init()
51 | origin = repo.create_remote("temponame", OFFICIAL_UPSTREAM_REPO)
52 | origin.fetch()
53 | repo.create_head(ACTIVE_BRANCH_NAME, origin.refs[ACTIVE_BRANCH_NAME])
54 | repo.heads[ACTIVE_BRANCH_NAME].checkout(True) ')
55 | }
56 |
57 | _run_cat_git() {
58 | local repolink=$(_get_repolink)
59 | $(_run_python_code 'from git import Repo
60 | import sys
61 | OFFICIAL_UPSTREAM_REPO="'$repolink'"
62 | ACTIVE_BRANCH_NAME = "'$UPSTREAM_REPO_BRANCH'" or "master"
63 | repo = Repo.init()
64 | origin = repo.create_remote("temponame", OFFICIAL_UPSTREAM_REPO)
65 | origin.fetch()
66 | repo.create_head(ACTIVE_BRANCH_NAME, origin.refs[ACTIVE_BRANCH_NAME])
67 | repo.heads[ACTIVE_BRANCH_NAME].checkout(True) ')
68 | }
69 |
70 | _set_bot () {
71 | local zippath
72 | zippath="catuserbot.zip"
73 | echo " Downloading source code ..."
74 | wget -q $(_get_ziplink) -O "$zippath"
75 | echo " Unpacking Data ..."
76 | CATPATH=$(zipinfo -1 "$zippath" | grep -v "/.");
77 | unzip -qq "$zippath"
78 | echo "Done"
79 | echo " جار تحميل بيانات السورس انتظر قليلا ..."
80 | rm -rf "$zippath"
81 | sleep 5
82 | _run_catpack_git
83 | cd $CATPATH
84 | _run_cat_git
85 | python3 ../setup/updater.py ../requirements.txt requirements.txt
86 | chmod -R 755 bin
87 | echo " Starting CatUserBot "
88 | echo "
89 | :'######:::::'###::::'########::::
90 | '##... ##:::'## ##:::... ##..:::::
91 | ##:::..:::'##:. ##::::: ##:::::::
92 | ##:::::::'##:::. ##:::: ##:::::::
93 | ##::::::: #########:::: ##:::::::
94 | ##::: ##: ##.... ##:::: ##:::::::
95 | . ######:: ##:::: ##:::: ##:::::::
96 | :......:::..:::::..:::::..::::::::
97 | "
98 |
99 | echo "
100 | '##::::'##::'######::'########:'########::'########:::'#######::'########:
101 | ##:::: ##:'##... ##: ##.....:: ##.... ##: ##.... ##:'##.... ##:... ##..::
102 | ##:::: ##: ##:::..:: ##::::::: ##:::: ##: ##:::: ##: ##:::: ##:::: ##::::
103 | ##:::: ##:. ######:: ######::: ########:: ########:: ##:::: ##:::: ##::::
104 | ##:::: ##::..... ##: ##...:::: ##.. ##::: ##.... ##: ##:::: ##:::: ##::::
105 | ##:::: ##:'##::: ##: ##::::::: ##::. ##:: ##:::: ##: ##:::: ##:::: ##::::
106 | . #######::. ######:: ########: ##:::. ##: ########::. #######::::: ##::::
107 | :.......::::......:::........::..:::::..::........::::.......::::::..:::::
108 | "
109 | python3 -m userbot
110 | }
111 |
112 | _set_bot
113 |
--------------------------------------------------------------------------------