show warning msg if in daemon and silent mode
This commit is contained in:
parent
0ffe2966b0
commit
84aeafa048
|
@ -1,21 +1,14 @@
|
||||||
# Example systemd Service
|
# Example systemd Service
|
||||||
|
|
||||||
`/home/user/youtubedl-daemon.sh`
|
`/etc/systemd/system/youtube-dl.service`
|
||||||
```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/"
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`/lib/systemd/system/youtubedl.service`
|
|
||||||
```systemd
|
```systemd
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Youtube-DL Daemon
|
Description=Youtube-DL Daemon
|
||||||
After=network-online.target
|
After=network-online.target
|
||||||
|
|
||||||
[Service]
|
[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
|
User=user
|
||||||
Group=user
|
Group=user
|
||||||
|
|
||||||
|
@ -27,5 +20,5 @@ Now start the service
|
||||||
```bash
|
```bash
|
||||||
chmod +x /home/user/youtubedl-daemon.sh
|
chmod +x /home/user/youtubedl-daemon.sh
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
sudo systemctl enable --now youtubedl
|
sudo systemctl enable --now youtube-dl
|
||||||
```
|
```
|
||||||
|
|
|
@ -251,11 +251,11 @@ while True:
|
||||||
logger.error(line)
|
logger.error(line)
|
||||||
else:
|
else:
|
||||||
playlist_bar.write(line)
|
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']):
|
if len(result['video_error_logger_msg']):
|
||||||
errored_videos += 1
|
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']:
|
# for line in result['status_msg']:
|
||||||
# playlist_bar.write(line)
|
# playlist_bar.write(line)
|
||||||
|
|
Reference in New Issue