diff --git a/copyparty/svchub.py b/copyparty/svchub.py index e986ad2e..139ac12e 100644 --- a/copyparty/svchub.py +++ b/copyparty/svchub.py @@ -197,6 +197,7 @@ class SvcHub(object): self.args.th_dec = list(decs.keys()) self.thumbsrv = None + want_ff = False if not args.no_thumb: t = ", ".join(self.args.th_dec) or "(None available)" self.log("thumb", "decoder preference: {}".format(t)) @@ -208,11 +209,11 @@ class SvcHub(object): if self.args.th_dec: self.thumbsrv = ThumbSrv(self) else: + want_ff = True msg = "need either Pillow, pyvips, or FFmpeg to create thumbnails; for example:\n{0}{1} -m pip install --user Pillow\n{0}{1} -m pip install --user pyvips\n{0}apt install ffmpeg" msg = msg.format(" " * 37, os.path.basename(pybin)) if is_exe: - msg = "copyparty.exe cannot use Pillow or pyvips; need ffprobe.exe and ffmpeg.exe to create thumbnails: " - msg += FFMPEG_URL + msg = "copyparty.exe cannot use Pillow or pyvips; need ffprobe.exe and ffmpeg.exe to create thumbnails" self.log("thumb", msg, c=3) @@ -225,6 +226,10 @@ class SvcHub(object): msg = "setting --no-acode because either FFmpeg or FFprobe is not available" self.log("thumb", msg, c=6) args.no_acode = True + want_ff = True + + if want_ff and ANYWIN: + self.log("thumb", "download FFmpeg to fix it:\033[0m " + FFMPEG_URL, 3) args.th_poke = min(args.th_poke, args.th_maxage, args.ac_maxage) diff --git a/copyparty/th_srv.py b/copyparty/th_srv.py index 4e906185..cc9bc891 100644 --- a/copyparty/th_srv.py +++ b/copyparty/th_srv.py @@ -12,13 +12,14 @@ import time from queue import Queue -from .__init__ import TYPE_CHECKING +from .__init__ import ANYWIN, TYPE_CHECKING from .bos import bos from .mtag import HAVE_FFMPEG, HAVE_FFPROBE, ffprobe from .util import ( BytesIO, Cooldown, Daemon, + FFMPEG_URL, Pebkac, afsenc, fsenc, @@ -134,6 +135,8 @@ class ThumbSrv(object): msg = "cannot create audio/video thumbnails because some of the required programs are not available: " msg += ", ".join(missing) self.log(msg, c=3) + if ANYWIN: + self.log("download FFmpeg to fix it:\033[0m " + FFMPEG_URL, 3) if self.args.th_clean: Daemon(self.cleaner, "thumb.cln")