analyze with codefactor
Browse files- README.md +2 -1
- pytube/query.py +4 -5
README.md
CHANGED
@@ -2,10 +2,11 @@
|
|
2 |
<div align="center">
|
3 |
<p align="center">
|
4 |
<a href="https://pypi.org/project/pytube3/"><img src="https://img.shields.io/pypi/v/pytube3.svg" alt="pypi"></a>
|
|
|
5 |
<a href="https://travis-ci.com/hbmartin/pytube3/"><img src="https://travis-ci.org/hbmartin/pytube3.svg?branch=master" /></a>
|
6 |
<a href='https://pytube3.readthedocs.io/en/latest/?badge=latest'><img src='https://readthedocs.org/projects/pytube3/badge/?version=latest' alt='Documentation Status' /></a>
|
7 |
<a href="https://coveralls.io/github/hbmartin/pytube3?branch=master"><img src="https://coveralls.io/repos/github/hbmartin/pytube3/badge.svg?branch=master" /></a>
|
8 |
-
<a href="https://
|
9 |
<a href="https://github.com/ambv/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg" /></a>
|
10 |
<a href="https://twitter.com/hmartin"><img src="https://img.shields.io/badge/[email protected]?style=flat" /></a>
|
11 |
</p>
|
|
|
2 |
<div align="center">
|
3 |
<p align="center">
|
4 |
<a href="https://pypi.org/project/pytube3/"><img src="https://img.shields.io/pypi/v/pytube3.svg" alt="pypi"></a>
|
5 |
+
<a href="https://pypi.python.org/pypi/pytube3/"><img src="https://img.shields.io/pypi/pyversions/pytube3.svg" /></a>
|
6 |
<a href="https://travis-ci.com/hbmartin/pytube3/"><img src="https://travis-ci.org/hbmartin/pytube3.svg?branch=master" /></a>
|
7 |
<a href='https://pytube3.readthedocs.io/en/latest/?badge=latest'><img src='https://readthedocs.org/projects/pytube3/badge/?version=latest' alt='Documentation Status' /></a>
|
8 |
<a href="https://coveralls.io/github/hbmartin/pytube3?branch=master"><img src="https://coveralls.io/repos/github/hbmartin/pytube3/badge.svg?branch=master" /></a>
|
9 |
+
<a href="https://www.codefactor.io/repository/github/hbmartin/pytube3/overview/master"><img src="https://www.codefactor.io/repository/github/hbmartin/pytube3/badge/master" alt="CodeFactor" /></a>
|
10 |
<a href="https://github.com/ambv/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg" /></a>
|
11 |
<a href="https://twitter.com/hmartin"><img src="https://img.shields.io/badge/[email protected]?style=flat" /></a>
|
12 |
</p>
|
pytube/query.py
CHANGED
@@ -191,7 +191,6 @@ class StreamQuery:
|
|
191 |
}
|
192 |
except ValueError:
|
193 |
integer_attr_repr = None
|
194 |
-
pass
|
195 |
|
196 |
# lookup integer values if we have them
|
197 |
if integer_attr_repr is not None:
|
@@ -201,10 +200,10 @@ class StreamQuery:
|
|
201 |
key=lambda s: integer_attr_repr[getattr(s, attribute_name)], # type: ignore # noqa: E501
|
202 |
)
|
203 |
)
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
|
209 |
def desc(self) -> "StreamQuery":
|
210 |
"""Sort streams in descending order.
|
|
|
191 |
}
|
192 |
except ValueError:
|
193 |
integer_attr_repr = None
|
|
|
194 |
|
195 |
# lookup integer values if we have them
|
196 |
if integer_attr_repr is not None:
|
|
|
200 |
key=lambda s: integer_attr_repr[getattr(s, attribute_name)], # type: ignore # noqa: E501
|
201 |
)
|
202 |
)
|
203 |
+
|
204 |
+
return StreamQuery(
|
205 |
+
sorted(has_attribute, key=lambda s: getattr(s, attribute_name))
|
206 |
+
)
|
207 |
|
208 |
def desc(self) -> "StreamQuery":
|
209 |
"""Sort streams in descending order.
|