eaf-base-api 2.4.5__tar.gz → 2.4.6__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: eaf_base_api
3
- Version: 2.4.5
3
+ Version: 2.4.6
4
4
  Summary: A base API for EchterAlsFake's Porn APIs
5
5
  Author-email: Johannes Habel <EchterAlsFake@proton.me>
6
6
  License: LGPLv3
@@ -1120,7 +1120,7 @@ class BaseCore:
1120
1120
  return url, b"", False
1121
1121
 
1122
1122
  def download(self, video, quality: str, downloader: str, path: str, callback=None, remux: bool = False,
1123
- callback_remux=None) -> None:
1123
+ callback_remux=None, max_workers_download: int = 20) -> None:
1124
1124
  """
1125
1125
  :param video:
1126
1126
  :param callback:
@@ -1129,8 +1129,10 @@ class BaseCore:
1129
1129
  :param path:
1130
1130
  :param remux:
1131
1131
  :param callback_remux:
1132
+ :param max_workers_download:
1132
1133
  :return:
1133
1134
  """
1135
+ max_workers_download = max_workers_download or self.config.max_workers_download
1134
1136
 
1135
1137
  if callback is None:
1136
1138
  callback = Callback.text_progress_bar
@@ -1139,14 +1141,14 @@ class BaseCore:
1139
1141
  self.default(video=video, quality=quality, path=path, callback=callback, remux=remux, callback_remux=callback_remux)
1140
1142
 
1141
1143
  elif downloader == "threaded":
1142
- threaded_download = self.threaded(max_workers=20, timeout=10)
1144
+ threaded_download = self.threaded(max_workers=max_workers_download, timeout=self.config.timeout)
1143
1145
  threaded_download(self, video=video, quality=quality, path=path, callback=callback, remux=remux,
1144
1146
  callback_remux=callback_remux)
1145
1147
 
1146
1148
  elif downloader == "FFMPEG":
1147
1149
  self.FFMPEG(video=video, quality=quality, path=path, callback=callback)
1148
1150
 
1149
- def threaded(self, max_workers: int = 20, timeout: int = 10):
1151
+ def threaded(self, max_workers: int, timeout: int):
1150
1152
  def wrapper(self, video, quality: str, callback, path: str, remux: bool = True, callback_remux=None):
1151
1153
  """
1152
1154
  This function has already been optimized a lot and is pretty much perfect in what's possible if we
@@ -12,6 +12,10 @@ class RuntimeConfig:
12
12
  self.cookies = None
13
13
  self.locale = "en-US,en;q=0.9" # If you override this, it could change regexes and thus make stuff not work...
14
14
  self.use_http2 = True
15
+ self.max_workers_download = 20
16
+ self.videos_concurrency = 5
17
+ self.pages_concurrency = 2
18
+
15
19
 
16
20
  # Singleton instance needed for my Porn Fetch project
17
21
  config = RuntimeConfig()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eaf_base_api
3
- Version: 2.4.5
3
+ Version: 2.4.6
4
4
  Summary: A base API for EchterAlsFake's Porn APIs
5
5
  Author-email: Johannes Habel <EchterAlsFake@proton.me>
6
6
  License: LGPLv3
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "eaf_base_api"
7
- version = "2.4.5"
7
+ version = "2.4.6"
8
8
  description = "A base API for EchterAlsFake's Porn APIs"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.6"
File without changes
File without changes
File without changes
File without changes