Skip to content

Commit 8001ec8

Browse files
authored
Clean up Youtube file (#44)
1 parent 57867d3 commit 8001ec8

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

src/async_python_youtube/youtube.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,16 @@ async def _request(
4444
data: dict[str, Any] | None = None,
4545
error_handler: dict[int, BaseException] | None = None,
4646
) -> dict[str, Any]:
47-
"""Handle a request to OpenSky.
47+
"""Handle a request to YouTube.
4848
4949
A generic method for sending/handling HTTP requests done against
50-
OpenSky.
50+
YouTube.
5151
5252
Args:
5353
----
5454
uri: the path to call.
5555
data: the query parameters to add.
56+
error_handler: object with what error to throw at what status code
5657
5758
Returns:
5859
-------
@@ -61,9 +62,9 @@ async def _request(
6162
6263
Raises:
6364
------
64-
OpenSkyConnectionError: An error occurred while communicating with
65-
the OpenSky API.
66-
OpenSkyrror: Received an unexpected response from the OpenSky API.
65+
YouTubeConnectionError: An error occurred while communicating with
66+
the YouTube API.
67+
YoutubeError: Received an unexpected response from the YouTube API.
6768
"""
6869
version = metadata.version(__package__)
6970
url = URL.build(
@@ -74,7 +75,7 @@ async def _request(
7475
).joinpath(uri)
7576

7677
headers = {
77-
"User-Agent": f"PythonOpenSky/{version}",
78+
"User-Agent": f"PythonYouTube/{version}",
7879
"Accept": "application/json, text/plain, */*",
7980
}
8081

@@ -146,7 +147,7 @@ async def close(self) -> None:
146147
if self.session and self._close_session:
147148
await self.session.close()
148149

149-
async def __aenter__(self) -> Any:
150+
async def __aenter__(self) -> "YouTube":
150151
"""Async enter.
151152
152153
Returns

0 commit comments

Comments
 (0)