fix Inappropriate ioctl for device

This commit is contained in:
Cyberes 2023-01-22 12:38:26 -07:00
parent 84aeafa048
commit 529bf22ba3
2 changed files with 13 additions and 3 deletions

View File

@ -16,9 +16,17 @@ Group=user
WantedBy=multi-user.target
```
Now start the service
Now start the service:
```bash
chmod +x /home/user/youtubedl-daemon.sh
sudo systemctl daemon-reload
sudo systemctl enable --now youtube-dl
```
You can watch the process with:
```bash
sudo journalctl -b -u youtube-dl.service
```

View File

@ -229,7 +229,9 @@ while True:
if len(download_queue): # Don't mess with multiprocessing if all videos are already downloaded
with Pool(processes=args.threads) as pool:
status_bar.set_description_str('=' * os.get_terminal_size()[0])
# Doesn't work if not connected to a terminal
if sys.stdout.isatty():
status_bar.set_description_str('=' * os.get_terminal_size()[0]) # OSError: [Errno 25] Inappropriate ioctl for device
logger.info('Starting downloads...')
for result in pool.imap_unordered(download_video,
((video, {