stark821 commited on
Commit
f697a53
·
unverified ·
1 Parent(s): 8c1afab

Adding list data type to 'res' parameter of filter() function.

Browse files

Adding list data type in addition to the existing str type to the 'res' and 'resolution' parameter of the filter() function of the StreamQuery class. This enables us to get streams with multiple resolutions in a single query.

Files changed (1) hide show
  1. pytube/query.py +1 -1
pytube/query.py CHANGED
@@ -126,7 +126,7 @@ class StreamQuery(Sequence):
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 (resolution or res))
130
 
131
  if fps:
132
  filters.append(lambda s: s.fps == fps)
 
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)