eaf-base-api 2.2.4__tar.gz → 2.2.5__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.2
2
2
  Name: eaf_base_api
3
- Version: 2.2.4
3
+ Version: 2.2.5
4
4
  Summary: A base API for EchterAlsFake's Porn APIs
5
5
  Home-page: https://github.com/EchterAlsFake/eaf_base_api
6
6
  Author: Johannes Habel
@@ -152,11 +152,20 @@ class BaseCore:
152
152
  return response
153
153
 
154
154
  # Process and return content
155
+ # Collecting all chunks before processing because some sites cause issues with real-time decoding
156
+ raw_content = b"".join(response.iter_bytes())
157
+
155
158
  if get_bytes:
156
- content = b"".join([chunk for chunk in response.iter_bytes()])
159
+ content = raw_content
160
+
157
161
  else:
158
- content = "".join([chunk.decode("utf-8") for chunk in response.iter_bytes()])
159
- if save_cache:
162
+ try:
163
+ content = raw_content.decode("utf-8")
164
+
165
+ except UnicodeDecodeError:
166
+ content = raw_content.decode("latin1") # Fallback, hope that works somehow idk
167
+
168
+ if save_cache and not get_bytes:
160
169
  logger.debug(f"Saving content of {url} to local cache.")
161
170
  cache.save_cache(url, content)
162
171
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: eaf_base_api
3
- Version: 2.2.4
3
+ Version: 2.2.5
4
4
  Summary: A base API for EchterAlsFake's Porn APIs
5
5
  Home-page: https://github.com/EchterAlsFake/eaf_base_api
6
6
  Author: Johannes Habel
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="eaf_base_api",
5
- version="2.2.4",
5
+ version="2.2.5",
6
6
  packages=find_packages(),
7
7
  install_requires=["ffmpeg-progress-yield", "m3u8", "httpx"],
8
8
  entry_points={
File without changes
File without changes
File without changes