From 1d1574a019a739d60afd98e46c845a5c2a285323 Mon Sep 17 00:00:00 2001 From: iwconfig Date: Tue, 11 Dec 2018 00:06:22 +0100 Subject: [PATCH] Added option to only download nfo --- lib/svtplay_dl/utils/getmedia.py | 9 +++++---- lib/svtplay_dl/utils/parser.py | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/svtplay_dl/utils/getmedia.py b/lib/svtplay_dl/utils/getmedia.py index ccaa034..b159c62 100644 --- a/lib/svtplay_dl/utils/getmedia.py +++ b/lib/svtplay_dl/utils/getmedia.py @@ -192,6 +192,11 @@ def get_one_media(stream): if stream.config.get("list_quality"): list_quality(videos) return + if stream.config.get("nfo"): + # Create NFO files + write_nfo_episode(stream.output, stream.config) + write_nfo_tvshow(stream.output, stream.config) + if stream.config.get("force_nfo"): return try: fstream = select_quality(stream.config, videos) if fstream.config.get("get_url"): @@ -207,10 +212,6 @@ def get_one_media(stream): if fstream.config.get("thumbnail") and hasattr(stream, "get_thumbnail"): stream.get_thumbnail(stream.config) - if stream.config.get("nfo"): - # Create NFO files - write_nfo_episode(stream.output, stream.config) - write_nfo_tvshow(stream.output, stream.config) post = postprocess(fstream, fstream.config, subfixes) if fstream.audio and post.detect: diff --git a/lib/svtplay_dl/utils/parser.py b/lib/svtplay_dl/utils/parser.py index 7331d36..0d3ca52 100644 --- a/lib/svtplay_dl/utils/parser.py +++ b/lib/svtplay_dl/utils/parser.py @@ -97,6 +97,8 @@ def parser(version): help="explain what is going on") general.add_argument("--nfo", action="store_true", dest="nfo", default=False, help="create a NFO file") + general.add_argument("--force-nfo", action="store_true", dest="force_nfo", default=False, + help="download only NFO if used with --nfo") quality = parser.add_argument_group("Quality") quality.add_argument("-q", "--quality", default=0, metavar="quality", @@ -177,6 +179,7 @@ def setup_defaults(): options.set("preferred", None) options.set("verbose", False) options.set("nfo", False) + options.set("force_nfo", False) options.set("output_auto", False) options.set("service", None) options.set("cookies", None) @@ -220,6 +223,7 @@ def parsertoconfig(config, parser): config.set("preferred", parser.preferred) config.set("verbose", parser.verbose) config.set("nfo", parser.nfo) + config.set("force_nfo", parser.nfo) config.set("exclude", parser.exclude) config.set("after_date", parser.after_date) config.set("get_url", parser.get_url)