aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-08-21 11:52:07 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2014-08-21 11:52:07 +0200
commite8ee972c6ea211a51275c8eb8bfc81b9ae3a9844 (patch)
tree4ab2920fb57fc777c28af30cf4c38166c81005d2 /youtube_dl
parentaf8322d2f993653dbec5e6ad943f8cc632b901e4 (diff)
Allow playlist test definitions in test_download.
This moves playlist tests where they belong, i.e. to the extractors themselves. Additionally, all our network interaction configuration for tests in test_download now applies to playlist tests as well.
Diffstat (limited to 'youtube_dl')
-rwxr-xr-xyoutube_dl/YoutubeDL.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index 14a1d06ab..e7194f3e3 100755
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -162,6 +162,7 @@ class YoutubeDL(object):
default_search: Prepend this string if an input url is not valid.
'auto' for elaborate guessing
encoding: Use this encoding instead of the system-specified.
+ extract_flat: Do not resolve URLs, return the immediate result.
The following parameters are not used by YoutubeDL itself, they are used by
the FileDownloader:
@@ -558,7 +559,12 @@ class YoutubeDL(object):
Returns the resolved ie_result.
"""
- result_type = ie_result.get('_type', 'video') # If not given we suppose it's a video, support the default old system
+ result_type = ie_result.get('_type', 'video')
+
+ if self.params.get('extract_flat', False):
+ if result_type in ('url', 'url_transparent'):
+ return ie_result
+
if result_type == 'video':
self.add_extra_info(ie_result, extra_info)
return self.process_video_result(ie_result, download=download)