mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-27 21:54:17 +01:00
get_media: split all_episodes to its own function
This commit is contained in:
parent
504b3ccf22
commit
f7488af095
@ -152,6 +152,12 @@ def get_media(url, options):
|
|||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
if options.all_episodes:
|
if options.all_episodes:
|
||||||
|
get_all_episodes(stream, options, url)
|
||||||
|
else:
|
||||||
|
get_one_media(stream, options)
|
||||||
|
|
||||||
|
|
||||||
|
def get_all_episodes(stream, options, url):
|
||||||
if options.output and os.path.isfile(options.output):
|
if options.output and os.path.isfile(options.output):
|
||||||
log.error("Output must be a directory if used with --all-episodes")
|
log.error("Output must be a directory if used with --all-episodes")
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
@ -175,8 +181,6 @@ def get_media(url, options):
|
|||||||
|
|
||||||
# get_one_media overwrites options.output...
|
# get_one_media overwrites options.output...
|
||||||
get_one_media(substream, copy.copy(options))
|
get_one_media(substream, copy.copy(options))
|
||||||
else:
|
|
||||||
get_one_media(stream, options)
|
|
||||||
|
|
||||||
|
|
||||||
def get_one_media(stream, options):
|
def get_one_media(stream, options):
|
||||||
|
Loading…
Reference in New Issue
Block a user