aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/options.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2015-02-10 03:32:21 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2015-02-10 03:32:24 +0100
commit347de4931cb3e496fb7b1dfb0314c213f44cce6b (patch)
tree778a6d8a67b4ba6e1ecff2d68ee02d44cefb105a /youtube_dl/options.py
parent88296505131f4b91ff91eaa0af34318664d892c9 (diff)
downloadyoutube-dl-347de4931cb3e496fb7b1dfb0314c213f44cce6b.tar.xz
[YoutubeDL] Add generic video filtering (Fixes #4916)
This functionality is intended to eventually encompass the current format filtering.
Diffstat (limited to 'youtube_dl/options.py')
-rw-r--r--youtube_dl/options.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/youtube_dl/options.py b/youtube_dl/options.py
index 9d9195b60..f64aa5b85 100644
--- a/youtube_dl/options.py
+++ b/youtube_dl/options.py
@@ -245,6 +245,25 @@ def parseOpts(overrideArguments=None):
metavar='COUNT', dest='max_views', default=None, type=int,
help='Do not download any videos with more than COUNT views')
selection.add_option(
+ '--match-filter',
+ metavar='FILTER', dest='match_filter', default=None,
+ help=(
+ '(Experimental) Generic video filter. '
+ 'Specify any key (see help for -o for a list of available keys) to'
+ ' match if the key is present, '
+ '!key to check if the key is not present,'
+ 'key > NUMBER (like "comment_count > 12", also works with '
+ '>=, <, <=, !=, =) to compare against a number, and '
+ '& to require multiple matches. '
+ 'Values which are not known are excluded unless you'
+ ' put a question mark (?) after the operator.'
+ 'For example, to only match videos that have been liked more than '
+ '100 times and disliked less than 50 times (or the dislike '
+ 'functionality is not available at the given service), but who '
+ 'also have a description, use --match-filter '
+ '"like_count > 100 & dislike_count <? 50 & description" .'
+ ))
+ selection.add_option(
'--no-playlist',
action='store_true', dest='noplaylist', default=False,
help='If the URL refers to a video and a playlist, download only the video.')