show warning msg if in daemon and silent mode

This commit is contained in:
Cyberes 2023-01-22 12:29:44 -07:00
parent 0ffe2966b0
commit 84aeafa048
2 changed files with 5 additions and 12 deletions

View File

@ -1,21 +1,14 @@
# Example systemd Service
`/home/user/youtubedl-daemon.sh`
```bash
#!/bin/bash
/usr/bin/python3 /home/user/automated-youtube-dl/downloader.py --daemon --silence-errors --sleep 60 "https://www.youtube.com/playlist?list=example12345" "/mnt/nfs/archive/YouTube/Example Playlist/"
```
`/etc/systemd/system/youtube-dl.service`
`/lib/systemd/system/youtubedl.service`
```systemd
[Unit]
Description=Youtube-DL Daemon
After=network-online.target
[Service]
ExecStart=/home/user/youtubedl-daemon.sh
ExecStart=/usr/bin/python3 /home/user/automated-youtube-dl/downloader.py --daemon --silence-errors --sleep 60 "https://www.youtube.com/playlist?list=example12345" "/mnt/nfs/archive/YouTube/Example Playlist/"
User=user
Group=user
@ -27,5 +20,5 @@ Now start the service
```bash
chmod +x /home/user/youtubedl-daemon.sh
sudo systemctl daemon-reload
sudo systemctl enable --now youtubedl
sudo systemctl enable --now youtube-dl
```

View File

@ -251,11 +251,11 @@ while True:
logger.error(line)
else:
playlist_bar.write(line)
elif not args.silence_errors and args.daemon:
logger.error(f"{result['video_id']} failed due to error.")
if len(result['video_error_logger_msg']):
errored_videos += 1
if args.silence_errors and args.daemon:
logger.error(f"{result['video_id']} failed due to error.")
# for line in result['status_msg']:
# playlist_bar.write(line)