1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-30 23:24:16 +01:00

get_one_media: override filename if it is set automagic

This commit is contained in:
Johan Andersson 2014-08-11 21:24:35 +02:00
parent c19ba14e4c
commit ebe21c49c5

View File

@ -58,6 +58,7 @@ class Options:
self.force_subtitle = False self.force_subtitle = False
self.preferred = None self.preferred = None
self.verbose = False self.verbose = False
self.output_auto = False
def get_media(url, options): def get_media(url, options):
@ -93,6 +94,7 @@ def get_one_media(stream, options):
data = stream.get_urldata() data = stream.get_urldata()
match = re.search(r"(?i)<title[^>]*>\s*(.*?)\s*</title>", data, re.S) match = re.search(r"(?i)<title[^>]*>\s*(.*?)\s*</title>", data, re.S)
if match: if match:
options.output_auto = True
title_tag = decode_html_entities(match.group(1)) title_tag = decode_html_entities(match.group(1))
if not options.output: if not options.output:
options.output = filenamify(title_tag) options.output = filenamify(title_tag)