Merge pull request #1436 from stark821/master
Browse filesAdding list data type to 'res' parameter of filter() function.
- pytube/query.py +4 -1
pytube/query.py
CHANGED
@@ -123,7 +123,10 @@ class StreamQuery(Sequence):
|
|
123 |
"""
|
124 |
filters = []
|
125 |
if res or resolution:
|
126 |
-
|
|
|
|
|
|
|
127 |
|
128 |
if fps:
|
129 |
filters.append(lambda s: s.fps == fps)
|
|
|
123 |
"""
|
124 |
filters = []
|
125 |
if res or resolution:
|
126 |
+
if isinstance(res, str) or isinstance(resolution, str):
|
127 |
+
filters.append(lambda s: s.resolution == (res or resolution))
|
128 |
+
elif isinstance(res, list) or isinstance(resolution, list):
|
129 |
+
filters.append(lambda s: s.resolution in (res or resolution))
|
130 |
|
131 |
if fps:
|
132 |
filters.append(lambda s: s.fps == fps)
|