ofscraper 3.9.0.dev13__tar.gz → 3.9.2__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.9.0.dev13 → ofscraper-3.9.2}/PKG-INFO +1 -1
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/actions/like.py +1 -1
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/actions/scraper.py +2 -10
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/api/archive.py +7 -2
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/api/highlights.py +1 -2
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/api/labels.py +4 -1
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/api/me.py +2 -4
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/api/messages.py +8 -5
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/api/paid.py +33 -20
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/api/pinned.py +1 -1
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/api/profile.py +1 -2
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/api/subscriptions/individual.py +1 -2
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/api/subscriptions/lists.py +51 -14
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/api/subscriptions/subscriptions.py +3 -4
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/api/timeline.py +7 -3
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/classes/media.py +11 -3
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/classes/sessionmanager.py +60 -15
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/commands/check.py +47 -70
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/commands/manual.py +1 -2
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/const/prompts.py +1 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/const/req.py +15 -10
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/const/test_constants.py +1 -1
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/const/time.py +1 -0
- ofscraper-3.9.2/ofscraper/db/operations.py +365 -0
- ofscraper-3.9.2/ofscraper/db/operations_/helpers.py +7 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/db/operations_/labels.py +28 -15
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/db/operations_/media.py +30 -19
- ofscraper-3.9.2/ofscraper/db/operations_/merge.py +271 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/db/operations_/messages.py +27 -14
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/db/operations_/others.py +46 -22
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/db/operations_/posts.py +28 -19
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/db/operations_/profile.py +47 -18
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/db/operations_/stories.py +31 -15
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/db/operations_/wrapper.py +11 -4
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/download/alt_download.py +23 -31
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/download/alt_downloadbatch.py +23 -33
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/download/download.py +1 -2
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/download/downloadbatch.py +15 -23
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/download/downloadnormal.py +10 -16
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/download/main_download.py +18 -34
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/download/main_downloadbatch.py +17 -26
- ofscraper-3.9.2/ofscraper/download/shared/classes/retries.py +30 -0
- ofscraper-3.9.2/ofscraper/download/shared/classes/session.py +24 -0
- {ofscraper-3.9.0.dev13/ofscraper/download → ofscraper-3.9.2/ofscraper/download/shared}/common/alt_common.py +10 -8
- ofscraper-3.9.0.dev13/ofscraper/download/common/common.py → ofscraper-3.9.2/ofscraper/download/shared/common/general.py +8 -8
- {ofscraper-3.9.0.dev13/ofscraper/download → ofscraper-3.9.2/ofscraper/download/shared}/common/main_common.py +12 -7
- {ofscraper-3.9.0.dev13/ofscraper/download/common → ofscraper-3.9.2/ofscraper/download/shared}/globals.py +0 -1
- {ofscraper-3.9.0.dev13/ofscraper/download/common → ofscraper-3.9.2/ofscraper/download/shared/utils}/keyhelpers.py +16 -12
- {ofscraper-3.9.0.dev13/ofscraper/download/common → ofscraper-3.9.2/ofscraper/download/shared/utils}/log.py +1 -1
- {ofscraper-3.9.0.dev13/ofscraper/download/common → ofscraper-3.9.2/ofscraper/download/shared/utils}/message.py +1 -1
- {ofscraper-3.9.0.dev13/ofscraper/download/common → ofscraper-3.9.2/ofscraper/download/shared/utils}/metadata.py +5 -5
- {ofscraper-3.9.0.dev13/ofscraper/download/common → ofscraper-3.9.2/ofscraper/download/shared/utils}/paths.py +26 -8
- {ofscraper-3.9.0.dev13/ofscraper/download/common → ofscraper-3.9.2/ofscraper/download/shared/utils}/progress.py +1 -1
- {ofscraper-3.9.0.dev13/ofscraper/download/common → ofscraper-3.9.2/ofscraper/download/shared/utils}/text.py +1 -1
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/filters/media/helpers.py +6 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/filters/models/date.py +22 -10
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/filters/models/flags.py +27 -12
- ofscraper-3.9.2/ofscraper/filters/models/helpers.py +24 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/filters/models/other.py +3 -1
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/filters/models/price.py +51 -27
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/filters/models/sort.py +2 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/filters/models/subtype.py +12 -3
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/models/retriver.py +1 -1
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/models/selector.py +4 -4
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/prompts/prompt_groups/config.py +2 -2
- ofscraper-3.9.2/ofscraper/prompts/prompt_groups/merge.py +84 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/prompts/prompts.py +1 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/auth/request.py +16 -8
- ofscraper-3.9.2/ofscraper/utils/config/context.py +43 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/config/data.py +25 -24
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/config/file.py +7 -7
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/config/schema.py +1 -1
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/logs/classes.py +1 -1
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/menu.py +3 -0
- ofscraper-3.9.2/ofscraper/utils/merge.py +24 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/paths/common.py +0 -1
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/paths/paths.py +7 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/progress.py +12 -12
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/system/network.py +2 -2
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/system/system.py +4 -4
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/pyproject.toml +1 -1
- ofscraper-3.9.0.dev13/ofscraper/db/operations.py +0 -262
- ofscraper-3.9.0.dev13/ofscraper/db/operations_/helpers.py +0 -7
- ofscraper-3.9.0.dev13/ofscraper/download/common/sem.py +0 -0
- ofscraper-3.9.0.dev13/ofscraper/utils/config/context.py +0 -34
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/LICENSE +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/README.md +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/__main__.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/__version__.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/__version__.pye +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/actions/__init__.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/actions/process.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/api/common/logs.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/api/init.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/api/subscriptions/helpers.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/classes/base.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/classes/labels.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/classes/models.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/classes/multiprocessprogress.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/classes/placeholder.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/classes/posts.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/classes/semaphoreDelayed.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/classes/table.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/commands/picker.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/commands/scraper.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/const/binary.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/const/config.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/const/constants.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/const/date.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/const/download.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/const/files.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/const/general.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/const/logger.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/const/metadata.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/const/other_url.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/const/url.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/db/__init__.py +0 -0
- {ofscraper-3.9.0.dev13/ofscraper/download/common → ofscraper-3.9.2/ofscraper/download/shared/utils}/media.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/filters/media/main.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/prompts/helpers/model_helpers.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/prompts/helpers/prompt_helpers.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/prompts/keybindings.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/prompts/promptConvert.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/prompts/prompt_groups/actions.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/prompts/prompt_groups/area.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/prompts/prompt_groups/auth.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/prompts/prompt_groups/binary.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/prompts/prompt_groups/menu.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/prompts/prompt_groups/model.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/prompts/prompt_groups/profile.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/prompts/prompt_strings.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/prompts/prompt_validators.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/runner/exit.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/runner/load.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/runner/run.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/__init__.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/actions.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/args/areas.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/args/globals.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/args/groups/common_args.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/args/groups/main_args.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/args/groups/manual_args.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/args/groups/message_args.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/args/groups/paid_args.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/args/groups/post_args.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/args/groups/story_args.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/args/helpers.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/args/parse.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/args/quality.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/args/read.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/args/user.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/args/write.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/auth/context.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/auth/data.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/auth/file.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/auth/helpers.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/auth/make.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/auth/schema.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/binaries.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/cache.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/checkers.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/config/config.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/config/custom.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/config/menu.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/config/wrapper.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/console.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/constants.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/context/exit.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/context/run_async.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/context/stdout.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/dates.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/encoding.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/hash.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/logs/close.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/logs/globals.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/logs/helpers.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/logs/logger.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/logs/logs.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/logs/other.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/logs/stdout.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/manager.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/me.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/paths/check.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/paths/manage.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/profiles/data.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/profiles/manage.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/profiles/tools.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/run.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/sems.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/separate.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/settings.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/system/free.py +0 -0
- {ofscraper-3.9.0.dev13 → ofscraper-3.9.2}/ofscraper/utils/text.py +0 -0
|
@@ -53,7 +53,7 @@ async def get_posts(model_id, username):
|
|
|
53
53
|
retries=constants.getattr("API_NUM_TRIES"),
|
|
54
54
|
wait_min=constants.getattr("OF_MIN_WAIT_API"),
|
|
55
55
|
wait_max=constants.getattr("OF_MAX_WAIT_API"),
|
|
56
|
-
new_request_auth=True
|
|
56
|
+
new_request_auth=True,
|
|
57
57
|
) as c:
|
|
58
58
|
while True:
|
|
59
59
|
max_count = min(
|
|
@@ -385,15 +385,8 @@ async def process_profile(username) -> list:
|
|
|
385
385
|
async def process_all_paid():
|
|
386
386
|
with stdout.lowstdout():
|
|
387
387
|
paid_content = await paid.get_all_paid_posts()
|
|
388
|
-
user_dict = {}
|
|
389
|
-
|
|
390
|
-
for ele in paid_content:
|
|
391
|
-
user_id = ele.get("fromUser", {}).get("id") or ele.get("author", {}).get(
|
|
392
|
-
"id"
|
|
393
|
-
)
|
|
394
|
-
user_dict.setdefault(user_id, []).append(ele)
|
|
395
388
|
output = {}
|
|
396
|
-
for model_id, value in
|
|
389
|
+
for model_id, value in paid_content.items():
|
|
397
390
|
username = profile.scrape_profile(model_id).get("username")
|
|
398
391
|
if username == constants.getattr(
|
|
399
392
|
"DELETED_MODEL_PLACEHOLDER"
|
|
@@ -521,8 +514,7 @@ async def process_task(model_id, username, ele):
|
|
|
521
514
|
wait_min=constants.getattr("OF_MIN_WAIT_API"),
|
|
522
515
|
wait_max=constants.getattr("OF_MAX_WAIT_API"),
|
|
523
516
|
total_timeout=constants.getattr("API_TIMEOUT_PER_TASK"),
|
|
524
|
-
|
|
525
|
-
|
|
517
|
+
new_request_auth=True,
|
|
526
518
|
) as c:
|
|
527
519
|
while True:
|
|
528
520
|
max_count = min(
|
|
@@ -22,6 +22,7 @@ import ofscraper.utils.constants as constants
|
|
|
22
22
|
import ofscraper.utils.progress as progress_utils
|
|
23
23
|
import ofscraper.utils.settings as settings
|
|
24
24
|
from ofscraper.utils.context.run_async import run
|
|
25
|
+
from ofscraper.utils.logs.helpers import is_trace
|
|
25
26
|
|
|
26
27
|
log = logging.getLogger("shared")
|
|
27
28
|
|
|
@@ -131,7 +132,7 @@ async def process_tasks(tasks, model_id, after):
|
|
|
131
132
|
|
|
132
133
|
def get_split_array(oldarchived, after):
|
|
133
134
|
if len(oldarchived) == 0:
|
|
134
|
-
return
|
|
135
|
+
return []
|
|
135
136
|
min_posts = max(
|
|
136
137
|
len(oldarchived) // constants.getattr("REASONABLE_MAX_PAGE"),
|
|
137
138
|
constants.getattr("MIN_PAGE_POST_COUNT"),
|
|
@@ -230,7 +231,7 @@ def set_check(unduped, model_id, after):
|
|
|
230
231
|
cache.set(
|
|
231
232
|
f"archived_check_{model_id}",
|
|
232
233
|
all_posts,
|
|
233
|
-
expire=constants.getattr("
|
|
234
|
+
expire=constants.getattr("THREE_DAY_SECONDS"),
|
|
234
235
|
)
|
|
235
236
|
cache.close()
|
|
236
237
|
|
|
@@ -377,6 +378,8 @@ async def scrape_archived_posts(
|
|
|
377
378
|
|
|
378
379
|
|
|
379
380
|
def trace_log_task(responseArray):
|
|
381
|
+
if not is_trace():
|
|
382
|
+
return
|
|
380
383
|
chunk_size = constants.getattr("LARGE_TRACE_CHUNK_SIZE")
|
|
381
384
|
for i in range(1, len(responseArray) + 1, chunk_size):
|
|
382
385
|
# Calculate end index considering potential last chunk being smaller
|
|
@@ -394,6 +397,8 @@ def trace_log_task(responseArray):
|
|
|
394
397
|
|
|
395
398
|
|
|
396
399
|
def trace_log_old(responseArray):
|
|
400
|
+
if not is_trace():
|
|
401
|
+
return
|
|
397
402
|
chunk_size = constants.getattr("LARGE_TRACE_CHUNK_SIZE")
|
|
398
403
|
for i in range(1, len(responseArray) + 1, chunk_size):
|
|
399
404
|
# Calculate end index considering potential last chunk being smaller
|
|
@@ -436,8 +436,7 @@ def get_individual_stories(id, c=None):
|
|
|
436
436
|
retries=constants.getattr("API_INDVIDIUAL_NUM_TRIES"),
|
|
437
437
|
wait_min=constants.getattr("OF_MIN_WAIT_API"),
|
|
438
438
|
wait_max=constants.getattr("OF_MAX_WAIT_API"),
|
|
439
|
-
new_request_auth=True
|
|
440
|
-
|
|
439
|
+
new_request_auth=True,
|
|
441
440
|
) as c:
|
|
442
441
|
with c.requests_async(constants.getattr("storiesSPECIFIC").format(id)) as r:
|
|
443
442
|
log.trace(f"highlight raw highlight individua; {r.json_()}")
|
|
@@ -21,6 +21,7 @@ import ofscraper.utils.cache as cache
|
|
|
21
21
|
import ofscraper.utils.constants as constants
|
|
22
22
|
import ofscraper.utils.progress as progress_utils
|
|
23
23
|
from ofscraper.utils.context.run_async import run
|
|
24
|
+
from ofscraper.utils.logs.helpers import is_trace
|
|
24
25
|
|
|
25
26
|
log = logging.getLogger("shared")
|
|
26
27
|
|
|
@@ -394,12 +395,14 @@ def set_check(unduped, model_id):
|
|
|
394
395
|
cache.set(
|
|
395
396
|
f"labels_check_{model_id}",
|
|
396
397
|
list(unduped),
|
|
397
|
-
expire=constants.getattr("
|
|
398
|
+
expire=constants.getattr("THREE_DAY_SECONDS"),
|
|
398
399
|
)
|
|
399
400
|
cache.close()
|
|
400
401
|
|
|
401
402
|
|
|
402
403
|
def trace_log_task(responseArray, header=None):
|
|
404
|
+
if not is_trace():
|
|
405
|
+
return
|
|
403
406
|
chunk_size = constants.getattr("LARGE_TRACE_CHUNK_SIZE")
|
|
404
407
|
for i in range(1, len(responseArray) + 1, chunk_size):
|
|
405
408
|
# Calculate end index considering potential last chunk being smaller
|
|
@@ -28,8 +28,7 @@ def scrape_user():
|
|
|
28
28
|
retries=constants.getattr("API_INDVIDIUAL_NUM_TRIES"),
|
|
29
29
|
wait_min=constants.getattr("OF_AUTH_MIN_WAIT"),
|
|
30
30
|
wait_max=constants.getattr("OF_AUTH_MAX_WAIT"),
|
|
31
|
-
new_request_auth=True
|
|
32
|
-
|
|
31
|
+
new_request_auth=True,
|
|
33
32
|
) as c:
|
|
34
33
|
return _scraper_user_helper(c)
|
|
35
34
|
|
|
@@ -62,8 +61,7 @@ def parse_subscriber_count():
|
|
|
62
61
|
retries=constants.getattr("API_INDVIDIUAL_NUM_TRIES"),
|
|
63
62
|
wait_min=constants.getattr("OF_MIN_WAIT_API"),
|
|
64
63
|
wait_max=constants.getattr("OF_MAX_WAIT_API"),
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
new_request_auth=True,
|
|
67
65
|
) as c:
|
|
68
66
|
try:
|
|
69
67
|
with c.requests(constants.getattr("subscribeCountEP")) as r:
|
|
@@ -12,7 +12,6 @@ r"""
|
|
|
12
12
|
"""
|
|
13
13
|
|
|
14
14
|
import asyncio
|
|
15
|
-
import contextvars
|
|
16
15
|
import logging
|
|
17
16
|
import traceback
|
|
18
17
|
|
|
@@ -27,6 +26,8 @@ import ofscraper.utils.constants as constants
|
|
|
27
26
|
import ofscraper.utils.progress as progress_utils
|
|
28
27
|
import ofscraper.utils.settings as settings
|
|
29
28
|
from ofscraper.utils.context.run_async import run
|
|
29
|
+
from ofscraper.utils.logs.helpers import is_trace
|
|
30
|
+
|
|
30
31
|
|
|
31
32
|
log = logging.getLogger("shared")
|
|
32
33
|
|
|
@@ -306,7 +307,7 @@ def set_check(unduped, model_id, after):
|
|
|
306
307
|
cache.set(
|
|
307
308
|
f"message_check_{model_id}",
|
|
308
309
|
list(all_posts),
|
|
309
|
-
expire=constants.getattr("
|
|
310
|
+
expire=constants.getattr("THREE_DAY_SECONDS"),
|
|
310
311
|
)
|
|
311
312
|
cache.close()
|
|
312
313
|
|
|
@@ -326,7 +327,6 @@ async def scrape_messages(
|
|
|
326
327
|
await asyncio.sleep(1)
|
|
327
328
|
try:
|
|
328
329
|
async with c.requests_async(url=url) as r:
|
|
329
|
-
|
|
330
330
|
task = (
|
|
331
331
|
job_progress.add_task(
|
|
332
332
|
f": Message ID-> {message_id if message_id else 'initial'}"
|
|
@@ -422,8 +422,7 @@ def get_individual_post(model_id, postid):
|
|
|
422
422
|
retries=constants.getattr("API_INDVIDIUAL_NUM_TRIES"),
|
|
423
423
|
wait_min=constants.getattr("OF_MIN_WAIT_API"),
|
|
424
424
|
wait_max=constants.getattr("OF_MAX_WAIT_API"),
|
|
425
|
-
|
|
426
|
-
|
|
425
|
+
new_request_auth=True,
|
|
427
426
|
) as c:
|
|
428
427
|
with c.requests(
|
|
429
428
|
url=constants.getattr("messageSPECIFIC").format(model_id, postid)
|
|
@@ -473,6 +472,8 @@ async def get_after(model_id, username, forced_after=None):
|
|
|
473
472
|
|
|
474
473
|
|
|
475
474
|
def trace_log_task(responseArray):
|
|
475
|
+
if not is_trace():
|
|
476
|
+
return
|
|
476
477
|
chunk_size = constants.getattr("LARGE_TRACE_CHUNK_SIZE")
|
|
477
478
|
for i in range(1, len(responseArray) + 1, chunk_size):
|
|
478
479
|
# Calculate end index considering potential last chunk being smaller
|
|
@@ -490,6 +491,8 @@ def trace_log_task(responseArray):
|
|
|
490
491
|
|
|
491
492
|
|
|
492
493
|
def trace_log_old(responseArray):
|
|
494
|
+
if not is_trace():
|
|
495
|
+
return
|
|
493
496
|
chunk_size = constants.getattr("LARGE_TRACE_CHUNK_SIZE")
|
|
494
497
|
for i in range(1, len(responseArray) + 1, chunk_size):
|
|
495
498
|
# Calculate end index considering potential last chunk being smaller
|
|
@@ -108,25 +108,10 @@ async def process_tasks(tasks, model_id):
|
|
|
108
108
|
paid_str += f"{common_logs.RAW_INNER} {post}\n\n"
|
|
109
109
|
log.trace(f"{common_logs.FINAL_RAW.format('Paid')}".format(posts=paid_str))
|
|
110
110
|
log.debug(f"{common_logs.FINAL_COUNT.format('Paid')} {len(responseArray)}")
|
|
111
|
-
set_check(
|
|
111
|
+
set_check(model_id, responseArray)
|
|
112
112
|
return responseArray
|
|
113
113
|
|
|
114
114
|
|
|
115
|
-
def set_check(unduped, model_id):
|
|
116
|
-
seen = set()
|
|
117
|
-
all_posts = [
|
|
118
|
-
post
|
|
119
|
-
for post in cache.get(f"purchase_check_{model_id}", default=[]) + unduped
|
|
120
|
-
if post["id"] not in seen and not seen.add(post["id"])
|
|
121
|
-
]
|
|
122
|
-
cache.set(
|
|
123
|
-
f"purchased_check_{model_id}",
|
|
124
|
-
all_posts,
|
|
125
|
-
expire=constants.getattr("DAY_SECONDS"),
|
|
126
|
-
)
|
|
127
|
-
cache.close()
|
|
128
|
-
|
|
129
|
-
|
|
130
115
|
@run
|
|
131
116
|
async def scrape_paid(c, username, job_progress=None, offset=0):
|
|
132
117
|
"""Takes headers to access onlyfans as an argument and then checks the purchased content
|
|
@@ -189,6 +174,11 @@ async def scrape_paid(c, username, job_progress=None, offset=0):
|
|
|
189
174
|
|
|
190
175
|
@run
|
|
191
176
|
async def get_all_paid_posts():
|
|
177
|
+
data = await process_and_create_tasks()
|
|
178
|
+
return create_all_paid_dict(data)
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
async def process_and_create_tasks():
|
|
192
182
|
with ThreadPoolExecutor(
|
|
193
183
|
max_workers=constants.getattr("MAX_THREAD_WORKERS")
|
|
194
184
|
) as executor:
|
|
@@ -206,8 +196,7 @@ async def get_all_paid_posts():
|
|
|
206
196
|
retries=constants.getattr("API_PAID_NUM_TRIES"),
|
|
207
197
|
wait_min=constants.getattr("OF_MIN_WAIT_API"),
|
|
208
198
|
wait_max=constants.getattr("OF_MAX_WAIT_API"),
|
|
209
|
-
|
|
210
|
-
|
|
199
|
+
new_request_auth=True,
|
|
211
200
|
) as c:
|
|
212
201
|
allpaid = cache.get("purchased_all", default=[])
|
|
213
202
|
log.debug(f"[bold]All Paid Cache[/bold] {len(allpaid)} found")
|
|
@@ -220,7 +209,7 @@ async def get_all_paid_posts():
|
|
|
220
209
|
scrape_all_paid(
|
|
221
210
|
c,
|
|
222
211
|
job_progress,
|
|
223
|
-
required=
|
|
212
|
+
required=min_posts,
|
|
224
213
|
offset=splitArrays[i],
|
|
225
214
|
)
|
|
226
215
|
)
|
|
@@ -268,7 +257,7 @@ async def get_all_paid_posts():
|
|
|
268
257
|
await asyncio.sleep(1)
|
|
269
258
|
log.traceback_(E)
|
|
270
259
|
log.traceback_(traceback.format_exc())
|
|
271
|
-
|
|
260
|
+
u
|
|
272
261
|
tasks = new_tasks
|
|
273
262
|
overall_progress.remove_task(page_task)
|
|
274
263
|
|
|
@@ -290,6 +279,15 @@ async def get_all_paid_posts():
|
|
|
290
279
|
return output
|
|
291
280
|
|
|
292
281
|
|
|
282
|
+
def create_all_paid_dict(paid_content):
|
|
283
|
+
user_dict = {}
|
|
284
|
+
for ele in paid_content:
|
|
285
|
+
user_id = ele.get("fromUser", {}).get("id") or ele.get("author", {}).get("id")
|
|
286
|
+
user_dict.setdefault(str(user_id), []).append(ele)
|
|
287
|
+
[set_check(key, val) for key, val in user_dict.items()]
|
|
288
|
+
return user_dict
|
|
289
|
+
|
|
290
|
+
|
|
293
291
|
async def scrape_all_paid(c, job_progress=None, offset=0, required=None):
|
|
294
292
|
"""Takes headers to access onlyfans as an argument and then checks the purchased content
|
|
295
293
|
url to look for any purchased content. If it finds some it will return it as a list.
|
|
@@ -355,6 +353,21 @@ async def scrape_all_paid(c, job_progress=None, offset=0, required=None):
|
|
|
355
353
|
job_progress.remove_task(task)
|
|
356
354
|
|
|
357
355
|
|
|
356
|
+
def set_check(model_id, unduped):
|
|
357
|
+
seen = set()
|
|
358
|
+
all_posts = [
|
|
359
|
+
post
|
|
360
|
+
for post in cache.get(f"purchase_check_{model_id}", default=[]) + unduped
|
|
361
|
+
if post["id"] not in seen and not seen.add(post["id"])
|
|
362
|
+
]
|
|
363
|
+
cache.set(
|
|
364
|
+
f"purchased_check_{model_id}",
|
|
365
|
+
all_posts,
|
|
366
|
+
expire=constants.getattr("THREE_DAY_SECONDS"),
|
|
367
|
+
)
|
|
368
|
+
cache.close()
|
|
369
|
+
|
|
370
|
+
|
|
358
371
|
def get_individual_post(username, model_id, postid):
|
|
359
372
|
data = get_paid_posts_progress(username, model_id)
|
|
360
373
|
postid = int(postid)
|
|
@@ -38,8 +38,7 @@ def scrape_profile(username: Union[int, str]) -> dict:
|
|
|
38
38
|
retries=constants.getattr("API_INDVIDIUAL_NUM_TRIES"),
|
|
39
39
|
wait_min=constants.getattr("OF_MIN_WAIT_API"),
|
|
40
40
|
wait_max=constants.getattr("OF_MAX_WAIT_API"),
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
new_request_auth=True,
|
|
43
42
|
) as c:
|
|
44
43
|
return scrape_profile_helper(c, username)
|
|
45
44
|
|
|
@@ -49,8 +49,7 @@ async def get_subscription(accounts=None):
|
|
|
49
49
|
retries=constants.getattr("API_INDVIDIUAL_NUM_TRIES"),
|
|
50
50
|
wait_min=constants.getattr("OF_MIN_WAIT_API"),
|
|
51
51
|
wait_max=constants.getattr("OF_MAX_WAIT_API"),
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
new_request_auth=True,
|
|
54
53
|
) as c:
|
|
55
54
|
out = await get_subscription_helper(c, accounts)
|
|
56
55
|
job_progress.remove_task(task1)
|
|
@@ -28,6 +28,8 @@ import ofscraper.utils.args.read as read_args
|
|
|
28
28
|
import ofscraper.utils.console as console
|
|
29
29
|
import ofscraper.utils.constants as constants
|
|
30
30
|
from ofscraper.utils.context.run_async import run
|
|
31
|
+
from ofscraper.utils.logs.helpers import is_trace
|
|
32
|
+
|
|
31
33
|
|
|
32
34
|
log = logging.getLogger("shared")
|
|
33
35
|
attempt = contextvars.ContextVar("attempt")
|
|
@@ -100,8 +102,7 @@ async def get_lists():
|
|
|
100
102
|
retries=constants.getattr("API_INDVIDIUAL_NUM_TRIES"),
|
|
101
103
|
wait_min=constants.getattr("OF_MIN_WAIT_API"),
|
|
102
104
|
wait_max=constants.getattr("OF_MAX_WAIT_API"),
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
new_request_auth=True,
|
|
105
106
|
) as c:
|
|
106
107
|
tasks.append(asyncio.create_task(scrape_for_list(c, job_progress)))
|
|
107
108
|
page_task = overall_progress.add_task(
|
|
@@ -125,13 +126,34 @@ async def get_lists():
|
|
|
125
126
|
continue
|
|
126
127
|
tasks = new_tasks
|
|
127
128
|
overall_progress.remove_task(page_task)
|
|
128
|
-
|
|
129
|
+
trace_log_list(output)
|
|
130
|
+
|
|
131
|
+
log.debug(f"[bold]lists name count without Dupes[/bold] {len(output)} found")
|
|
132
|
+
return output
|
|
133
|
+
|
|
134
|
+
def trace_log_list(responseArray):
|
|
135
|
+
if not is_trace():
|
|
136
|
+
return
|
|
137
|
+
chunk_size = constants.getattr("LARGE_TRACE_CHUNK_SIZE")
|
|
138
|
+
for i in range(1, len(responseArray) + 1, chunk_size):
|
|
139
|
+
# Calculate end index considering potential last chunk being smaller
|
|
140
|
+
end_index = min(
|
|
141
|
+
i + chunk_size - 1, len(responseArray)
|
|
142
|
+
) # Adjust end_index calculation
|
|
143
|
+
chunk = responseArray[i - 1 : end_index] # Adjust slice to start at i-1
|
|
144
|
+
log.trace(
|
|
129
145
|
"list unduped {posts}".format(
|
|
130
|
-
posts="\n\n".join(map(lambda x: f" list data raw:{x}",
|
|
146
|
+
posts="\n\n".join(map(lambda x: f" list data raw:{x}", chunk))
|
|
131
147
|
)
|
|
132
148
|
)
|
|
133
|
-
|
|
134
|
-
|
|
149
|
+
# Check if there are more elements remaining after this chunk
|
|
150
|
+
if i + chunk_size > len(responseArray):
|
|
151
|
+
break # Exit the loop if we've processed all elements
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
135
157
|
|
|
136
158
|
|
|
137
159
|
async def scrape_for_list(c, job_progress, offset=0):
|
|
@@ -155,7 +177,7 @@ async def scrape_for_list(c, job_progress, offset=0):
|
|
|
155
177
|
f"offset:{offset} -> hasMore value in json {data.get('hasMore','undefined') }"
|
|
156
178
|
)
|
|
157
179
|
log.trace(
|
|
158
|
-
"offset:{offset} ->
|
|
180
|
+
"offset:{offset} -> list names raw: {posts}".format(
|
|
159
181
|
offset=offset, posts=data
|
|
160
182
|
)
|
|
161
183
|
)
|
|
@@ -203,8 +225,7 @@ async def get_list_users(lists):
|
|
|
203
225
|
retries=constants.getattr("API_INDVIDIUAL_NUM_TRIES"),
|
|
204
226
|
wait_min=constants.getattr("OF_MIN_WAIT_API"),
|
|
205
227
|
wait_max=constants.getattr("OF_MAX_WAIT_API"),
|
|
206
|
-
|
|
207
|
-
|
|
228
|
+
new_request_auth=True,
|
|
208
229
|
) as c:
|
|
209
230
|
[
|
|
210
231
|
tasks.append(
|
|
@@ -237,15 +258,31 @@ async def get_list_users(lists):
|
|
|
237
258
|
outdict = {}
|
|
238
259
|
for ele in output:
|
|
239
260
|
outdict[ele["id"]] = ele
|
|
240
|
-
|
|
241
|
-
"users found {users}".format(
|
|
242
|
-
users="\n\n".join(map(lambda x: f"user data: {str(x)}", outdict.values()))
|
|
243
|
-
)
|
|
244
|
-
)
|
|
261
|
+
trace_log_usernames(outdict.values())
|
|
245
262
|
log.debug(f"[bold]users count without Dupes[/bold] {len(outdict.values())} found")
|
|
246
263
|
return outdict.values()
|
|
247
264
|
|
|
248
265
|
|
|
266
|
+
def trace_log_usernames(responseArray):
|
|
267
|
+
if not is_trace():
|
|
268
|
+
return
|
|
269
|
+
chunk_size = constants.getattr("LARGE_TRACE_CHUNK_SIZE")
|
|
270
|
+
for i in range(1, len(responseArray) + 1, chunk_size):
|
|
271
|
+
# Calculate end index considering potential last chunk being smaller
|
|
272
|
+
end_index = min(
|
|
273
|
+
i + chunk_size - 1, len(responseArray)
|
|
274
|
+
) # Adjust end_index calculation
|
|
275
|
+
chunk = responseArray[i - 1 : end_index] # Adjust slice to start at i-1
|
|
276
|
+
log.trace(
|
|
277
|
+
"users found {users}".format(
|
|
278
|
+
users="\n\n".join(map(lambda x: f"user data: {str(x)}", chunk))
|
|
279
|
+
)
|
|
280
|
+
|
|
281
|
+
)
|
|
282
|
+
# Check if there are more elements remaining after this chunk
|
|
283
|
+
if i + chunk_size > len(responseArray):
|
|
284
|
+
break # Exit the loop if we've processed all elements
|
|
285
|
+
|
|
249
286
|
async def scrape_list_members(c, item, job_progress, offset=0):
|
|
250
287
|
users = None
|
|
251
288
|
attempt.set(0)
|
|
@@ -47,8 +47,7 @@ async def get_subscriptions(subscribe_count, account="active"):
|
|
|
47
47
|
retries=constants.getattr("API_INDVIDIUAL_NUM_TRIES"),
|
|
48
48
|
wait_min=constants.getattr("OF_MIN_WAIT_API"),
|
|
49
49
|
wait_max=constants.getattr("OF_MAX_WAIT_API"),
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
new_request_auth=True,
|
|
52
51
|
) as c:
|
|
53
52
|
if account == "active":
|
|
54
53
|
out = await activeHelper(subscribe_count, c)
|
|
@@ -173,7 +172,7 @@ async def scrape_subscriptions_active(c, offset=0, num=0, recur=False) -> list:
|
|
|
173
172
|
f"usernames retrived -> {list(map(lambda x:x.get('username'),subscriptions))}"
|
|
174
173
|
)
|
|
175
174
|
if len(subscriptions) == 0:
|
|
176
|
-
return subscriptions
|
|
175
|
+
return subscriptions,new_tasks
|
|
177
176
|
elif recur is False:
|
|
178
177
|
pass
|
|
179
178
|
elif (await r.json_())["hasMore"] is True:
|
|
@@ -208,7 +207,7 @@ async def scrape_subscriptions_disabled(c, offset=0, num=0, recur=False) -> list
|
|
|
208
207
|
)
|
|
209
208
|
|
|
210
209
|
if len(subscriptions) == 0:
|
|
211
|
-
return subscriptions
|
|
210
|
+
return subscriptions,new_tasks
|
|
212
211
|
elif recur is False:
|
|
213
212
|
pass
|
|
214
213
|
elif (await r.json_())["hasMore"] is True:
|
|
@@ -23,6 +23,7 @@ import ofscraper.utils.constants as constants
|
|
|
23
23
|
import ofscraper.utils.progress as progress_utils
|
|
24
24
|
import ofscraper.utils.settings as settings
|
|
25
25
|
from ofscraper.utils.context.run_async import run
|
|
26
|
+
from ofscraper.utils.logs.helpers import is_trace
|
|
26
27
|
|
|
27
28
|
log = logging.getLogger("shared")
|
|
28
29
|
|
|
@@ -245,7 +246,7 @@ def set_check(unduped, model_id, after):
|
|
|
245
246
|
cache.set(
|
|
246
247
|
f"timeline_check_{model_id}",
|
|
247
248
|
all_posts,
|
|
248
|
-
expire=constants.getattr("
|
|
249
|
+
expire=constants.getattr("THREE_DAY_SECONDS"),
|
|
249
250
|
)
|
|
250
251
|
cache.close()
|
|
251
252
|
|
|
@@ -256,8 +257,7 @@ def get_individual_post(id):
|
|
|
256
257
|
retries=constants.getattr("API_INDVIDIUAL_NUM_TRIES"),
|
|
257
258
|
wait_min=constants.getattr("OF_MIN_WAIT_API"),
|
|
258
259
|
wait_max=constants.getattr("OF_MAX_WAIT_API"),
|
|
259
|
-
|
|
260
|
-
|
|
260
|
+
new_request_auth=True,
|
|
261
261
|
) as c:
|
|
262
262
|
with c.requests(constants.getattr("INDIVIDUAL_TIMELINE").format(id)) as r:
|
|
263
263
|
log.trace(f"post raw individual {r.json()}")
|
|
@@ -406,6 +406,8 @@ async def scrape_timeline_posts(
|
|
|
406
406
|
|
|
407
407
|
|
|
408
408
|
def trace_log_task(responseArray):
|
|
409
|
+
if not is_trace():
|
|
410
|
+
return
|
|
409
411
|
chunk_size = constants.getattr("LARGE_TRACE_CHUNK_SIZE")
|
|
410
412
|
for i in range(1, len(responseArray) + 1, chunk_size):
|
|
411
413
|
# Calculate end index considering potential last chunk being smaller
|
|
@@ -423,6 +425,8 @@ def trace_log_task(responseArray):
|
|
|
423
425
|
|
|
424
426
|
|
|
425
427
|
def trace_log_old(responseArray):
|
|
428
|
+
if not is_trace():
|
|
429
|
+
return
|
|
426
430
|
chunk_size = constants.getattr("LARGE_TRACE_CHUNK_SIZE")
|
|
427
431
|
for i in range(1, len(responseArray) + 1, chunk_size):
|
|
428
432
|
# Calculate end index considering potential last chunk being smaller
|
|
@@ -34,6 +34,7 @@ class Media(base.base):
|
|
|
34
34
|
self._post = post
|
|
35
35
|
self._final_url = None
|
|
36
36
|
self._cached_parse_mpd = None
|
|
37
|
+
self._mpd=None
|
|
37
38
|
|
|
38
39
|
def __eq__(self, other):
|
|
39
40
|
return self.postid == other.postid
|
|
@@ -181,7 +182,9 @@ class Media(base.base):
|
|
|
181
182
|
|
|
182
183
|
@property
|
|
183
184
|
def mpd(self):
|
|
184
|
-
if self.
|
|
185
|
+
if self._mpd:
|
|
186
|
+
return self._mpd
|
|
187
|
+
elif self.protected == False:
|
|
185
188
|
return None
|
|
186
189
|
return (
|
|
187
190
|
self._media.get("files", {}).get("drm", {}).get("manifest", {}).get("dash")
|
|
@@ -326,8 +329,7 @@ class Media(base.base):
|
|
|
326
329
|
retries=constants.getattr("MPD_NUM_TRIES"),
|
|
327
330
|
wait_min=constants.getattr("OF_MIN_WAIT_API"),
|
|
328
331
|
wait_max=constants.getattr("OF_MAX_WAIT_API"),
|
|
329
|
-
|
|
330
|
-
|
|
332
|
+
new_request_auth=True,
|
|
331
333
|
semaphore=semaphore,
|
|
332
334
|
) as c:
|
|
333
335
|
async with c.requests_async(url=self.mpd, params=params) as r:
|
|
@@ -362,6 +364,12 @@ class Media(base.base):
|
|
|
362
364
|
def mediatype(self, val):
|
|
363
365
|
self._media["type"] = val
|
|
364
366
|
|
|
367
|
+
@url.setter
|
|
368
|
+
def url(self, val):
|
|
369
|
+
self._final_url=val
|
|
370
|
+
@mpd.setter
|
|
371
|
+
def mpd(self, val):
|
|
372
|
+
self._mpd=val
|
|
365
373
|
@property
|
|
366
374
|
async def selected_quality(self):
|
|
367
375
|
if self.protected == False:
|