aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/YoutubeDL.py
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-11-22 14:57:53 +0100
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-12-03 20:15:20 +0100
commit1dcc4c0cad886457c0fa5f874c38f95f0510ea4f (patch)
treef874dc3e679c5ef9928df3205cf24c96da540f12 /youtube_dl/YoutubeDL.py
parent84db81815af6787d91188ca065cc9ced4d83a4ca (diff)
Add --load-info option (#972)
It just calls the 'YoutubeDL.process_ie_result' with the dictionary from the json file
Diffstat (limited to 'youtube_dl/YoutubeDL.py')
-rw-r--r--youtube_dl/YoutubeDL.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index b68b110a4..80c056dc8 100644
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -812,6 +812,12 @@ class YoutubeDL(object):
return self._download_retcode
+ def download_with_info_file(self, info_filename):
+ with open(info_filename, 'r') as f:
+ # TODO: Check for errors
+ info = json.load(f)
+ self.process_ie_result(info, download=True)
+
def post_process(self, filename, ie_info):
"""Run all the postprocessors on the given file."""
info = dict(ie_info)