ofscraper 3.9.7__tar.gz → 3.10.dev1__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.7 → ofscraper-3.10.dev1}/PKG-INFO +3 -6
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/README.md +2 -5
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/api/archive.py +45 -62
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/api/highlights.py +48 -119
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/api/init.py +6 -11
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/api/labels.py +27 -62
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/api/me.py +2 -3
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/api/messages.py +35 -63
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/api/paid.py +102 -145
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/api/pinned.py +16 -48
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/api/profile.py +4 -4
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/api/subscriptions/individual.py +20 -31
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/api/subscriptions/lists.py +97 -128
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/api/subscriptions/subscriptions.py +77 -85
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/api/timeline.py +39 -63
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/base.py +1 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/media.py +0 -1
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/multiprocessprogress.py +1 -1
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/placeholder.py +11 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/posts.py +5 -1
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/sessionmanager.py +88 -52
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/commands/check.py +53 -39
- ofscraper-3.10.dev1/ofscraper/commands/helpers/context.py +104 -0
- {ofscraper-3.9.7/ofscraper/commands → ofscraper-3.10.dev1/ofscraper/commands/helpers}/picker.py +2 -2
- ofscraper-3.10.dev1/ofscraper/commands/helpers/shared.py +5 -0
- ofscraper-3.10.dev1/ofscraper/commands/helpers/strings.py +12 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/commands/manual.py +118 -107
- ofscraper-3.10.dev1/ofscraper/commands/metadata.py +282 -0
- ofscraper-3.10.dev1/ofscraper/commands/scraper/actions/download.py +80 -0
- ofscraper-3.10.dev1/ofscraper/commands/scraper/actions/like.py +178 -0
- ofscraper-3.10.dev1/ofscraper/commands/scraper/post.py +569 -0
- ofscraper-3.10.dev1/ofscraper/commands/scraper/runner.py +178 -0
- {ofscraper-3.9.7/ofscraper/commands → ofscraper-3.10.dev1/ofscraper/commands/scraper}/scraper.py +8 -12
- ofscraper-3.10.dev1/ofscraper/const/constants.py +27 -0
- {ofscraper-3.9.7/ofscraper/const → ofscraper-3.10.dev1/ofscraper/const/values}/config.py +1 -0
- {ofscraper-3.9.7/ofscraper/const → ofscraper-3.10.dev1/ofscraper/const/values}/download.py +2 -0
- {ofscraper-3.9.7/ofscraper/const → ofscraper-3.10.dev1/ofscraper/const/values}/general.py +0 -5
- ofscraper-3.10.dev1/ofscraper/const/values/live.py +5 -0
- ofscraper-3.10.dev1/ofscraper/const/values/path.py +5 -0
- {ofscraper-3.9.7/ofscraper/const → ofscraper-3.10.dev1/ofscraper/const/values}/req.py +3 -3
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/db/operations.py +26 -21
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/db/operations_/labels.py +1 -3
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/db/operations_/media.py +33 -37
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/db/operations_/messages.py +1 -3
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/db/operations_/others.py +2 -6
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/db/operations_/posts.py +1 -3
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/db/operations_/profile.py +1 -3
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/db/operations_/stories.py +1 -3
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/download/alt_download.py +54 -58
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/download/alt_downloadbatch.py +56 -52
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/download/download.py +14 -8
- ofscraper-3.10.dev1/ofscraper/download/downloadbatch.py +431 -0
- ofscraper-3.10.dev1/ofscraper/download/downloadnormal.py +194 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/download/main_download.py +40 -52
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/download/main_downloadbatch.py +53 -52
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/download/shared/classes/session.py +2 -6
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/download/shared/common/alt_common.py +3 -1
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/download/shared/common/general.py +67 -16
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/download/shared/common/main_common.py +1 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/download/shared/globals.py +2 -4
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/download/shared/utils/keyhelpers.py +3 -3
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/download/shared/utils/metadata.py +80 -33
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/download/shared/utils/text.py +4 -4
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/filters/media/helpers.py +31 -6
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/filters/media/main.py +27 -36
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/models/retriver.py +15 -15
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/models/selector.py +5 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/prompts/promptConvert.py +53 -46
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/prompts/prompt_groups/area.py +1 -1
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/runner/run.py +4 -5
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/actions.py +1 -1
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/arguments/advanced_user_filter.py +7 -7
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/arguments/automatic.py +2 -2
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/arguments/content.py +21 -11
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/arguments/logging.py +11 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/arguments/media_type.py +23 -2
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/arguments/user_select.py +12 -8
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/bundles/manual.py +3 -3
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/bundles/message_check.py +6 -4
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/bundles/metadata.py +10 -9
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/bundles/paid_check.py +6 -4
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/bundles/post_check.py +6 -4
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/bundles/story_check.py +5 -3
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/commands/main.py +1 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/commands/post.py +1 -0
- ofscraper-3.10.dev1/ofscraper/utils/args/groups/common_args.py +307 -0
- {ofscraper-3.9.7/ofscraper/utils/args → ofscraper-3.10.dev1/ofscraper/utils/args/helpers}/areas.py +30 -14
- ofscraper-3.10.dev1/ofscraper/utils/args/helpers/before.py +12 -0
- ofscraper-3.10.dev1/ofscraper/utils/args/helpers/check.py +17 -0
- ofscraper-3.10.dev1/ofscraper/utils/args/helpers/date.py +19 -0
- ofscraper-3.9.7/ofscraper/utils/args/helpers.py → ofscraper-3.10.dev1/ofscraper/utils/args/helpers/type.py +4 -2
- ofscraper-3.10.dev1/ofscraper/utils/args/output.py +4 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/auth/request.py +26 -29
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/config/config.py +1 -1
- ofscraper-3.10.dev1/ofscraper/utils/console.py +45 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/constants.py +1 -1
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/context/run_async.py +36 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/hash.py +0 -1
- ofscraper-3.10.dev1/ofscraper/utils/live/empty.py +13 -0
- ofscraper-3.10.dev1/ofscraper/utils/live/groups.py +78 -0
- ofscraper-3.10.dev1/ofscraper/utils/live/live.py +21 -0
- ofscraper-3.10.dev1/ofscraper/utils/live/panel.py +5 -0
- ofscraper-3.10.dev1/ofscraper/utils/live/progress.py +76 -0
- ofscraper-3.10.dev1/ofscraper/utils/live/screens.py +178 -0
- ofscraper-3.10.dev1/ofscraper/utils/live/tasks.py +47 -0
- ofscraper-3.10.dev1/ofscraper/utils/live/updater.py +249 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/logs/classes.py +85 -38
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/logs/close.py +2 -2
- ofscraper-3.10.dev1/ofscraper/utils/logs/handle.py +17 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/logs/logger.py +6 -1
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/logs/logs.py +1 -1
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/logs/other.py +46 -37
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/logs/stdout.py +32 -24
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/me.py +4 -7
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/menu.py +2 -4
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/paths/common.py +4 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/run.py +28 -45
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/separate.py +1 -1
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/settings.py +9 -3
- ofscraper-3.10.dev1/ofscraper/utils/system/network.py +69 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/text.py +15 -18
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/pyproject.toml +2 -2
- ofscraper-3.9.7/ofscraper/commands/actions/download/download.py +0 -161
- ofscraper-3.9.7/ofscraper/commands/actions/download/post.py +0 -583
- ofscraper-3.9.7/ofscraper/commands/actions/like.py +0 -290
- ofscraper-3.9.7/ofscraper/commands/add_select/add_selected.py +0 -29
- ofscraper-3.9.7/ofscraper/commands/metadata.py +0 -214
- ofscraper-3.9.7/ofscraper/const/constants.py +0 -25
- ofscraper-3.9.7/ofscraper/download/downloadbatch.py +0 -443
- ofscraper-3.9.7/ofscraper/download/downloadnormal.py +0 -204
- ofscraper-3.9.7/ofscraper/utils/__init__.py +0 -1
- ofscraper-3.9.7/ofscraper/utils/console.py +0 -23
- ofscraper-3.9.7/ofscraper/utils/progress.py +0 -352
- ofscraper-3.9.7/ofscraper/utils/system/network.py +0 -71
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/LICENSE +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/__main__.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/__version__.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/__version__.pye +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/api/common/logs.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/api/subscriptions/helpers.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/labels.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/models.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/table/button.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/table/fields/boolfield.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/table/fields/datefield.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/table/fields/mediafield.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/table/fields/numfield.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/table/fields/pricefield.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/table/fields/responsefield.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/table/fields/selectfield.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/table/fields/textsearch.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/table/fields/timefield.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/table/inputs/filterinput.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/table/inputs/intergerinput.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/table/inputs/strinput.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/table/row_names.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/table/status.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/table/table.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/classes/table/table_console.py +0 -0
- {ofscraper-3.9.7/ofscraper/commands/actions → ofscraper-3.10.dev1/ofscraper/commands/scraper}/scrape_context.py +0 -0
- {ofscraper-3.9.7/ofscraper/const → ofscraper-3.10.dev1/ofscraper/const/values}/binary.py +0 -0
- {ofscraper-3.9.7/ofscraper/const → ofscraper-3.10.dev1/ofscraper/const/values}/date.py +0 -0
- {ofscraper-3.9.7/ofscraper/const → ofscraper-3.10.dev1/ofscraper/const/values}/files.py +0 -0
- {ofscraper-3.9.7/ofscraper/const → ofscraper-3.10.dev1/ofscraper/const/values}/logger.py +0 -0
- {ofscraper-3.9.7/ofscraper/const → ofscraper-3.10.dev1/ofscraper/const/values}/metadata.py +0 -0
- {ofscraper-3.9.7/ofscraper/const → ofscraper-3.10.dev1/ofscraper/const/values}/other_url.py +0 -0
- {ofscraper-3.9.7/ofscraper/const → ofscraper-3.10.dev1/ofscraper/const/values}/prompts.py +0 -0
- {ofscraper-3.9.7/ofscraper/const → ofscraper-3.10.dev1/ofscraper/const/values}/table.py +0 -0
- {ofscraper-3.9.7/ofscraper/const → ofscraper-3.10.dev1/ofscraper/const/values}/test_constants.py +0 -0
- {ofscraper-3.9.7/ofscraper/const → ofscraper-3.10.dev1/ofscraper/const/values}/time.py +0 -0
- {ofscraper-3.9.7/ofscraper/const → ofscraper-3.10.dev1/ofscraper/const/values}/url.py +0 -0
- {ofscraper-3.9.7/ofscraper/commands/actions → ofscraper-3.10.dev1/ofscraper/db}/__init__.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/db/operations_/helpers.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/db/operations_/merge.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/db/operations_/wrapper.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/download/shared/classes/retries.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/download/shared/utils/log.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/download/shared/utils/media.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/download/shared/utils/message.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/download/shared/utils/paths.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/download/shared/utils/progress.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/filters/models/date.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/filters/models/flags.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/filters/models/helpers.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/filters/models/other.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/filters/models/price.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/filters/models/sort.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/filters/models/subtype.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/prompts/helpers/model_helpers.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/prompts/helpers/prompt_helpers.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/prompts/keybindings.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/prompts/prompt_groups/actions.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/prompts/prompt_groups/auth.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/prompts/prompt_groups/binary.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/prompts/prompt_groups/config.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/prompts/prompt_groups/menu.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/prompts/prompt_groups/merge.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/prompts/prompt_groups/model.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/prompts/prompt_groups/profile.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/prompts/prompt_strings.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/prompts/prompt_validators.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/prompts/prompts.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/runner/exit.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/runner/load.py +0 -0
- {ofscraper-3.9.7/ofscraper/db → ofscraper-3.10.dev1/ofscraper/utils}/__init__.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/arguments/advanced_processing.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/arguments/advanced_program.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/arguments/download.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/arguments/file.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/arguments/program.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/arguments/user_list.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/arguments/user_sort.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/bundles/advanced_common.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/bundles/common.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/bundles/main.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/commands/manual.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/commands/message.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/commands/metadata.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/commands/paid.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/commands/story.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/globals.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/parse.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/quality.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/read.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/user.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/args/write.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/auth/context.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/auth/data.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/auth/file.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/auth/helpers.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/auth/make.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/auth/schema.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/binaries.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/cache.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/checkers.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/config/context.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/config/custom.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/config/data.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/config/file.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/config/menu.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/config/schema.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/config/wrapper.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/context/exit.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/context/stdout.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/dates.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/encoding.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/logs/globals.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/logs/helpers.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/manager.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/merge.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/paths/check.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/paths/manage.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/paths/paths.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/profiles/data.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/profiles/manage.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/profiles/tools.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/sems.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/system/free.py +0 -0
- {ofscraper-3.9.7 → ofscraper-3.10.dev1}/ofscraper/utils/system/system.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ofscraper
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.10.dev1
|
|
4
4
|
Summary: automatically scrape onlyfans
|
|
5
5
|
Author: datawhores
|
|
6
6
|
Author-email: datawhores@riseup.net
|
|
@@ -72,12 +72,9 @@ Docker and binary releases also availible
|
|
|
72
72
|
</a>
|
|
73
73
|
|
|
74
74
|
## Dev
|
|
75
|
+
None
|
|
76
|
+
|
|
75
77
|
|
|
76
|
-
<div style="display: inline-block">
|
|
77
|
-
<a href="https://pypi.org/project/ofscraper/3.9.0.dev5/">
|
|
78
|
-
<img src="https://img.shields.io/badge/Pre--Release-v3.90.dev-dark_green.svg" alt="drawing" style="height:75px"/>
|
|
79
|
-
</a>
|
|
80
|
-
</div>
|
|
81
78
|
|
|
82
79
|
## Table-of-contents
|
|
83
80
|
|
|
@@ -18,12 +18,9 @@ Docker and binary releases also availible
|
|
|
18
18
|
</a>
|
|
19
19
|
|
|
20
20
|
## Dev
|
|
21
|
+
None
|
|
22
|
+
|
|
21
23
|
|
|
22
|
-
<div style="display: inline-block">
|
|
23
|
-
<a href="https://pypi.org/project/ofscraper/3.9.0.dev5/">
|
|
24
|
-
<img src="https://img.shields.io/badge/Pre--Release-v3.90.dev-dark_green.svg" alt="drawing" style="height:75px"/>
|
|
25
|
-
</a>
|
|
26
|
-
</div>
|
|
27
24
|
|
|
28
25
|
## Table-of-contents
|
|
29
26
|
|
|
@@ -22,9 +22,12 @@ import ofscraper.api.common.logs as common_logs
|
|
|
22
22
|
import ofscraper.utils.args.read as read_args
|
|
23
23
|
import ofscraper.utils.cache as cache
|
|
24
24
|
import ofscraper.utils.constants as constants
|
|
25
|
-
import ofscraper.utils.
|
|
25
|
+
import ofscraper.utils.live.screens as progress_utils
|
|
26
26
|
import ofscraper.utils.settings as settings
|
|
27
|
-
from ofscraper.db.operations_.media import
|
|
27
|
+
from ofscraper.db.operations_.media import (
|
|
28
|
+
get_archived_media,
|
|
29
|
+
get_media_ids_downloaded_model,
|
|
30
|
+
)
|
|
28
31
|
from ofscraper.db.operations_.posts import (
|
|
29
32
|
get_archived_post_info,
|
|
30
33
|
get_youngest_archived_date,
|
|
@@ -39,7 +42,7 @@ sem = None
|
|
|
39
42
|
|
|
40
43
|
|
|
41
44
|
@run
|
|
42
|
-
async def
|
|
45
|
+
async def get_archived_posts(model_id, username, forced_after=None, c=None):
|
|
43
46
|
|
|
44
47
|
oldarchived = None
|
|
45
48
|
if not settings.get_api_cache_disabled():
|
|
@@ -55,45 +58,26 @@ async def get_archived_posts_progress(model_id, username, forced_after=None, c=N
|
|
|
55
58
|
splitArrays = get_split_array(oldarchived, after)
|
|
56
59
|
tasks = get_tasks(splitArrays, c, model_id, after)
|
|
57
60
|
data = await process_tasks(tasks, model_id, after)
|
|
58
|
-
progress_utils.archived_layout.visible = False
|
|
59
61
|
return data
|
|
60
62
|
|
|
61
63
|
|
|
62
|
-
@run
|
|
63
|
-
async def get_archived_posts(model_id, username, forced_after=None, c=None):
|
|
64
|
-
if not settings.get_api_cache_disabled():
|
|
65
|
-
oldarchived = await get_archived_post_info(model_id=model_id, username=username)
|
|
66
|
-
else:
|
|
67
|
-
oldarchived = []
|
|
68
|
-
trace_log_old(oldarchived)
|
|
69
|
-
|
|
70
|
-
log.debug(f"[bold]Archived Cache[/bold] {len(oldarchived)} found")
|
|
71
|
-
oldarchived = list(filter(lambda x: x is not None, oldarchived))
|
|
72
|
-
after = await get_after(model_id, username, forced_after)
|
|
73
|
-
time_log(username, after)
|
|
74
|
-
with progress_utils.set_up_api_archived():
|
|
75
|
-
splitArrays = get_split_array(oldarchived, after)
|
|
76
|
-
tasks = get_tasks(splitArrays, c, model_id, after)
|
|
77
|
-
return await process_tasks(tasks, model_id, after)
|
|
78
|
-
|
|
79
|
-
|
|
80
64
|
async def process_tasks(tasks, model_id, after):
|
|
81
65
|
responseArray = []
|
|
82
66
|
page_count = 0
|
|
83
|
-
overall_progress = progress_utils.overall_progress
|
|
84
67
|
|
|
85
|
-
page_task =
|
|
68
|
+
page_task = progress_utils.add_api_task(
|
|
86
69
|
f"Archived Content Pages Progress: {page_count}", visible=True
|
|
87
70
|
)
|
|
88
71
|
seen = set()
|
|
89
72
|
while tasks:
|
|
90
73
|
new_tasks = []
|
|
74
|
+
|
|
91
75
|
for task in asyncio.as_completed(tasks):
|
|
92
76
|
try:
|
|
93
77
|
result, new_tasks_batch = await task
|
|
94
78
|
new_tasks.extend(new_tasks_batch)
|
|
95
79
|
page_count = page_count + 1
|
|
96
|
-
|
|
80
|
+
progress_utils.update_api_task(
|
|
97
81
|
page_task,
|
|
98
82
|
description=f"Archived Content Pages Progress: {page_count}",
|
|
99
83
|
)
|
|
@@ -123,9 +107,9 @@ async def process_tasks(tasks, model_id, after):
|
|
|
123
107
|
log.traceback_(E)
|
|
124
108
|
log.traceback_(traceback.format_exc())
|
|
125
109
|
continue
|
|
126
|
-
|
|
110
|
+
tasks = new_tasks
|
|
127
111
|
|
|
128
|
-
|
|
112
|
+
progress_utils.remove_api_task(page_task)
|
|
129
113
|
|
|
130
114
|
log.debug(
|
|
131
115
|
f"{common_logs.FINAL_IDS.format('Archived')} {list(map(lambda x:x['id'],responseArray))}"
|
|
@@ -158,15 +142,13 @@ def get_split_array(oldarchived, after):
|
|
|
158
142
|
|
|
159
143
|
def get_tasks(splitArrays, c, model_id, after):
|
|
160
144
|
tasks = []
|
|
161
|
-
|
|
162
|
-
before=arrow.get(read_args.retriveArgs().before or arrow.now()).float_timestamp
|
|
145
|
+
before = arrow.get(read_args.retriveArgs().before or arrow.now()).float_timestamp
|
|
163
146
|
if len(splitArrays) > 2:
|
|
164
147
|
tasks.append(
|
|
165
148
|
asyncio.create_task(
|
|
166
149
|
scrape_archived_posts(
|
|
167
150
|
c,
|
|
168
151
|
model_id,
|
|
169
|
-
job_progress=job_progress,
|
|
170
152
|
required_ids=set([ele.get("created_at") for ele in splitArrays[0]]),
|
|
171
153
|
timestamp=splitArrays[0][0].get("created_at"),
|
|
172
154
|
offset=True,
|
|
@@ -179,7 +161,6 @@ def get_tasks(splitArrays, c, model_id, after):
|
|
|
179
161
|
scrape_archived_posts(
|
|
180
162
|
c,
|
|
181
163
|
model_id,
|
|
182
|
-
job_progress=job_progress,
|
|
183
164
|
required_ids=set(
|
|
184
165
|
[ele.get("created_at") for ele in splitArrays[i]]
|
|
185
166
|
),
|
|
@@ -196,11 +177,9 @@ def get_tasks(splitArrays, c, model_id, after):
|
|
|
196
177
|
scrape_archived_posts(
|
|
197
178
|
c,
|
|
198
179
|
model_id,
|
|
199
|
-
job_progress=job_progress,
|
|
200
180
|
timestamp=splitArrays[-1][0].get("created_at"),
|
|
201
181
|
offset=True,
|
|
202
|
-
required_ids=set([before])
|
|
203
|
-
|
|
182
|
+
required_ids=set([before]),
|
|
204
183
|
)
|
|
205
184
|
)
|
|
206
185
|
)
|
|
@@ -211,11 +190,9 @@ def get_tasks(splitArrays, c, model_id, after):
|
|
|
211
190
|
scrape_archived_posts(
|
|
212
191
|
c,
|
|
213
192
|
model_id,
|
|
214
|
-
job_progress=job_progress,
|
|
215
193
|
timestamp=splitArrays[0][0].get("created_at"),
|
|
216
194
|
offset=True,
|
|
217
|
-
required_ids=set([before])
|
|
218
|
-
|
|
195
|
+
required_ids=set([before]),
|
|
219
196
|
)
|
|
220
197
|
)
|
|
221
198
|
)
|
|
@@ -224,8 +201,11 @@ def get_tasks(splitArrays, c, model_id, after):
|
|
|
224
201
|
tasks.append(
|
|
225
202
|
asyncio.create_task(
|
|
226
203
|
scrape_archived_posts(
|
|
227
|
-
c,
|
|
228
|
-
|
|
204
|
+
c,
|
|
205
|
+
model_id,
|
|
206
|
+
timestamp=after,
|
|
207
|
+
offset=True,
|
|
208
|
+
required_ids=set([before]),
|
|
229
209
|
)
|
|
230
210
|
)
|
|
231
211
|
)
|
|
@@ -254,9 +234,7 @@ async def get_after(model_id, username, forced_after=None):
|
|
|
254
234
|
return forced_after
|
|
255
235
|
elif not settings.get_after_enabled():
|
|
256
236
|
return 0
|
|
257
|
-
elif read_args.retriveArgs().after
|
|
258
|
-
return 0
|
|
259
|
-
elif read_args.retriveArgs().after:
|
|
237
|
+
elif read_args.retriveArgs().after != None:
|
|
260
238
|
return read_args.retriveArgs().after.float_timestamp
|
|
261
239
|
|
|
262
240
|
elif cache.get(f"{model_id}_full_archived_scrape"):
|
|
@@ -265,12 +243,21 @@ async def get_after(model_id, username, forced_after=None):
|
|
|
265
243
|
)
|
|
266
244
|
return 0
|
|
267
245
|
|
|
268
|
-
curr=await get_archived_media(model_id=model_id, username=username)
|
|
246
|
+
curr = await get_archived_media(model_id=model_id, username=username)
|
|
269
247
|
if len(curr) == 0:
|
|
270
248
|
log.debug("Setting date to zero because database is empty")
|
|
271
249
|
return 0
|
|
272
|
-
curr_downloaded = await get_media_ids_downloaded_model(
|
|
273
|
-
|
|
250
|
+
curr_downloaded = await get_media_ids_downloaded_model(
|
|
251
|
+
model_id=model_id, username=username
|
|
252
|
+
)
|
|
253
|
+
missing_items = list(
|
|
254
|
+
filter(
|
|
255
|
+
lambda x: x.get("downloaded") != 1
|
|
256
|
+
and x.get("post_id") not in curr_downloaded
|
|
257
|
+
and x.get("unlocked") != 0,
|
|
258
|
+
curr,
|
|
259
|
+
)
|
|
260
|
+
)
|
|
274
261
|
missing_items = list(sorted(missing_items, key=lambda x: x.get("posted_at") or 0))
|
|
275
262
|
if len(missing_items) == 0:
|
|
276
263
|
log.debug(
|
|
@@ -287,14 +274,14 @@ async def get_after(model_id, username, forced_after=None):
|
|
|
287
274
|
|
|
288
275
|
|
|
289
276
|
async def scrape_archived_posts(
|
|
290
|
-
c, model_id,
|
|
277
|
+
c, model_id, timestamp=None, required_ids=None, offset=False
|
|
291
278
|
) -> list:
|
|
292
279
|
global sem
|
|
293
280
|
posts = None
|
|
294
281
|
if timestamp and (
|
|
295
282
|
float(timestamp) > (read_args.retriveArgs().before).float_timestamp
|
|
296
283
|
):
|
|
297
|
-
return [],[]
|
|
284
|
+
return [], []
|
|
298
285
|
timestamp = float(timestamp) - 1000 if timestamp and offset else timestamp
|
|
299
286
|
url = (
|
|
300
287
|
constants.getattr("archivedNextEP").format(model_id, str(timestamp))
|
|
@@ -302,25 +289,22 @@ async def scrape_archived_posts(
|
|
|
302
289
|
else constants.getattr("archivedEP").format(model_id)
|
|
303
290
|
)
|
|
304
291
|
log.debug(url)
|
|
305
|
-
|
|
292
|
+
|
|
306
293
|
new_tasks = []
|
|
307
|
-
posts=[]
|
|
294
|
+
posts = []
|
|
308
295
|
try:
|
|
309
|
-
task = (
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
visible=True,
|
|
313
|
-
)
|
|
314
|
-
if job_progress
|
|
315
|
-
else None
|
|
296
|
+
task = progress_utils.add_api_job_task(
|
|
297
|
+
f"[Archived] Timestamp -> {arrow.get(math.trunc(float(timestamp))).format(constants.getattr('API_DATE_FORMAT')) if timestamp is not None else 'initial'}",
|
|
298
|
+
visible=True,
|
|
316
299
|
)
|
|
317
300
|
async with c.requests_async(url) as r:
|
|
301
|
+
|
|
318
302
|
posts = (await r.json_())["list"]
|
|
319
303
|
log_id = f"timestamp:{arrow.get(math.trunc(float(timestamp))).format(constants.getattr('API_DATE_FORMAT')) if timestamp is not None else 'initial'}"
|
|
320
304
|
if not bool(posts):
|
|
321
305
|
log.debug(f"{log_id} -> no posts found")
|
|
322
306
|
return [], []
|
|
323
|
-
|
|
307
|
+
|
|
324
308
|
log.debug(f"{log_id} -> number of archived post found {len(posts)}")
|
|
325
309
|
log.debug(
|
|
326
310
|
f"{log_id} -> first date {posts[0].get('createdAt') or posts[0].get('postedAt')}"
|
|
@@ -350,9 +334,9 @@ async def scrape_archived_posts(
|
|
|
350
334
|
elif float(timestamp or 0) >= max(required_ids):
|
|
351
335
|
pass
|
|
352
336
|
else:
|
|
353
|
-
log.debug(f"{log_id} Required before {required_ids}")
|
|
337
|
+
log.debug(f"{log_id} Required before change: {required_ids}")
|
|
354
338
|
[required_ids.discard(float(ele["postedAtPrecise"])) for ele in posts]
|
|
355
|
-
log.debug(f"{log_id} Required after {required_ids}")
|
|
339
|
+
log.debug(f"{log_id} Required after change: {required_ids}")
|
|
356
340
|
|
|
357
341
|
if len(required_ids) > 0:
|
|
358
342
|
new_tasks.append(
|
|
@@ -360,7 +344,6 @@ async def scrape_archived_posts(
|
|
|
360
344
|
scrape_archived_posts(
|
|
361
345
|
c,
|
|
362
346
|
model_id,
|
|
363
|
-
job_progress=job_progress,
|
|
364
347
|
timestamp=posts[-1]["postedAtPrecise"],
|
|
365
348
|
required_ids=required_ids,
|
|
366
349
|
offset=False,
|
|
@@ -374,9 +357,9 @@ async def scrape_archived_posts(
|
|
|
374
357
|
log.traceback_(traceback.format_exc())
|
|
375
358
|
raise E
|
|
376
359
|
finally:
|
|
377
|
-
|
|
378
|
-
return posts, new_tasks
|
|
360
|
+
progress_utils.remove_api_job_task(task)
|
|
379
361
|
|
|
362
|
+
return posts, new_tasks
|
|
380
363
|
|
|
381
364
|
|
|
382
365
|
def trace_log_task(responseArray):
|
|
@@ -18,7 +18,7 @@ import traceback
|
|
|
18
18
|
import ofscraper.api.common.logs as common_logs
|
|
19
19
|
import ofscraper.classes.sessionmanager as sessionManager
|
|
20
20
|
import ofscraper.utils.constants as constants
|
|
21
|
-
import ofscraper.utils.
|
|
21
|
+
import ofscraper.utils.live.screens as progress_utils
|
|
22
22
|
from ofscraper.utils.context.run_async import run
|
|
23
23
|
|
|
24
24
|
log = logging.getLogger("shared")
|
|
@@ -29,51 +29,37 @@ log = logging.getLogger("shared")
|
|
|
29
29
|
####
|
|
30
30
|
##############################################################################
|
|
31
31
|
@run
|
|
32
|
-
async def
|
|
32
|
+
async def get_stories_post(model_id, c=None):
|
|
33
33
|
tasks = []
|
|
34
|
-
job_progress = progress_utils.stories_progress
|
|
35
34
|
|
|
36
|
-
tasks.append(
|
|
37
|
-
asyncio.create_task(scrape_stories(c, model_id, job_progress=job_progress))
|
|
38
|
-
)
|
|
35
|
+
tasks.append(asyncio.create_task(scrape_stories(c, model_id)))
|
|
39
36
|
|
|
40
37
|
data = await process_stories_tasks(tasks)
|
|
41
38
|
|
|
42
|
-
progress_utils.stories_layout.visible = False
|
|
43
39
|
return data
|
|
44
40
|
|
|
45
41
|
|
|
46
42
|
@run
|
|
47
43
|
async def get_stories_post(model_id, c=None):
|
|
48
44
|
tasks = []
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
asyncio.create_task(
|
|
52
|
-
scrape_stories(
|
|
53
|
-
c, model_id, job_progress=progress_utils.stories_progress
|
|
54
|
-
)
|
|
55
|
-
)
|
|
56
|
-
)
|
|
57
|
-
return await process_stories_tasks(tasks)
|
|
45
|
+
tasks.append(asyncio.create_task(scrape_stories(c, model_id)))
|
|
46
|
+
return await process_stories_tasks(tasks)
|
|
58
47
|
|
|
59
48
|
|
|
60
|
-
async def scrape_stories(c, user_id
|
|
49
|
+
async def scrape_stories(c, user_id) -> list:
|
|
61
50
|
stories = None
|
|
62
51
|
new_tasks = []
|
|
63
52
|
task = None
|
|
64
53
|
|
|
65
|
-
await asyncio.sleep(1)
|
|
54
|
+
# await asyncio.sleep(1)
|
|
66
55
|
url = constants.getattr("highlightsWithAStoryEP").format(user_id)
|
|
67
56
|
try:
|
|
68
|
-
task = (
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
visible=True,
|
|
72
|
-
)
|
|
73
|
-
if job_progress
|
|
74
|
-
else None
|
|
57
|
+
task = progress_utils.add_api_job_task(
|
|
58
|
+
f"[Stories] user id -> {user_id}",
|
|
59
|
+
visible=True,
|
|
75
60
|
)
|
|
76
61
|
async with c.requests_async(url=url) as r:
|
|
62
|
+
|
|
77
63
|
stories = await r.json_()
|
|
78
64
|
log.debug(
|
|
79
65
|
f"stories: -> found stories ids {list(map(lambda x:x.get('id'),stories))}"
|
|
@@ -91,13 +77,13 @@ async def scrape_stories(c, user_id, job_progress=None) -> list:
|
|
|
91
77
|
except asyncio.TimeoutError as _:
|
|
92
78
|
raise Exception(f"Task timed out {url}")
|
|
93
79
|
except Exception as E:
|
|
94
|
-
await asyncio.sleep(1)
|
|
80
|
+
# await asyncio.sleep(1)
|
|
95
81
|
log.traceback_(E)
|
|
96
82
|
log.traceback_(traceback.format_exc())
|
|
97
83
|
raise E
|
|
98
84
|
|
|
99
85
|
finally:
|
|
100
|
-
|
|
86
|
+
progress_utils.remove_api_job_task(task)
|
|
101
87
|
|
|
102
88
|
return stories, new_tasks
|
|
103
89
|
|
|
@@ -105,8 +91,7 @@ async def scrape_stories(c, user_id, job_progress=None) -> list:
|
|
|
105
91
|
async def process_stories_tasks(tasks):
|
|
106
92
|
responseArray = []
|
|
107
93
|
page_count = 0
|
|
108
|
-
|
|
109
|
-
page_task = overall_progress.add_task(
|
|
94
|
+
page_task = progress_utils.add_api_task(
|
|
110
95
|
f"Stories Pages Progress: {page_count}", visible=True
|
|
111
96
|
)
|
|
112
97
|
|
|
@@ -118,7 +103,7 @@ async def process_stories_tasks(tasks):
|
|
|
118
103
|
result, new_tasks_batch = await task
|
|
119
104
|
new_tasks.extend(new_tasks_batch)
|
|
120
105
|
page_count = page_count + 1
|
|
121
|
-
|
|
106
|
+
progress_utils.update_api_task(
|
|
122
107
|
page_task,
|
|
123
108
|
description=f"Stories Content Pages Progress: {page_count}",
|
|
124
109
|
)
|
|
@@ -148,7 +133,7 @@ async def process_stories_tasks(tasks):
|
|
|
148
133
|
continue
|
|
149
134
|
|
|
150
135
|
tasks = new_tasks
|
|
151
|
-
|
|
136
|
+
progress_utils.remove_api_task(page_task)
|
|
152
137
|
log.debug(
|
|
153
138
|
f"{common_logs.FINAL_IDS.format('Stories')} {list(map(lambda x:x['id'],responseArray))}"
|
|
154
139
|
)
|
|
@@ -171,79 +156,29 @@ async def process_stories_tasks(tasks):
|
|
|
171
156
|
|
|
172
157
|
|
|
173
158
|
@run
|
|
174
|
-
async def
|
|
175
|
-
highlightLists = await
|
|
176
|
-
return await
|
|
159
|
+
async def get_highlight_post(model_id, c=None):
|
|
160
|
+
highlightLists = await get_highlight_list(model_id, c)
|
|
161
|
+
return await get_highlights_via_list(highlightLists, c)
|
|
177
162
|
|
|
178
163
|
|
|
179
|
-
async def
|
|
164
|
+
async def get_highlight_list(model_id, c=None):
|
|
180
165
|
tasks = []
|
|
181
|
-
tasks.append(
|
|
182
|
-
asyncio.create_task(
|
|
183
|
-
scrape_highlight_list(
|
|
184
|
-
c, model_id, job_progress=progress_utils.highlights_progress
|
|
185
|
-
)
|
|
186
|
-
)
|
|
187
|
-
)
|
|
166
|
+
tasks.append(asyncio.create_task(scrape_highlight_list(c, model_id)))
|
|
188
167
|
return await process_task_get_highlight_list(tasks)
|
|
189
168
|
|
|
190
169
|
|
|
191
|
-
async def
|
|
170
|
+
async def get_highlights_via_list(highlightLists, c=None):
|
|
192
171
|
tasks = []
|
|
193
|
-
[
|
|
194
|
-
tasks.append(
|
|
195
|
-
asyncio.create_task(
|
|
196
|
-
scrape_highlights(c, i, job_progress=progress_utils.highlights_progress)
|
|
197
|
-
)
|
|
198
|
-
)
|
|
199
|
-
for i in highlightLists
|
|
200
|
-
]
|
|
172
|
+
[tasks.append(asyncio.create_task(scrape_highlights(c, i))) for i in highlightLists]
|
|
201
173
|
return await process_task_highlights(tasks)
|
|
202
174
|
|
|
203
175
|
|
|
204
|
-
@run
|
|
205
|
-
async def get_highlight_post(model_id, c=None):
|
|
206
|
-
highlightList = await get_highlight_list(model_id, c)
|
|
207
|
-
return await get_highlights_via_list(highlightList, c)
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
async def get_highlight_list(model_id, c=None):
|
|
211
|
-
with progress_utils.set_up_api_highlights_lists():
|
|
212
|
-
tasks = []
|
|
213
|
-
tasks.append(
|
|
214
|
-
asyncio.create_task(
|
|
215
|
-
scrape_highlight_list(
|
|
216
|
-
c, model_id, job_progress=progress_utils.highlights_progress
|
|
217
|
-
)
|
|
218
|
-
)
|
|
219
|
-
)
|
|
220
|
-
return await process_task_get_highlight_list(tasks)
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
async def get_highlights_via_list(highlightLists, c):
|
|
224
|
-
tasks = []
|
|
225
|
-
with progress_utils.set_up_api_highlights():
|
|
226
|
-
|
|
227
|
-
[
|
|
228
|
-
tasks.append(
|
|
229
|
-
asyncio.create_task(
|
|
230
|
-
scrape_highlights(
|
|
231
|
-
c, i, job_progress=progress_utils.highlights_progress
|
|
232
|
-
)
|
|
233
|
-
)
|
|
234
|
-
)
|
|
235
|
-
for i in highlightLists
|
|
236
|
-
]
|
|
237
|
-
return await process_task_highlights(tasks)
|
|
238
|
-
|
|
239
|
-
|
|
240
176
|
async def process_task_get_highlight_list(tasks):
|
|
241
177
|
highlightLists = []
|
|
242
178
|
|
|
243
179
|
page_count = 0
|
|
244
|
-
overall_progress = progress_utils.overall_progress
|
|
245
180
|
|
|
246
|
-
page_task =
|
|
181
|
+
page_task = progress_utils.add_api_task(
|
|
247
182
|
f"Highlights List Pages Progress: {page_count}", visible=True
|
|
248
183
|
)
|
|
249
184
|
seen = set()
|
|
@@ -254,7 +189,7 @@ async def process_task_get_highlight_list(tasks):
|
|
|
254
189
|
result, new_tasks_batch = await task
|
|
255
190
|
new_tasks.extend(new_tasks_batch)
|
|
256
191
|
page_count = page_count + 1
|
|
257
|
-
|
|
192
|
+
progress_utils.update_api_task(
|
|
258
193
|
page_task,
|
|
259
194
|
description=f"Highlights List Pages Progress: {page_count}",
|
|
260
195
|
)
|
|
@@ -272,7 +207,7 @@ async def process_task_get_highlight_list(tasks):
|
|
|
272
207
|
continue
|
|
273
208
|
tasks = new_tasks
|
|
274
209
|
|
|
275
|
-
|
|
210
|
+
progress_utils.remove_api_task(page_task)
|
|
276
211
|
log.trace(
|
|
277
212
|
f"{common_logs.FINAL_IDS.format('Highlight List')} {map(lambda x:x,highlightLists)}"
|
|
278
213
|
)
|
|
@@ -286,9 +221,8 @@ async def process_task_get_highlight_list(tasks):
|
|
|
286
221
|
async def process_task_highlights(tasks):
|
|
287
222
|
highlightResponse = []
|
|
288
223
|
page_count = 0
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
f"Highlight Content via List Pages Progress: {page_count}", visible=True
|
|
224
|
+
page_task = progress_utils.add_api_task(
|
|
225
|
+
f"Highlight Content via list pages progress: {page_count}", visible=True
|
|
292
226
|
)
|
|
293
227
|
seen = set()
|
|
294
228
|
while tasks:
|
|
@@ -298,9 +232,9 @@ async def process_task_highlights(tasks):
|
|
|
298
232
|
result, new_tasks_batch = await task
|
|
299
233
|
new_tasks.extend(new_tasks_batch)
|
|
300
234
|
page_count = page_count + 1
|
|
301
|
-
|
|
235
|
+
progress_utils.update_api_task(
|
|
302
236
|
page_task,
|
|
303
|
-
description=f"Highlights
|
|
237
|
+
description=f"Highlights content via list pages progress: {page_count}",
|
|
304
238
|
)
|
|
305
239
|
new_posts = [
|
|
306
240
|
post
|
|
@@ -327,6 +261,7 @@ async def process_task_highlights(tasks):
|
|
|
327
261
|
log.traceback_(traceback.format_exc())
|
|
328
262
|
continue
|
|
329
263
|
tasks = new_tasks
|
|
264
|
+
|
|
330
265
|
log.debug(
|
|
331
266
|
f"{common_logs.FINAL_IDS.format('Highlight List Posts')} {list(map(lambda x:x['id'],highlightResponse))}"
|
|
332
267
|
)
|
|
@@ -340,25 +275,23 @@ async def process_task_highlights(tasks):
|
|
|
340
275
|
log.debug(
|
|
341
276
|
f"{common_logs.FINAL_COUNT.format('Highlight List Posts')} {len(highlightResponse)}"
|
|
342
277
|
)
|
|
278
|
+
progress_utils.remove_api_task(page_task)
|
|
343
279
|
return highlightResponse
|
|
344
280
|
|
|
345
281
|
|
|
346
|
-
async def scrape_highlight_list(c, user_id,
|
|
282
|
+
async def scrape_highlight_list(c, user_id, offset=0) -> list:
|
|
347
283
|
new_tasks = []
|
|
348
|
-
await asyncio.sleep(1)
|
|
284
|
+
# await asyncio.sleep(1)
|
|
349
285
|
url = constants.getattr("highlightsWithStoriesEP").format(user_id, offset)
|
|
350
286
|
task = None
|
|
351
287
|
|
|
352
288
|
try:
|
|
353
|
-
task = (
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
visible=True,
|
|
357
|
-
)
|
|
358
|
-
if job_progress
|
|
359
|
-
else None
|
|
289
|
+
task = progress_utils.add_api_job_task(
|
|
290
|
+
f"[Highlights] scraping highlight list offset-> {offset}",
|
|
291
|
+
visible=True,
|
|
360
292
|
)
|
|
361
293
|
async with c.requests_async(url) as r:
|
|
294
|
+
|
|
362
295
|
resp_data = await r.json_()
|
|
363
296
|
log.trace(f"highlights list: -> found highlights list data {resp_data}")
|
|
364
297
|
data = get_highlightList(resp_data)
|
|
@@ -367,33 +300,30 @@ async def scrape_highlight_list(c, user_id, job_progress=None, offset=0) -> list
|
|
|
367
300
|
except asyncio.TimeoutError:
|
|
368
301
|
raise Exception(f"Task timed out {url}")
|
|
369
302
|
except Exception as E:
|
|
370
|
-
await asyncio.sleep(1)
|
|
303
|
+
# await asyncio.sleep(1)
|
|
371
304
|
log.traceback_(E)
|
|
372
305
|
log.traceback_(traceback.format_exc())
|
|
373
306
|
raise E
|
|
374
307
|
|
|
375
308
|
finally:
|
|
376
|
-
|
|
309
|
+
progress_utils.remove_api_job_task(task)
|
|
377
310
|
|
|
378
311
|
return data, new_tasks
|
|
379
312
|
|
|
380
313
|
|
|
381
|
-
async def scrape_highlights(c, id
|
|
314
|
+
async def scrape_highlights(c, id) -> list:
|
|
382
315
|
new_tasks = []
|
|
383
|
-
await asyncio.sleep(1)
|
|
316
|
+
# await asyncio.sleep(1)
|
|
384
317
|
url = constants.getattr("storyEP").format(id)
|
|
385
318
|
task = None
|
|
386
319
|
|
|
387
320
|
try:
|
|
388
|
-
task = (
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
visible=True,
|
|
392
|
-
)
|
|
393
|
-
if job_progress
|
|
394
|
-
else None
|
|
321
|
+
task = progress_utils.add_api_job_task(
|
|
322
|
+
f"[Highlights] highlights id -> {id}",
|
|
323
|
+
visible=True,
|
|
395
324
|
)
|
|
396
325
|
async with c.requests_async(url=url) as r:
|
|
326
|
+
|
|
397
327
|
resp_data = await r.json_()
|
|
398
328
|
log.trace(f"highlights: -> found highlights data {resp_data}")
|
|
399
329
|
log.debug(
|
|
@@ -403,13 +333,13 @@ async def scrape_highlights(c, id, job_progress=None) -> list:
|
|
|
403
333
|
raise Exception(f"Task timed out {url}")
|
|
404
334
|
|
|
405
335
|
except Exception as E:
|
|
406
|
-
await asyncio.sleep(1)
|
|
336
|
+
# await asyncio.sleep(1)
|
|
407
337
|
log.traceback_(E)
|
|
408
338
|
log.traceback_(traceback.format_exc())
|
|
409
339
|
raise E
|
|
410
340
|
|
|
411
341
|
finally:
|
|
412
|
-
|
|
342
|
+
progress_utils.remove_api_job_task(task)
|
|
413
343
|
|
|
414
344
|
return resp_data["stories"], new_tasks
|
|
415
345
|
|
|
@@ -442,7 +372,6 @@ def get_individual_stories(id, c=None):
|
|
|
442
372
|
retries=constants.getattr("API_INDVIDIUAL_NUM_TRIES"),
|
|
443
373
|
wait_min=constants.getattr("OF_MIN_WAIT_API"),
|
|
444
374
|
wait_max=constants.getattr("OF_MAX_WAIT_API"),
|
|
445
|
-
new_request_auth=True,
|
|
446
375
|
) as c:
|
|
447
376
|
with c.requests_async(constants.getattr("storiesSPECIFIC").format(id)) as r:
|
|
448
377
|
log.trace(f"highlight raw highlight individua; {r.json_()}")
|
|
@@ -14,24 +14,19 @@ r"""
|
|
|
14
14
|
import logging
|
|
15
15
|
import traceback
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import ofscraper.utils.context.stdout as stdout
|
|
17
|
+
import ofscraper.utils.console as console
|
|
20
18
|
|
|
21
19
|
from . import me
|
|
22
20
|
|
|
23
21
|
log = logging.getLogger("shared")
|
|
24
22
|
|
|
25
|
-
console = Console()
|
|
26
|
-
|
|
27
23
|
|
|
28
24
|
def print_sign_status():
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
print("Status - \033[31mDOWN\033[0m")
|
|
25
|
+
status = getstatus()
|
|
26
|
+
if status == "UP":
|
|
27
|
+
console.get_shared_console().print("Status - [bold green]UP[/bold green]")
|
|
28
|
+
else:
|
|
29
|
+
console.get_shared_console().print("Status - [bold red]DOWN[/bold red]")
|
|
35
30
|
|
|
36
31
|
|
|
37
32
|
def getstatus():
|