Fix Dockerfile source to Git, enable cookie usage in yt.py, and update SDK to 5.15
Some checks are pending
Build-nightly / docker (push) Waiting to run
Some checks are pending
Build-nightly / docker (push) Waiting to run
This commit is contained in:
parent
f331b10358
commit
0a8f6abfa8
@ -10,7 +10,7 @@ USER build
|
|||||||
|
|
||||||
# Download and extract PandoraBox.zip
|
# Download and extract PandoraBox.zip
|
||||||
WORKDIR /bot
|
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
|
RUN 7z x PandoraBox.zip -o/bot/repo
|
||||||
|
|
||||||
# Install Python dependencies and prepare bot
|
# Install Python dependencies and prepare bot
|
||||||
@ -18,8 +18,6 @@ WORKDIR /bot/repo
|
|||||||
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
||||||
RUN python tools/ttsdk_downloader.py && python tools/compile_locales.py
|
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
|
# Set permissions for all files in /bot/repo
|
||||||
RUN chmod -R 0755 /bot/repo
|
RUN chmod -R 0755 /bot/repo
|
||||||
|
@ -5,22 +5,26 @@ from typing import Callable, TYPE_CHECKING
|
|||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from bot.translator import Translator
|
from bot.translator import Translator
|
||||||
|
|
||||||
app_name = "PandoraBox"
|
app_name = "pandorafox♾"
|
||||||
app_version = "2.3.5"
|
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(
|
about_text: Callable[[Translator], str] = lambda translator: translator.translate(
|
||||||
"""\
|
"""\
|
||||||
A media streaming bot for TeamTalk.
|
A media streaming bot for TeamTalk.
|
||||||
Authors: Amir Gumerov, Vladislav Kopylov, Beqa Gozalishvili, Kirill Belousov.
|
Authors: Amir Gumerov, Vladislav Kopylov, Beqa Gozalishvili, Kirill Belousov.
|
||||||
Home page: https://github.com/gumerov-amir/TTMediaBot
|
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\
|
License: MIT License\
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
start_bottt: Callable[[Translator], str] = lambda translator: translator.translate(
|
start_bottt: Callable[[Translator], str] = lambda translator: translator.translate(
|
||||||
"""\
|
"""\
|
||||||
Hello there!
|
Hello there!
|
||||||
I'm PandoraBox, your go-to companion for discovering amazing songs and audio through YouTube, Yandex Music, and VK.
|
I'm PandoraFox, your go-to companion for discovering amazing songs and audio through YouTube, Yandex Music (Currently unavailable), and VK.
|
||||||
Hosted on Pandora's server, I'm all set to bring audio magic to your TeamTalk experience.
|
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.
|
To get started, simply send me a private message with a specific command.
|
||||||
Here's how you can interact with me:
|
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.
|
- 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(
|
contacts_bot: Callable[[Translator], str] = lambda translator: translator.translate(
|
||||||
"""\
|
"""\
|
||||||
If you encounter any issues with this bot, please reach out to our dedicated technicians:
|
If you encounter any issues with this bot, please reach out to our dedicated technicians:
|
||||||
|
🦊 Rafli:
|
||||||
- Muhammad:
|
rafli@techlabs.lol
|
||||||
- WhatsApp: https://api.whatsapp.com/send?phone=6282156978782
|
t.me/rafli_ir
|
||||||
- Telegram: https://t.me/muha_aku
|
|
||||||
|
|
||||||
- Rexya:
|
|
||||||
- WhatsApp: https://api.whatsapp.com/send?phone=6288222553434
|
|
||||||
- Email: rexya@infiartt.com
|
|
||||||
|
|
||||||
Join the TTMediaBot Official Group on Telegram: https://t.me/TTMediaBot_chat\
|
Join the TTMediaBot Official Group on Telegram: https://t.me/TTMediaBot_chat\
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
@ -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.
|
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
|
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.
|
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!
|
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!
|
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!
|
||||||
|
@ -52,8 +52,8 @@
|
|||||||
"services": {
|
"services": {
|
||||||
"default_service": "yt",
|
"default_service": "yt",
|
||||||
"vk": {
|
"vk": {
|
||||||
"enabled": true,
|
"enabled": false,
|
||||||
"token": "30638cf75e342a89fc8edca415f22e584015c7991abea763447d958d5533ef75ffa812cd2d21209df4d04"
|
"token": ""
|
||||||
},
|
},
|
||||||
"yam": {
|
"yam": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
|
@ -34,7 +34,7 @@ def get_url_suffix_from_platform() -> str:
|
|||||||
sys.exit("Darwin is not supported")
|
sys.exit("Darwin is not supported")
|
||||||
else:
|
else:
|
||||||
if machine == "AMD64" or machine == "x86_64":
|
if machine == "AMD64" or machine == "x86_64":
|
||||||
return "ubuntu18_x86_64"
|
return "ubuntu22_x86_64"
|
||||||
elif "arm" in machine:
|
elif "arm" in machine:
|
||||||
return "raspbian_armhf"
|
return "raspbian_armhf"
|
||||||
else:
|
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'}
|
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)
|
r = requests.get(url, headers=headers)
|
||||||
page = bs4.BeautifulSoup(r.text, features="html.parser")
|
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")
|
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 = (
|
download_url = (
|
||||||
url
|
url
|
||||||
+ "/"
|
+ "/"
|
||||||
@ -110,8 +110,7 @@ def install() -> None:
|
|||||||
print("moved. cleaning")
|
print("moved. cleaning")
|
||||||
clean()
|
clean()
|
||||||
print("cleaned.")
|
print("cleaned.")
|
||||||
print("Installed")
|
print("Installed, exiting.")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
install()
|
install()
|
||||||
|
117
tools/unimportant thing.py
Normal file
117
tools/unimportant thing.py
Normal file
@ -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()
|
Loading…
x
Reference in New Issue
Block a user