xhamster_api 2.0__tar.gz → 2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xhamster_api
3
- Version: 2.0
3
+ Version: 2.1
4
4
  Summary: A Python API for the Porn Site xhamster.com
5
5
  Author: Johannes Habel
6
6
  Author-email: Johannes Habel <EchterAlsFake@proton.me>
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "xhamster_api"
7
- version = "2.0"
7
+ version = "2.1"
8
8
  description = "A Python API for the Porn Site xhamster.com"
9
9
  readme = { file = "README.md", content-type = "text/markdown" }
10
10
  requires-python = ">=3.10"
@@ -30,7 +30,7 @@ except (ModuleNotFoundError, ImportError):
30
30
  parser = "html.parser"
31
31
 
32
32
 
33
- async def get_html_content(core: BaseCore, url: str) -> str | None:
33
+ async def get_html_content(core: BaseCore, url: str) -> str | None | dict:
34
34
  # What should I do here?
35
35
  try:
36
36
  content = await core.fetch(url)
@@ -41,17 +41,17 @@ async def get_html_content(core: BaseCore, url: str) -> str | None:
41
41
  if content.status_code == 404:
42
42
  raise NotFound(f"Server returned 404 for: {url}")
43
43
 
44
- except NetworkingError:
45
- raise NetworkError from NetworkingError
44
+ except NetworkingError as e:
45
+ raise NetworkError(str(e)) from e
46
46
 
47
- except InvalidProxy:
48
- raise ProxyError from InvalidProxy
47
+ except InvalidProxy as e:
48
+ raise ProxyError(str(e)) from e
49
49
 
50
- except BotProtectionDetected:
51
- raise BotDetection from BotProtectionDetected
50
+ except BotProtectionDetected as e:
51
+ raise BotDetection(str(e)) from e
52
52
 
53
- except UnknownError:
54
- raise UnknownNetworkError from UnknownError
53
+ except UnknownError as e:
54
+ raise UnknownNetworkError(str(e)) from e
55
55
 
56
56
 
57
57
  class Something(Helper):
File without changes
File without changes