nficano commited on
Commit
860893c
·
1 Parent(s): 1e00427
.pre-commit-config.yaml CHANGED
@@ -16,7 +16,7 @@
16
  sha: v0.3.5
17
  hooks:
18
  - id: reorder-python-imports
19
- language_version: python3.6
20
  - repo: https://github.com/Lucas-C/pre-commit-hooks-safety
21
  sha: v1.1.0
22
  hooks:
 
16
  sha: v0.3.5
17
  hooks:
18
  - id: reorder-python-imports
19
+ language_version: python3.7
20
  - repo: https://github.com/Lucas-C/pre-commit-hooks-safety
21
  sha: v1.1.0
22
  hooks:
pytube/mixins.py CHANGED
@@ -30,7 +30,8 @@ def apply_signature(config_args, fmt, js):
30
  """
31
  stream_manifest = config_args[fmt]
32
  live_stream = json.loads(config_args['player_response']).get(
33
- 'playabilityStatus', {}).get('liveStreamability')
 
34
  for i, stream in enumerate(stream_manifest):
35
  if 'url' in stream:
36
  url = stream['url']
 
30
  """
31
  stream_manifest = config_args[fmt]
32
  live_stream = json.loads(config_args['player_response']).get(
33
+ 'playabilityStatus', {},
34
+ ).get('liveStreamability')
35
  for i, stream in enumerate(stream_manifest):
36
  if 'url' in stream:
37
  url = stream['url']
pytube/query.py CHANGED
@@ -178,7 +178,7 @@ class StreamQuery:
178
 
179
  fmt_streams = sorted(
180
  self.fmt_streams,
181
- key=key
182
  )
183
  return StreamQuery(fmt_streams)
184
 
 
178
 
179
  fmt_streams = sorted(
180
  self.fmt_streams,
181
+ key=key,
182
  )
183
  return StreamQuery(fmt_streams)
184
 
tests/test_query.py CHANGED
@@ -98,8 +98,10 @@ def test_order_by_descending(cipher_signature):
98
  .desc()
99
  .all()
100
  ]
101
- assert mime_types == ['video/webm', 'video/mp4',
102
- 'video/mp4', 'video/3gpp', 'video/3gpp']
 
 
103
 
104
 
105
  def test_order_by_ascending(cipher_signature):
@@ -125,8 +127,10 @@ def test_order_by_ascending(cipher_signature):
125
  .asc()
126
  .all()
127
  ]
128
- assert mime_types == ['video/3gpp', 'video/3gpp',
129
- 'video/mp4', 'video/mp4', 'video/webm']
 
 
130
 
131
 
132
  def test_get_by_itag(cipher_signature):
 
98
  .desc()
99
  .all()
100
  ]
101
+ assert mime_types == [
102
+ 'video/webm', 'video/mp4',
103
+ 'video/mp4', 'video/3gpp', 'video/3gpp',
104
+ ]
105
 
106
 
107
  def test_order_by_ascending(cipher_signature):
 
127
  .asc()
128
  .all()
129
  ]
130
+ assert mime_types == [
131
+ 'video/3gpp', 'video/3gpp',
132
+ 'video/mp4', 'video/mp4', 'video/webm',
133
+ ]
134
 
135
 
136
  def test_get_by_itag(cipher_signature):