Change to using cookies bc OAuth is getting patched out
This commit is contained in:
parent
952f5cb49d
commit
366adc2423
3 changed files with 39 additions and 14 deletions
36
README.md
36
README.md
|
@ -28,27 +28,39 @@ Copy `.env.example` to `.env`:
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
### ...with PDM
|
### with systemd
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pdm install --prod
|
mkdir -p /srv/discord
|
||||||
pdm run python app.py
|
cd /srv/discord
|
||||||
```
|
|
||||||
|
|
||||||
### ...with requirements.txt and virtualenv
|
sudo useradd --system -s /srv/discord discord
|
||||||
|
sudo chown -R discord:discord /srv/discord
|
||||||
|
|
||||||
```sh
|
sudo -Hu discord git clone https://git.trwnh.com/a/umi.git
|
||||||
virtualenv .venv
|
|
||||||
source .venv/bin/activate
|
python -m venv .venv
|
||||||
pip install -r requirements.txt
|
.venv/bin/pip install -r umi/requirements.txt
|
||||||
python app.py
|
|
||||||
|
sudo cp umi/umi@.service /etc/systemd/system/umi@.service
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl start umi@umi
|
||||||
```
|
```
|
||||||
|
|
||||||
### ...with Docker Compose
|
### ...with Docker Compose
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker compose build
|
mkdir -p /srv/discord
|
||||||
docker compose up -d
|
cd /srv/discord
|
||||||
|
|
||||||
|
sudo useradd --system -s /srv/discord discord
|
||||||
|
sudo chown -R discord:discord /srv/discord
|
||||||
|
|
||||||
|
sudo -Hu discord git clone https://git.trwnh.com/a/umi.git
|
||||||
|
|
||||||
|
cd umi
|
||||||
|
sudo docker compose build
|
||||||
|
sudo docker compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
## Log into YouTube
|
## Log into YouTube
|
||||||
|
|
|
@ -923,8 +923,8 @@ ytdl_format_options = {
|
||||||
"default_search": "auto",
|
"default_search": "auto",
|
||||||
# "source_address": "0.0.0.0", # Bind to ipv4 since ipv6 addresses cause issues
|
# "source_address": "0.0.0.0", # Bind to ipv4 since ipv6 addresses cause issues
|
||||||
"extract_flat": True, # massive speedup for fetching metadata, at the cost of no upload date
|
"extract_flat": True, # massive speedup for fetching metadata, at the cost of no upload date
|
||||||
#"cookiefile": "cookies.txt",
|
"cookiefile": "config/cookies.txt",
|
||||||
"cachedir": "cache",
|
"cachedir": "cache",
|
||||||
"usenetrc": True
|
#"usenetrc": True,
|
||||||
}
|
}
|
||||||
ytdl = youtube_dl.YoutubeDL(ytdl_format_options)
|
ytdl = youtube_dl.YoutubeDL(ytdl_format_options)
|
13
umi@.service
Normal file
13
umi@.service
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Discord bot for logging VC joins and playing music
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Restart=on-failure
|
||||||
|
User=discord
|
||||||
|
WorkingDirectory=/srv/discord/%I
|
||||||
|
EnvironmentFile=/srv/discord/%I/.env
|
||||||
|
ExecStart=/srv/discord/.venv/bin/python -u app.py
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Add table
Reference in a new issue