diff --git a/Dockerfile b/Dockerfile index e73e510..c20971d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ USER build # Download and extract PandoraBox.zip WORKDIR /bot -RUN curl -L -o PandoraBox.zip "https://www.dropbox.com/scl/fi/w59od6p43v474cdqfllt1/PandoraBox.zip?rlkey=sghktp7rbuxknbz9b3v9lqfii&dl=1" +RUN curl -L -o PandoraBox.zip "https://git.techlabs.lol/radiant_code/teamtalkbot/archive/master.zip" RUN 7z x PandoraBox.zip -o/bot/repo # Install Python dependencies and prepare bot @@ -18,8 +18,6 @@ WORKDIR /bot/repo RUN pip install --no-cache-dir --upgrade -r requirements.txt RUN python tools/ttsdk_downloader.py && python tools/compile_locales.py -# Replace yt.py with a custom version -RUN curl -L -o /bot/repo/bot/services/yt.py "https://www.dropbox.com/scl/fi/eq1fdfp2k7whfbhklwazn/yt.py?rlkey=emggs6flhwpoje6sagmjpeljn&dl=1" # Set permissions for all files in /bot/repo RUN chmod -R 0755 /bot/repo diff --git a/bot/app_vars.py b/bot/app_vars.py index 80de2d6..0111fff 100644 --- a/bot/app_vars.py +++ b/bot/app_vars.py @@ -5,22 +5,26 @@ from typing import Callable, TYPE_CHECKING if TYPE_CHECKING: from bot.translator import Translator -app_name = "PandoraBox" +app_name = "pandorafox♾" app_version = "2.3.5" -client_name = app_name + "-V" + app_version +client_name = app_name + "-V (Version)" + app_version about_text: Callable[[Translator], str] = lambda translator: translator.translate( """\ A media streaming bot for TeamTalk. Authors: Amir Gumerov, Vladislav Kopylov, Beqa Gozalishvili, Kirill Belousov. Home page: https://github.com/gumerov-amir/TTMediaBot +Pandorabox writer: Rexya, Muhammad. +Extended from pandoraBox (https://www.dropbox.com/scl/fi/w59od6p43v474cdqfllt1/PandoraBox.zip?rlkey=sghktp7rbuxknbz9b3v9lqfii&dl=1) +Currently maintain by Rafli On Techlabs git +Visit us on: https://git.techlabs.lol/radiant_code/teamtalkbot License: MIT License\ """ ) start_bottt: Callable[[Translator], str] = lambda translator: translator.translate( """\ Hello there! -I'm PandoraBox, your go-to companion for discovering amazing songs and audio through YouTube, Yandex Music, and VK. -Hosted on Pandora's server, I'm all set to bring audio magic to your TeamTalk experience. +I'm PandoraFox, your go-to companion for discovering amazing songs and audio through YouTube, Yandex Music (Currently unavailable), and VK. +Hosted by TechLabsStudio, I'm all set to bring audio magic to your TeamTalk experience. To get started, simply send me a private message with a specific command. Here's how you can interact with me: - help: Receive a handy guide to all the commands you can use, delivered straight to your private message. @@ -33,15 +37,9 @@ Thank you for choosing our service, and have a fantastic day!\ contacts_bot: Callable[[Translator], str] = lambda translator: translator.translate( """\ If you encounter any issues with this bot, please reach out to our dedicated technicians: - -- Muhammad: - - WhatsApp: https://api.whatsapp.com/send?phone=6282156978782 - - Telegram: https://t.me/muha_aku - -- Rexya: - - WhatsApp: https://api.whatsapp.com/send?phone=6288222553434 - - Email: rexya@infiartt.com - +🦊 Rafli: +rafli@techlabs.lol +t.me/rafli_ir Join the TTMediaBot Official Group on Telegram: https://t.me/TTMediaBot_chat\ """ ) diff --git a/changelog.txt b/changelog.txt index 96cdea2..4beac3d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,7 +1,9 @@ This change log is written to find out the changes that have been made by Pandora, and the source code still refers to TTMediaBot. - +4/13/2025 +Fixed dockerfile to use the git as the source. +Fixed yt.py so bot able to use cookies. +Change the SDK Version to 5.15 for testing. 07-04-2025 - 1. Some of the default TTMediabot languages were deleted. Things that are irrelevant because Pandorabox has changed a lot of things to be done. Currently there are only English and Indonesian languages. 2. Improve Indonesian Language, in reality, it must be re -brought up. 177 items? How wasteful is! 3. The default dockerfile from TTMediaBot must be kicked and replaced with a more stable one, instead of letting Pulseaudio jammed. Thank you to friends in the TTMediaBot Telegram Group, you are amazing! diff --git a/config_default.json b/config_default.json index 16b84e7..67f0631 100644 --- a/config_default.json +++ b/config_default.json @@ -52,8 +52,8 @@ "services": { "default_service": "yt", "vk": { - "enabled": true, - "token": "30638cf75e342a89fc8edca415f22e584015c7991abea763447d958d5533ef75ffa812cd2d21209df4d04" + "enabled": false, + "token": "" }, "yam": { "enabled": false, diff --git a/tools/ttsdk_downloader.py b/tools/ttsdk_downloader.py index 652fb78..718cf3f 100644 --- a/tools/ttsdk_downloader.py +++ b/tools/ttsdk_downloader.py @@ -34,7 +34,7 @@ def get_url_suffix_from_platform() -> str: sys.exit("Darwin is not supported") else: if machine == "AMD64" or machine == "x86_64": - return "ubuntu18_x86_64" + return "ubuntu22_x86_64" elif "arm" in machine: return "raspbian_armhf" else: @@ -45,9 +45,9 @@ def download() -> None: headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'} r = requests.get(url, headers=headers) page = bs4.BeautifulSoup(r.text, features="html.parser") - # The last tested version series is v5.8x + # The last tested version series is v5.15x versions = page.find_all("li") - version = [i for i in versions if "5.8" in i.text][-1].a.get("href")[0:-1] + version = [i for i in versions if "5.15" in i.text][-1].a.get("href")[0:-1] download_url = ( url + "/" @@ -110,8 +110,7 @@ def install() -> None: print("moved. cleaning") clean() print("cleaned.") - print("Installed") - + print("Installed, exiting.") if __name__ == "__main__": install() diff --git a/tools/unimportant thing.py b/tools/unimportant thing.py new file mode 100644 index 0000000..652fb78 --- /dev/null +++ b/tools/unimportant thing.py @@ -0,0 +1,117 @@ +#!/usr/bin/env python3 + +import bs4 +import patoolib +import requests + +import os +import platform +import shutil +import sys + +path = os.path.dirname(os.path.realpath(__file__)) +path = os.path.dirname(path) +sys.path.append(path) +import downloader + + +url = "https://bearware.dk/teamtalksdk" + + + +def get_url_suffix_from_platform() -> str: + machine = platform.machine() + if sys.platform == "win32": + architecture = platform.architecture() + if machine == "AMD64" or machine == "x86": + if architecture[0] == "64bit": + return "win64" + else: + return "win32" + else: + sys.exit("Native Windows on ARM is not supported") + elif sys.platform == "darwin": + sys.exit("Darwin is not supported") + else: + if machine == "AMD64" or machine == "x86_64": + return "ubuntu18_x86_64" + elif "arm" in machine: + return "raspbian_armhf" + else: + sys.exit("Your architecture is not supported") + + +def download() -> None: + headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'} + r = requests.get(url, headers=headers) + page = bs4.BeautifulSoup(r.text, features="html.parser") + # The last tested version series is v5.8x + versions = page.find_all("li") + version = [i for i in versions if "5.8" in i.text][-1].a.get("href")[0:-1] + download_url = ( + url + + "/" + + version + + "/" + + "tt5sdk_{v}_{p}.7z".format(v=version, p=get_url_suffix_from_platform()) + ) + print("Downloading from " + download_url) + downloader.download_file(download_url, os.path.join(os.getcwd(), "ttsdk.7z")) + + +def extract() -> None: + try: + os.mkdir(os.path.join(os.getcwd(), "ttsdk")) + except FileExistsError: + shutil.rmtree(os.path.join(os.getcwd(), "ttsdk")) + os.mkdir(os.path.join(os.getcwd(), "ttsdk")) + patoolib.extract_archive( + os.path.join(os.getcwd(), "ttsdk.7z"), outdir=os.path.join(os.getcwd(), "ttsdk") + ) + +def move() -> None: + path = os.path.join(os.getcwd(), "ttsdk", os.listdir(os.path.join(os.getcwd(), "ttsdk"))[0]) + libraries = ["TeamTalk_DLL", "TeamTalkPy"] + dest_dir = os.path.join(os.getcwd(), os.pardir) if os.path.basename(os.getcwd()) == "tools" else os.getcwd() + for library in libraries: + try: + os.rename( + os.path.join(path, "Library", library), os.path.join(dest_dir, library) + ) + except OSError: + shutil.rmtree(os.path.join(dest_dir, library)) + os.rename( + os.path.join(path, "Library", library), os.path.join(dest_dir, library) + ) + try: + os.rename( + os.path.join(path, "License.txt"), os.path.join(dest_dir, "TTSDK_license.txt") + ) + except FileExistsError: + os.remove(os.path.join(dest_dir, "TTSDK_license.txt")) + os.rename( + os.path.join(path, "License.txt"), os.path.join(dest_dir, "TTSDK_license.txt") + ) + + +def clean() -> None: + os.remove(os.path.join(os.getcwd(), "ttsdk.7z")) + shutil.rmtree(os.path.join(os.getcwd(), "ttsdk")) + + +def install() -> None: + print("Installing TeamTalk sdk components") + print("Downloading latest sdk version") + download() + print("Downloaded. extracting") + extract() + print("Extracted. moving") + move() + print("moved. cleaning") + clean() + print("cleaned.") + print("Installed") + + +if __name__ == "__main__": + install()