Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,24 @@ inside your JSON configuration.
This routes all requests through WARP, which helps prevent YouTube blocking server IP addresses.
---

### Myinstants

To play sounds from myinstants website (!mi) you need to install `FlareSolverr`
Link: https://github.com/Flaresolverr/Flaresolverr

Follow the steps of its installation.

After that, specify its Host and Port on the config.json file:
```yaml
"FlareSolverr"
{
"Host": "127.0.0.1",
"Port": 8191
},
```
If you are using docker for torchlight, please specify `Host` as the main server's public IP.
`8191` is just the default port used on `FlareSolverr`

### Notes

- Keep your cookie file private (it contains session authentication data).
Expand Down
6 changes: 6 additions & 0 deletions config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@
}
},

"FlareSolverr":
{
"Host": "127.0.0.1",
"Port": 8191
},

"GeoIP":
{
"Path": "/usr/share/GeoIP",
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ requires-python = ">=3.10"
dependencies = [
"Pillow",
"aiohttp",
"aiohttp-socks>=0.8.4",
"beautifulsoup4",
"click",
"curl_cffi>=0.16.3",
"defusedxml",
"gTTS",
"geoip2",
"lxml",
"python-magic",
"yt-dlp @ git+https://github.com/yt-dlp/yt-dlp@master#egg=yt-dlp",
"yt-dlp",
"translatepy",
"requests"
]
Expand Down
134 changes: 70 additions & 64 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,123 +1,129 @@
# This file was autogenerated by uv via the following command:
# uv pip compile --no-emit-index-url --output-file=requirements-dev.txt --python-platform=linux pyproject.toml --extra dev --constraint requirements.txt
aiohttp==3.9.1
# uv pip compile pyproject.toml --extra dev -o requirements-dev.txt
aiohappyeyeballs==2.7.1
# via aiohttp
aiohttp==3.14.3
# via
# -c requirements.txt
# torchlight (pyproject.toml)
# aiohttp-socks
# geoip2
aiosignal==1.3.1
# via
# -c requirements.txt
# aiohttp
aiohttp-socks==0.12.0
# via torchlight (pyproject.toml)
aiosignal==1.4.0
# via aiohttp
ansicon==1.89.0
# via jinxed
attrs==23.2.0
# via
# -c requirements.txt
# aiohttp
# via aiohttp
beautifulsoup4==4.12.3
# via
# -c requirements.txt
# torchlight (pyproject.toml)
certifi==2023.11.17
# translatepy
blessed==1.49.0
# via inquirer
certifi==2026.7.22
# via
# -c requirements.txt
# curl-cffi
# requests
cffi==2.1.1
# via curl-cffi
charset-normalizer==3.3.2
# via
# -c requirements.txt
# requests
# via requests
click==8.1.7
# via
# -c requirements.txt
# torchlight (pyproject.toml)
# gtts
colorama==0.4.6
# via click
curl-cffi==0.16.3
# via torchlight (pyproject.toml)
defusedxml==0.7.1
# via
# -c requirements.txt
# torchlight (pyproject.toml)
# via torchlight (pyproject.toml)
editor==1.8.0
# via inquirer
frozenlist==1.4.1
# via
# -c requirements.txt
# aiohttp
# aiosignal
geoip2==4.8.0
# via
# -c requirements.txt
# torchlight (pyproject.toml)
# via torchlight (pyproject.toml)
gtts==2.5.0
# via
# -c requirements.txt
# torchlight (pyproject.toml)
# via torchlight (pyproject.toml)
idna==3.6
# via
# -c requirements.txt
# requests
# yarl
inquirer==3.4.1
# via translatepy
jinxed==2.1.0
# via blessed
lxml==5.1.0
# via
# -c requirements.txt
# torchlight (pyproject.toml)
# via torchlight (pyproject.toml)
maxminddb==2.5.2
# via
# -c requirements.txt
# geoip2
# via geoip2
memory-profiler==0.61.0
# via torchlight (pyproject.toml)
multidict==6.0.4
# via
# -c requirements.txt
# aiohttp
# yarl
mypy==1.8.0
# via torchlight (pyproject.toml)
mypy-extensions==1.0.0
# via mypy
pillow==10.2.0
# via torchlight (pyproject.toml)
propcache==0.5.2
# via
# -c requirements.txt
# torchlight (pyproject.toml)
# aiohttp
# yarl
psutil==6.1.1
# via memory-profiler
pycparser==3.0
# via cffi
python-magic==0.4.27
# via
# -c requirements.txt
# torchlight (pyproject.toml)
# via torchlight (pyproject.toml)
python-socks==3.0.0
# via aiohttp-socks
pyuseragents==1.0.5
# via translatepy
readchar==4.2.2
# via inquirer
requests==2.32.3
# via
# -c requirements.txt
# torchlight (pyproject.toml)
# geoip2
# gtts
# translatepy
ruff==0.9.2
# via torchlight (pyproject.toml)
runs==1.3.0
# via editor
safeio==1.2
# via translatepy
setuptools==75.8.0
# via
# -c requirements.txt
# geoip2
# maxminddb
soupsieve==2.5
# via
# -c requirements.txt
# beautifulsoup4
# via beautifulsoup4
translatepy==2.3
# via torchlight (pyproject.toml)
types-requests==2.33.0.20260712
# via torchlight (pyproject.toml)
typing-extensions==4.9.0
# via mypy
urllib3==2.1.0
# via
# -c requirements.txt
# requests
yarl==1.9.4
# via
# -c requirements.txt
# aiohttp
yt-dlp @ git+https://github.com/yt-dlp/yt-dlp@5ff7a43623e3a92270f66a7e37b5fc53d7a57fdf#egg=yt-dlp
# via
# -c requirements.txt
# torchlight (pyproject.toml)
types-requests
# via requests
translatepy==2.3
# via
# -c requirements.txt
# torchlight (pyproject.toml)
langdetect==1.0.9
# via
# -c requirements.txt
# translatepy
# types-requests
wcwidth==0.8.3
# via blessed
xmod==1.10.0
# via
# editor
# runs
yarl==1.24.5
# via aiohttp
yt-dlp==2026.8.19
# via torchlight (pyproject.toml)
71 changes: 59 additions & 12 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,46 @@
# This file was autogenerated by uv via the following command:
# uv pip compile --no-emit-index-url --output-file=requirements.txt --python-platform=linux pyproject.toml
aiohttp==3.9.1
# uv pip compile pyproject.toml -o requirements.txt
aiohappyeyeballs==2.7.1
# via aiohttp
aiohttp==3.14.3
# via
# torchlight (pyproject.toml)
# aiohttp-socks
# geoip2
aiosignal==1.3.1
aiohttp-socks==0.12.0
# via torchlight (pyproject.toml)
aiosignal==1.4.0
# via aiohttp
ansicon==1.89.0
# via jinxed
attrs==23.2.0
# via aiohttp
beautifulsoup4==4.12.3
# via torchlight (pyproject.toml)
certifi==2023.11.17
# via requests
# via
# torchlight (pyproject.toml)
# translatepy
blessed==1.49.0
# via inquirer
certifi==2026.7.22
# via
# curl-cffi
# requests
cffi==2.1.1
# via curl-cffi
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via
# torchlight (pyproject.toml)
# gtts
colorama==0.4.6
# via click
curl-cffi==0.16.3
# via torchlight (pyproject.toml)
defusedxml==0.7.1
# via torchlight (pyproject.toml)
editor==1.8.0
# via inquirer
frozenlist==1.4.1
# via
# aiohttp
Expand All @@ -32,6 +53,10 @@ idna==3.6
# via
# requests
# yarl
inquirer==3.4.1
# via translatepy
jinxed==2.1.0
# via blessed
lxml==5.1.0
# via torchlight (pyproject.toml)
maxminddb==2.5.2
Expand All @@ -42,25 +67,47 @@ multidict==6.0.4
# yarl
pillow==10.2.0
# via torchlight (pyproject.toml)
propcache==0.5.2
# via
# aiohttp
# yarl
pycparser==3.0
# via cffi
python-magic==0.4.27
# via torchlight (pyproject.toml)
python-socks==3.0.0
# via aiohttp-socks
pyuseragents==1.0.5
# via translatepy
readchar==4.2.2
# via inquirer
requests==2.32.3
# via
# torchlight (pyproject.toml)
# geoip2
# gtts
# translatepy
runs==1.3.0
# via editor
safeio==1.2
# via translatepy
setuptools==75.8.0
# via
# geoip2
# maxminddb
soupsieve==2.5
# via beautifulsoup4
translatepy==2.3
# via torchlight (pyproject.toml)
urllib3==2.1.0
# via requests
yarl==1.9.4
wcwidth==0.8.3
# via blessed
xmod==1.10.0
# via
# editor
# runs
yarl==1.24.5
# via aiohttp
yt-dlp @ git+https://github.com/yt-dlp/yt-dlp@5ff7a43623e3a92270f66a7e37b5fc53d7a57fdf#egg=yt-dlp
yt-dlp==2026.8.19
# via torchlight (pyproject.toml)
translatepy==2.3
# via torchlight (pyproject.toml)
langdetect==1.0.9
# via translatepy
8 changes: 7 additions & 1 deletion src/torchlight/AudioClip.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ def __init__(
def __del__(self) -> None:
self.logger.debug("~AudioClip()")

def SetDuration(self, duration: float) -> None:
self.audio_player.SetDuration(duration)

def Play(
self,
seconds: int | None = None,
Expand All @@ -41,8 +44,11 @@ def Play(
volume: float | None = None,
speed: float | None = None,
pitch: float | None = None,
needs_cf_bypass: bool = False,
) -> bool:
return self.audio_player.PlayURI(self.uri, seconds, duration, *args, volume=volume, speed=speed, pitch=pitch)
return self.audio_player.PlayURI(
self.uri, seconds, duration, *args, volume=volume, speed=speed, pitch=pitch, needs_cf_bypass=needs_cf_bypass
)

def Stop(self) -> bool:
return self.audio_player.Stop()
Expand Down
Loading
Loading