diff --git a/lib/svtplay_dl/__init__.py b/lib/svtplay_dl/__init__.py index e561f49..3bf2f37 100644 --- a/lib/svtplay_dl/__init__.py +++ b/lib/svtplay_dl/__init__.py @@ -72,5 +72,5 @@ def main(): except KeyboardInterrupt: print("") except (yaml.YAMLError, yaml.MarkedYAMLError) as e: - logging.error(f"Your settings file(s) contain invalid YAML syntax! Please fix and restart!, {str(e)}") + logging.error("Your settings file(s) contain invalid YAML syntax! Please fix and restart!, %s", str(e)) sys.exit(2) diff --git a/lib/svtplay_dl/postprocess/__init__.py b/lib/svtplay_dl/postprocess/__init__.py index 3ff9baa..292b13e 100644 --- a/lib/svtplay_dl/postprocess/__init__.py +++ b/lib/svtplay_dl/postprocess/__init__.py @@ -57,9 +57,9 @@ class postprocess: videotrack, audiotrack = _checktracks(streams) if self.config.get("merge_subtitle"): - logging.info(f"Merge audio, video and subtitle into {new_name.name}") + logging.info("Merge audio, video and subtitle into %s", new_name.name) else: - logging.info(f"Merge audio and video into {new_name.name}") + logging.info("Merge audio and video into %s", new_name.name) tempfile = orig_filename.with_suffix(".temp") arguments = ["-c:v", "copy", "-c:a", "copy", "-f", "matroska" if self.config.get("output_format") == "mkv" else "mp4"] diff --git a/lib/svtplay_dl/service/__init__.py b/lib/svtplay_dl/service/__init__.py index 5eddc3f..f4e10fe 100644 --- a/lib/svtplay_dl/service/__init__.py +++ b/lib/svtplay_dl/service/__init__.py @@ -55,7 +55,7 @@ class Service: else: self.http = http - logging.debug(f"service: {self.__class__.__name__.lower()}") + logging.debug("service: %s", self.__class__.__name__.lower()) @property def url(self): diff --git a/lib/svtplay_dl/subtitle/__init__.py b/lib/svtplay_dl/subtitle/__init__.py index 8d71dc2..467f9aa 100644 --- a/lib/svtplay_dl/subtitle/__init__.py +++ b/lib/svtplay_dl/subtitle/__init__.py @@ -38,7 +38,7 @@ class subtitle: self.output["ext"] = output_ext dupe, fileame = find_dupes(self.output, self.config, False) if dupe and not self.config.get("force_subtitle"): - logging.warning(f"File ({fileame.name}) already exists. Use --force-subtitle to overwrite") + logging.warning("File (%s) already exists. Use --force-subtitle to overwrite", fileame.name) return subdata = self.http.request("get", self.url) if subdata.status_code != 200: diff --git a/lib/svtplay_dl/utils/getmedia.py b/lib/svtplay_dl/utils/getmedia.py index c66b03e..5c97f19 100644 --- a/lib/svtplay_dl/utils/getmedia.py +++ b/lib/svtplay_dl/utils/getmedia.py @@ -44,7 +44,7 @@ def get_media(url, options, version="Unknown"): url = f"http://{url}" if options.get("verbose"): - logging.debug(f"version: {version}") + logging.debug("version: %s", version) stream = service_handler(sites, options, url) if not stream: @@ -141,8 +141,11 @@ def get_one_media(stream): pub_date = None if after_date is not None and pub_date is not None and pub_date.date() < after_date.date(): logging.info( - f"Video {stream.output['title']}S{stream.output['season']}E{stream.output['episode']}" - f" skipped since published {pub_date.date()} before {after_date.date()}.", + "Video %sS%dE%d skipped since published %s.", + stream.output["title"], + stream.output["season"], + stream.output["episode"], + pub_date.date(), ) return @@ -163,7 +166,7 @@ def get_one_media(stream): else: errormsg = str(exc) if errormsg: - logging.error(f"No videos found. {errormsg}") + logging.error("No videos found. %s", errormsg) else: logging.error("No videos found.") else: @@ -188,7 +191,7 @@ def get_one_media(stream): dupe, fileame = find_dupes(fstream.output, stream.config) if dupe and not stream.config.get("force"): - logging.warning(f"File ({fileame.name}) already exists. Use --force to overwrite") + logging.warning("File (%s) already exists. Use --force to overwrite", fileame.name) return if fstream.config.get("output_format") and fstream.config.get("output_format").lower() not in ["mkv", "mp4"]: logging.error("Unknown output format. please choose mp4 or mkv") @@ -206,7 +209,7 @@ def get_one_media(stream): stream.get_thumbnail(stream.config) if fstream.config.get("silent_semi") and fstream.finished: - logging.log(25, f"Download of {formatname(fstream.output, fstream.config, fstream.output_extention)} was completed") + logging.log(25, "Download of %s was completed", formatname(fstream.output, fstream.config, fstream.output_extention)) if fstream.config.get("no_postprocess") is True or all(fstream.config.get(x) for x in ["no_remux", "no_merge"]) is True: logging.info("All done. Not postprocessing files, leaving them completely untouched.") diff --git a/lib/svtplay_dl/utils/nfo.py b/lib/svtplay_dl/utils/nfo.py index 15c440c..d0123b3 100644 --- a/lib/svtplay_dl/utils/nfo.py +++ b/lib/svtplay_dl/utils/nfo.py @@ -33,7 +33,7 @@ def write_nfo_episode(output, config): filename = formatname(loutout, config) dupe, fileame = find_dupes(loutout.copy(), config, False) if dupe and not config.get("force_nfo"): - logging.warning(f"File ({fileame.name}) already exists. Use --force-nfo to overwrite") + logging.warning("File (%s) already exists. Use --force-nfo to overwrite", fileame.name) return logging.info("NFO episode: %s", filename) @@ -67,7 +67,7 @@ def write_nfo_tvshow(output, config): filename = formatname(loutput, cconfig) dupe, fileame = find_dupes(loutput, cconfig, False) if dupe and not cconfig.get("force_nfo"): - logging.warning(f"File ({fileame.name}) already exists. Use --force-nfo to overwrite") + logging.warning("File (%s) already exists. Use --force-nfo to overwrite", fileame.name) return logging.info("NFO show: %s", filename) diff --git a/lib/svtplay_dl/utils/parser.py b/lib/svtplay_dl/utils/parser.py index 68e5062..316933c 100644 --- a/lib/svtplay_dl/utils/parser.py +++ b/lib/svtplay_dl/utils/parser.py @@ -463,7 +463,7 @@ def readconfig(config, configfile, service=None, preset=None): data = fd.read() configdata = safe_load(data) except PermissionError: - logging.error(f"Permission denied while reading config: {configfile}") + logging.error("Permission denied while reading config: %s", configfile) if configdata is None: return config diff --git a/lib/svtplay_dl/utils/proc.py b/lib/svtplay_dl/utils/proc.py index 463dfcf..d4ac937 100644 --- a/lib/svtplay_dl/utils/proc.py +++ b/lib/svtplay_dl/utils/proc.py @@ -8,5 +8,5 @@ def run_program(cmd, show=True): stderr = stderr.decode("utf-8", "replace") if p.returncode != 0 and show: msg = stderr.strip() - logging.error(f"Something went wrong: {msg}") + logging.error("Something went wrong: %s", msg) return p.returncode, stdout, stderr