ofscraper 3.8.4__tar.gz → 3.9.0.dev0__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.
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/PKG-INFO +1 -1
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/actions/process.py +1 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/classes/media.py +3 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/classes/placeholder.py +6 -9
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/download/common/common.py +1 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/download/common/text.py +1 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/download/download.py +2 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/download/downloadbatch.py +0 -2
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/binaries.py +0 -1
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/config/data.py +9 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/config/schema.py +1 -0
- ofscraper-3.9.0.dev0/ofscraper/utils/text.py +51 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/pyproject.toml +1 -1
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/LICENSE +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/README.md +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/__main__.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/__version__.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/__version__.pye +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/actions/__init__.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/actions/like.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/actions/scraper.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/api/archive.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/api/highlights.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/api/init.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/api/labels.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/api/me.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/api/messages.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/api/paid.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/api/pinned.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/api/profile.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/api/subscriptions/helpers.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/api/subscriptions/individual.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/api/subscriptions/lists.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/api/subscriptions/subscriptions.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/api/timeline.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/classes/labels.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/classes/models.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/classes/multiprocessprogress.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/classes/posts.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/classes/semaphoreDelayed.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/classes/sessionbuilder.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/classes/table.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/commands/check.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/commands/manual.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/commands/picker.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/commands/scraper.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/const/config.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/const/constants.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/const/date.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/const/download.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/const/files.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/const/general.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/const/logger.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/const/other_url.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/const/prompts.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/const/req.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/const/test_constants.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/const/time.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/const/url.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/db/__init__.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/db/operations.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/db/queries.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/download/alt_download.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/download/alt_downloadbatch.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/download/common/globals.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/download/common/keyhelpers.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/download/common/log.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/download/common/message.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/download/common/metadata.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/download/common/paths.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/download/common/progress.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/download/common/sem.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/download/downloadnormal.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/download/main_download.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/download/main_downloadbatch.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/filters/media/helpers.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/filters/media/main.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/filters/models/date.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/filters/models/flags.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/filters/models/other.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/filters/models/price.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/filters/models/sort.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/filters/models/subtype.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/models/retriver.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/models/selector.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/prompts/helpers/model_helpers.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/prompts/helpers/prompt_helpers.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/prompts/keybindings.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/prompts/promptConvert.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/prompts/prompt_groups/actions.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/prompts/prompt_groups/area.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/prompts/prompt_groups/auth.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/prompts/prompt_groups/binary.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/prompts/prompt_groups/config.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/prompts/prompt_groups/menu.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/prompts/prompt_groups/model.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/prompts/prompt_groups/profile.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/prompts/prompt_strings.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/prompts/prompt_validators.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/prompts/prompts.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/runner/exit.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/runner/load.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/runner/run.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/__init__.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/actions.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/args/areas.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/args/globals.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/args/helpers.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/args/parse.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/args/quality.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/args/read.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/args/user.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/args/write.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/auth/context.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/auth/data.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/auth/file.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/auth/helpers.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/auth/make.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/auth/request.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/auth/schema.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/cache.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/checkers.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/config/config.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/config/context.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/config/custom.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/config/file.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/config/menu.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/config/wrapper.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/console.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/constants.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/context/exit.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/context/run_async.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/context/stdout.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/dates.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/encoding.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/hash.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/logs/classes.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/logs/close.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/logs/globals.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/logs/helpers.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/logs/logger.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/logs/logs.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/logs/other.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/logs/stdout.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/manager.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/me.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/menu.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/paths/check.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/paths/common.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/paths/manage.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/paths/paths.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/profiles/data.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/profiles/manage.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/profiles/tools.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/run.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/separate.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/settings.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/system/free.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/system/network.py +0 -0
- {ofscraper-3.8.4 → ofscraper-3.9.0.dev0}/ofscraper/utils/system/system.py +0 -0
|
@@ -37,6 +37,7 @@ import ofscraper.utils.constants as constants
|
|
|
37
37
|
import ofscraper.utils.context.exit as exit
|
|
38
38
|
import ofscraper.utils.context.stdout as stdout
|
|
39
39
|
import ofscraper.utils.profiles.tools as profile_tools
|
|
40
|
+
from ofscraper.utils.text import get_text
|
|
40
41
|
|
|
41
42
|
log = logging.getLogger("shared")
|
|
42
43
|
|
|
@@ -90,9 +90,9 @@ class tempFilePlaceholder(basePlaceholder):
|
|
|
90
90
|
self._tempname = tempname
|
|
91
91
|
|
|
92
92
|
async def init(self):
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
)
|
|
93
|
+
dir = await self.gettempDir(self._ele)
|
|
94
|
+
file = self._tempname
|
|
95
|
+
self._tempfilepath = paths.truncate(pathlib.Path(dir, file))
|
|
96
96
|
|
|
97
97
|
@basePlaceholder.async_wrapper
|
|
98
98
|
async def gettempDir(self, ele, create=True):
|
|
@@ -190,12 +190,9 @@ class Placeholders(basePlaceholder):
|
|
|
190
190
|
self._ext = ext
|
|
191
191
|
|
|
192
192
|
async def init(self):
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
await self.createfilename(),
|
|
197
|
-
)
|
|
198
|
-
)
|
|
193
|
+
dir = await self.getmediadir()
|
|
194
|
+
file = await self.createfilename()
|
|
195
|
+
self._filepath = paths.truncate(pathlib.Path(dir, file))
|
|
199
196
|
|
|
200
197
|
def add_price_variables(self, username):
|
|
201
198
|
modelObj = selector.get_model_fromParsed(username)
|
|
@@ -32,6 +32,7 @@ from ofscraper.download.common.metadata import *
|
|
|
32
32
|
from ofscraper.download.common.paths import *
|
|
33
33
|
from ofscraper.download.common.progress import *
|
|
34
34
|
from ofscraper.download.common.sem import sem_wrapper
|
|
35
|
+
from ofscraper.download.common.text import *
|
|
35
36
|
from ofscraper.utils.context.run_async import run
|
|
36
37
|
|
|
37
38
|
|
|
@@ -11,6 +11,7 @@ import ofscraper.utils.hash as hash
|
|
|
11
11
|
import ofscraper.utils.separate as seperate
|
|
12
12
|
import ofscraper.utils.settings as settings
|
|
13
13
|
import ofscraper.utils.system.system as system
|
|
14
|
+
from ofscraper.download.common.common import textDownloader
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
def medialist_filter(medialist, model_id, username):
|
|
@@ -36,6 +37,7 @@ def medialist_filter(medialist, model_id, username):
|
|
|
36
37
|
def download_process(username, model_id, medialist):
|
|
37
38
|
medialist = medialist_filter(medialist, model_id, username)
|
|
38
39
|
medialist = helpers.post_count_filter(medialist)
|
|
40
|
+
textDownloader(medialist)
|
|
39
41
|
download_picker(username, model_id, medialist)
|
|
40
42
|
remove_downloads_with_hashes(username, model_id)
|
|
41
43
|
|
|
@@ -381,11 +381,9 @@ async def process_dicts_split(username, model_id, medialist):
|
|
|
381
381
|
)
|
|
382
382
|
|
|
383
383
|
aws = []
|
|
384
|
-
|
|
385
384
|
async with sessionbuilder.sessionBuilder() as c:
|
|
386
385
|
for ele in medialist:
|
|
387
386
|
aws.append(asyncio.create_task(download(c, ele, model_id, username)))
|
|
388
|
-
|
|
389
387
|
for coro in asyncio.as_completed(aws):
|
|
390
388
|
try:
|
|
391
389
|
pack = await coro
|
|
@@ -681,6 +681,15 @@ def get_images_overwrites(config=None):
|
|
|
681
681
|
)
|
|
682
682
|
|
|
683
683
|
|
|
684
|
+
@wrapper.config_reader
|
|
685
|
+
def get_text_overwrites(config=None):
|
|
686
|
+
if config == False:
|
|
687
|
+
return constants.EMPTY_MEDIA_DEFAULT
|
|
688
|
+
return config.get("overwrites", {}).get("text") or constants_attr.getattr(
|
|
689
|
+
"EMPTY_MEDIA_DEFAULT"
|
|
690
|
+
)
|
|
691
|
+
|
|
692
|
+
|
|
684
693
|
@wrapper.config_reader
|
|
685
694
|
def get_max_post_count(config=None):
|
|
686
695
|
if config == False:
|
|
@@ -75,6 +75,7 @@ def get_current_config_schema(config: dict = None) -> dict:
|
|
|
75
75
|
"audios": data.get_audios_overwrites(config=config),
|
|
76
76
|
"videos": data.get_videos_overwrites(config=config),
|
|
77
77
|
"images": data.get_images_overwrites(config=config),
|
|
78
|
+
"text": data.get_text_overwrites(config=config),
|
|
78
79
|
},
|
|
79
80
|
}
|
|
80
81
|
return new_config
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
import copy
|
|
3
|
+
import logging
|
|
4
|
+
import pathlib
|
|
5
|
+
import textwrap
|
|
6
|
+
import traceback
|
|
7
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
8
|
+
|
|
9
|
+
import aiofiles
|
|
10
|
+
|
|
11
|
+
import ofscraper.classes.placeholder as placeholder
|
|
12
|
+
import ofscraper.utils.args.read as read_args
|
|
13
|
+
import ofscraper.utils.constants as constants
|
|
14
|
+
import ofscraper.utils.settings as settings
|
|
15
|
+
from ofscraper.utils.context.run_async import run
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@run
|
|
19
|
+
async def get_text(values):
|
|
20
|
+
with ThreadPoolExecutor(
|
|
21
|
+
max_workers=constants.getattr("MAX_TEXT_WORKER")
|
|
22
|
+
) as executor:
|
|
23
|
+
asyncio.get_event_loop().set_default_executor(executor)
|
|
24
|
+
dupe = read_args.retriveArgs().dupe
|
|
25
|
+
async with asyncio.TaskGroup() as tg:
|
|
26
|
+
[tg.create_task(get_text_process(value, dupe=dupe)) for value in values]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
async def get_text_process(ele, dupe=None):
|
|
30
|
+
log = logging.getLogger("shared")
|
|
31
|
+
try:
|
|
32
|
+
if "Text" not in settings.get_mediatypes():
|
|
33
|
+
return
|
|
34
|
+
elif bool(ele.text) == False:
|
|
35
|
+
return
|
|
36
|
+
# make new text mediatype
|
|
37
|
+
new_ele = copy.deepcopy(ele)
|
|
38
|
+
new_ele.mediatype = "text"
|
|
39
|
+
|
|
40
|
+
placeholderObj = placeholder.Placeholders(new_ele, "txt")
|
|
41
|
+
await placeholderObj.init()
|
|
42
|
+
if pathlib.Path(placeholderObj.filepath).exists() and not dupe:
|
|
43
|
+
return
|
|
44
|
+
wrapped_text = textwrap.wrap(
|
|
45
|
+
new_ele.text, width=constants.getattr("MAX_TEXT_LENGTH")
|
|
46
|
+
)
|
|
47
|
+
async with aiofiles.open(placeholderObj.filepath, "w") as p:
|
|
48
|
+
await p.writelines(wrapped_text)
|
|
49
|
+
except Exception as E:
|
|
50
|
+
log.traceback_(f"{E}")
|
|
51
|
+
log.traceback_(f"{traceback.format_exc()}")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|