ofscraper 3.9.0.dev5__tar.gz → 3.9.0.dev7__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.
Files changed (165) hide show
  1. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/PKG-INFO +1 -1
  2. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/actions/process.py +1 -1
  3. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/actions/scraper.py +18 -52
  4. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/api/archive.py +9 -7
  5. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/api/highlights.py +14 -5
  6. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/api/labels.py +6 -2
  7. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/api/messages.py +20 -18
  8. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/api/paid.py +10 -11
  9. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/api/pinned.py +7 -5
  10. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/api/subscriptions/individual.py +3 -3
  11. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/api/subscriptions/subscriptions.py +3 -3
  12. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/api/timeline.py +21 -17
  13. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/classes/multiprocessprogress.py +1 -1
  14. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/classes/placeholder.py +2 -3
  15. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/commands/scraper.py +0 -1
  16. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/const/config.py +2 -0
  17. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/const/constants.py +1 -0
  18. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/const/time.py +1 -1
  19. ofscraper-3.9.0.dev7/ofscraper/db/operations.py +1297 -0
  20. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/db/queries.py +209 -30
  21. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/download/alt_download.py +82 -74
  22. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/download/alt_downloadbatch.py +66 -62
  23. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/download/common/common.py +18 -0
  24. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/download/common/log.py +0 -1
  25. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/download/common/metadata.py +2 -2
  26. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/download/common/paths.py +2 -1
  27. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/download/downloadnormal.py +3 -3
  28. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/download/main_download.py +79 -69
  29. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/download/main_downloadbatch.py +62 -53
  30. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/filters/media/helpers.py +1 -2
  31. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/filters/media/main.py +0 -17
  32. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/args/areas.py +9 -2
  33. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/args/helpers.py +1 -1
  34. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/logs/classes.py +54 -8
  35. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/logs/other.py +18 -9
  36. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/progress.py +18 -2
  37. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/pyproject.toml +1 -1
  38. ofscraper-3.9.0.dev5/ofscraper/db/operations.py +0 -632
  39. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/LICENSE +0 -0
  40. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/README.md +0 -0
  41. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/__main__.py +0 -0
  42. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/__version__.py +0 -0
  43. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/__version__.pye +0 -0
  44. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/actions/__init__.py +0 -0
  45. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/actions/like.py +0 -0
  46. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/api/init.py +0 -0
  47. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/api/me.py +0 -0
  48. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/api/profile.py +0 -0
  49. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/api/subscriptions/helpers.py +0 -0
  50. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/api/subscriptions/lists.py +0 -0
  51. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/classes/base.py +0 -0
  52. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/classes/labels.py +0 -0
  53. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/classes/media.py +0 -0
  54. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/classes/models.py +0 -0
  55. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/classes/posts.py +0 -0
  56. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/classes/semaphoreDelayed.py +0 -0
  57. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/classes/sessionbuilder.py +0 -0
  58. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/classes/table.py +0 -0
  59. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/commands/check.py +0 -0
  60. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/commands/manual.py +0 -0
  61. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/commands/picker.py +0 -0
  62. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/const/binary.py +0 -0
  63. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/const/date.py +0 -0
  64. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/const/download.py +0 -0
  65. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/const/files.py +0 -0
  66. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/const/general.py +0 -0
  67. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/const/logger.py +0 -0
  68. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/const/other_url.py +0 -0
  69. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/const/prompts.py +0 -0
  70. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/const/req.py +0 -0
  71. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/const/test_constants.py +0 -0
  72. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/const/url.py +0 -0
  73. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/db/__init__.py +0 -0
  74. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/download/common/globals.py +0 -0
  75. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/download/common/keyhelpers.py +0 -0
  76. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/download/common/message.py +0 -0
  77. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/download/common/progress.py +0 -0
  78. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/download/common/sem.py +0 -0
  79. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/download/common/text.py +0 -0
  80. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/download/download.py +0 -0
  81. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/download/downloadbatch.py +0 -0
  82. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/filters/models/date.py +0 -0
  83. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/filters/models/flags.py +0 -0
  84. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/filters/models/other.py +0 -0
  85. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/filters/models/price.py +0 -0
  86. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/filters/models/sort.py +0 -0
  87. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/filters/models/subtype.py +0 -0
  88. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/models/retriver.py +0 -0
  89. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/models/selector.py +0 -0
  90. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/prompts/helpers/model_helpers.py +0 -0
  91. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/prompts/helpers/prompt_helpers.py +0 -0
  92. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/prompts/keybindings.py +0 -0
  93. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/prompts/promptConvert.py +0 -0
  94. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/prompts/prompt_groups/actions.py +0 -0
  95. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/prompts/prompt_groups/area.py +0 -0
  96. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/prompts/prompt_groups/auth.py +0 -0
  97. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/prompts/prompt_groups/binary.py +0 -0
  98. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/prompts/prompt_groups/config.py +0 -0
  99. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/prompts/prompt_groups/menu.py +0 -0
  100. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/prompts/prompt_groups/model.py +0 -0
  101. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/prompts/prompt_groups/profile.py +0 -0
  102. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/prompts/prompt_strings.py +0 -0
  103. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/prompts/prompt_validators.py +0 -0
  104. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/prompts/prompts.py +0 -0
  105. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/runner/exit.py +0 -0
  106. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/runner/load.py +0 -0
  107. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/runner/run.py +0 -0
  108. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/__init__.py +0 -0
  109. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/actions.py +0 -0
  110. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/args/globals.py +0 -0
  111. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/args/parse.py +0 -0
  112. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/args/quality.py +0 -0
  113. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/args/read.py +0 -0
  114. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/args/user.py +0 -0
  115. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/args/write.py +0 -0
  116. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/auth/context.py +0 -0
  117. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/auth/data.py +0 -0
  118. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/auth/file.py +0 -0
  119. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/auth/helpers.py +0 -0
  120. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/auth/make.py +0 -0
  121. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/auth/request.py +0 -0
  122. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/auth/schema.py +0 -0
  123. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/binaries.py +0 -0
  124. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/cache.py +0 -0
  125. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/checkers.py +0 -0
  126. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/config/config.py +0 -0
  127. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/config/context.py +0 -0
  128. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/config/custom.py +0 -0
  129. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/config/data.py +0 -0
  130. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/config/file.py +0 -0
  131. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/config/menu.py +0 -0
  132. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/config/schema.py +0 -0
  133. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/config/wrapper.py +0 -0
  134. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/console.py +0 -0
  135. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/constants.py +0 -0
  136. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/context/exit.py +0 -0
  137. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/context/run_async.py +0 -0
  138. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/context/stdout.py +0 -0
  139. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/dates.py +0 -0
  140. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/encoding.py +0 -0
  141. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/hash.py +0 -0
  142. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/logs/close.py +0 -0
  143. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/logs/globals.py +0 -0
  144. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/logs/helpers.py +0 -0
  145. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/logs/logger.py +0 -0
  146. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/logs/logs.py +0 -0
  147. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/logs/stdout.py +0 -0
  148. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/manager.py +0 -0
  149. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/me.py +0 -0
  150. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/menu.py +0 -0
  151. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/paths/check.py +0 -0
  152. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/paths/common.py +0 -0
  153. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/paths/manage.py +0 -0
  154. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/paths/paths.py +0 -0
  155. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/profiles/data.py +0 -0
  156. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/profiles/manage.py +0 -0
  157. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/profiles/tools.py +0 -0
  158. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/run.py +0 -0
  159. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/sems.py +0 -0
  160. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/separate.py +0 -0
  161. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/settings.py +0 -0
  162. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/system/free.py +0 -0
  163. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/system/network.py +0 -0
  164. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/system/system.py +0 -0
  165. {ofscraper-3.9.0.dev5 → ofscraper-3.9.0.dev7}/ofscraper/utils/text.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ofscraper
3
- Version: 3.9.0.dev5
3
+ Version: 3.9.0.dev7
4
4
  Summary: automatically scrape onlyfans
5
5
  Author: datawhores
6
6
  Author-email: datawhores@riseup.net
@@ -107,7 +107,7 @@ async def process_user_first_helper(ele):
107
107
  model_id = ele.id
108
108
  username = ele.name
109
109
  operations.table_init_create(model_id=model_id, username=username)
110
- results, posts = OF.process_areas(ele, model_id, progress=False)
110
+ results, posts = OF.process_areas(ele, model_id, job_progress=False)
111
111
  return results
112
112
  except Exception as e:
113
113
  if isinstance(e, KeyboardInterrupt):
@@ -54,12 +54,9 @@ async def process_messages(model_id, username, c):
54
54
  messages_ = list(
55
55
  map(lambda x: posts_.Post(x, model_id, username), messages_)
56
56
  )
57
- curr = set(
58
- operations.get_all_messages_ids(model_id=model_id, username=username)
59
- )
60
57
  [
61
- operations.write_messages_table(
62
- list(filter(lambda x: x.id not in curr, messages_)),
58
+ operations.make_messages_table_changes(
59
+ messages_,
63
60
  model_id=model_id,
64
61
  username=username,
65
62
  )
@@ -75,7 +72,6 @@ async def process_messages(model_id, username, c):
75
72
 
76
73
  await operations.batch_mediainsert(
77
74
  output,
78
- operations.write_media_table_batch,
79
75
  model_id=model_id,
80
76
  username=username,
81
77
  downloaded=False,
@@ -107,11 +103,8 @@ async def process_paid_post(model_id, username, c):
107
103
  paid_content,
108
104
  )
109
105
  )
110
- curr = set(
111
- operations.get_all_post_ids(model_id=model_id, username=username)
112
- )
113
- operations.write_post_table(
114
- list(filter(lambda x: x.id not in curr, paid_content)),
106
+ operations.make_post_table_changes(
107
+ paid_content,
115
108
  model_id=model_id,
116
109
  username=username,
117
110
  )
@@ -122,7 +115,6 @@ async def process_paid_post(model_id, username, c):
122
115
 
123
116
  await operations.batch_mediainsert(
124
117
  output,
125
- operations.write_media_table_batch,
126
118
  model_id=model_id,
127
119
  username=username,
128
120
  downloaded=False,
@@ -153,11 +145,8 @@ async def process_stories(model_id, username, c):
153
145
  stories,
154
146
  )
155
147
  )
156
- curr = set(
157
- operations.get_all_stories_ids(model_id=model_id, username=username)
158
- )
159
- operations.write_stories_table(
160
- list(filter(lambda x: x.id not in curr, stories)),
148
+ operations.make_stories_tables_changes(
149
+ stories,
161
150
  model_id=model_id,
162
151
  username=username,
163
152
  )
@@ -169,7 +158,6 @@ async def process_stories(model_id, username, c):
169
158
  [output.extend(stories.media) for stories in stories]
170
159
  await operations.batch_mediainsert(
171
160
  output,
172
- operations.write_media_table_batch,
173
161
  model_id=model_id,
174
162
  username=username,
175
163
  downloaded=False,
@@ -197,11 +185,8 @@ async def process_highlights(model_id, username, c):
197
185
  highlights_,
198
186
  )
199
187
  )
200
- curr = set(
201
- operations.get_all_stories_ids(model_id=model_id, username=username)
202
- )
203
- operations.write_stories_table(
204
- list(filter(lambda x: x.id not in curr, highlights_)),
188
+ operations.make_stories_tables_changes(
189
+ highlights_,
205
190
  model_id=model_id,
206
191
  username=username,
207
192
  )
@@ -213,7 +198,6 @@ async def process_highlights(model_id, username, c):
213
198
  [output.extend(stories.media) for stories in highlights_]
214
199
  await operations.batch_mediainsert(
215
200
  output,
216
- operations.write_media_table_batch,
217
201
  model_id=model_id,
218
202
  username=username,
219
203
  downloaded=False,
@@ -244,15 +228,12 @@ async def process_timeline_posts(model_id, username, c):
244
228
  timeline_posts,
245
229
  )
246
230
  )
247
-
248
- curr = set(
249
- operations.get_all_post_ids(model_id=model_id, username=username)
250
- )
251
- operations.write_post_table(
252
- list(filter(lambda x: x.id not in curr, timeline_posts)),
231
+ operations.make_post_table_changes(
232
+ timeline_posts,
253
233
  model_id=model_id,
254
234
  username=username,
255
235
  )
236
+
256
237
  log.debug(
257
238
  f"[bold]Timeline media count with locked[/bold] {sum(map(lambda x:len(x.post_media),timeline_posts))}"
258
239
  )
@@ -263,14 +244,12 @@ async def process_timeline_posts(model_id, username, c):
263
244
 
264
245
  await operations.batch_mediainsert(
265
246
  output,
266
- operations.write_media_table_batch,
267
247
  model_id=model_id,
268
248
  username=username,
269
249
  downloaded=False,
270
250
  )
271
251
  await operations.batch_mediainsert(
272
252
  output,
273
- operations.update_response_media_table,
274
253
  model_id=model_id,
275
254
  username=username,
276
255
  downloaded=False,
@@ -303,11 +282,8 @@ async def process_archived_posts(model_id, username, c):
303
282
  )
304
283
  )
305
284
 
306
- curr = set(
307
- operations.get_all_post_ids(model_id=model_id, username=username)
308
- )
309
- operations.write_post_table(
310
- list(filter(lambda x: x.id not in curr, archived_posts)),
285
+ operations.make_post_table_changes(
286
+ archived_posts,
311
287
  model_id=model_id,
312
288
  username=username,
313
289
  )
@@ -322,7 +298,6 @@ async def process_archived_posts(model_id, username, c):
322
298
 
323
299
  await operations.batch_mediainsert(
324
300
  output,
325
- operations.write_media_table_batch,
326
301
  model_id=model_id,
327
302
  username=username,
328
303
  downloaded=False,
@@ -353,11 +328,8 @@ async def process_pinned_posts(model_id, username, c):
353
328
  lambda x: posts_.Post(x, model_id, username, "pinned"), pinned_posts
354
329
  )
355
330
  )
356
- curr = set(
357
- operations.get_all_post_ids(model_id=model_id, username=username)
358
- )
359
- operations.write_post_table(
360
- list(filter(lambda x: x.id not in curr, pinned_posts)),
331
+ operations.make_post_table_changes(
332
+ pinned_posts,
361
333
  model_id=model_id,
362
334
  username=username,
363
335
  )
@@ -372,14 +344,12 @@ async def process_pinned_posts(model_id, username, c):
372
344
 
373
345
  await operations.batch_mediainsert(
374
346
  output,
375
- operations.write_media_table_batch,
376
347
  model_id=model_id,
377
348
  username=username,
378
349
  downloaded=False,
379
350
  )
380
351
  await operations.batch_mediainsert(
381
352
  output,
382
- operations.update_response_media_table,
383
353
  model_id=model_id,
384
354
  username=username,
385
355
  downloaded=False,
@@ -475,11 +445,8 @@ def process_all_paid():
475
445
  for ele in all_posts:
476
446
  new_dict[ele.id] = ele
477
447
  new_posts = new_dict.values()
478
- curr = set(
479
- operations.get_all_post_ids(model_id=model_id, username=username) or []
480
- )
481
- operations.write_post_table(
482
- list(filter(lambda x: x.id not in curr, new_posts)),
448
+ operations.make_post_table_changes(
449
+ new_posts,
483
450
  model_id=model_id,
484
451
  username=username,
485
452
  )
@@ -572,8 +539,7 @@ async def process_areas(ele, model_id) -> list:
572
539
  asyncio.get_event_loop().set_default_executor(executor)
573
540
  username = ele.name
574
541
  output = []
575
- group = progress_utils.get_api_progress_Group()
576
- with Live(group, console=console_.get_shared_console()):
542
+ with progress_utils.setup_api_progress_live():
577
543
  medias, posts = await process_task(model_id, username, ele)
578
544
  output.extend(medias)
579
545
  return filters.filterMedia(output), filters.filterPost(posts)
@@ -218,13 +218,13 @@ def get_after(model_id, username, forced_after=None):
218
218
  "Used --after previously. Scraping all archived posts required to make sure content is not missing"
219
219
  )
220
220
  return 0
221
- curr = operations.get_archived_postinfo(model_id=model_id, username=username)
221
+ curr = operations.get_archived_media(model_id=model_id, username=username)
222
222
 
223
223
  if len(curr) == 0:
224
224
  log.debug("Setting date to zero because database is empty")
225
225
  return 0
226
- missing_items = list(filter(lambda x: x[-2] == 0, curr))
227
- missing_items = list(sorted(missing_items, key=lambda x: arrow.get(x[-1])))
226
+ missing_items = list(filter(lambda x: x[10] != 1, curr))
227
+ missing_items = list(sorted(missing_items, key=lambda x: arrow.get(x[12])))
228
228
  if len(missing_items) == 0:
229
229
  log.debug("Using last db date because,all downloads in db marked as downloaded")
230
230
  return (
@@ -235,7 +235,7 @@ def get_after(model_id, username, forced_after=None):
235
235
  log.debug(
236
236
  f"Setting date slightly before earliest missing item\nbecause {len(missing_items)} posts in db are marked as undownloaded"
237
237
  )
238
- return arrow.get(missing_items[0][-1]).float_timestamp - 1000
238
+ return arrow.get(missing_items[0][12]).float_timestamp - 1000
239
239
 
240
240
 
241
241
  @run
@@ -322,7 +322,7 @@ async def scrape_archived_posts(
322
322
  scrape_archived_posts(
323
323
  c,
324
324
  model_id,
325
- job_progress=None,
325
+ job_progress=job_progress,
326
326
  timestamp=posts[-1]["postedAtPrecise"],
327
327
  )
328
328
  )
@@ -341,7 +341,7 @@ async def scrape_archived_posts(
341
341
  scrape_archived_posts(
342
342
  c,
343
343
  model_id,
344
- job_progress=None,
344
+ job_progress=job_progress,
345
345
  timestamp=posts[-1]["postedAtPrecise"],
346
346
  required_ids=required_ids,
347
347
  )
@@ -361,5 +361,7 @@ async def scrape_archived_posts(
361
361
 
362
362
  finally:
363
363
  sem.release()
364
- job_progress.remove_task(task) if job_progress and task else None
364
+ job_progress.remove_task(
365
+ task
366
+ ) if job_progress and task != None else None
365
367
  return posts, new_tasks
@@ -213,7 +213,9 @@ async def scrape_stories(c, user_id, job_progress=None) -> list:
213
213
 
214
214
  finally:
215
215
  sem.release()
216
- job_progress.remove_task(task) if job_progress and task else None
216
+ job_progress.remove_task(
217
+ task
218
+ ) if job_progress and task != None else None
217
219
 
218
220
  return stories, new_tasks
219
221
 
@@ -340,7 +342,7 @@ async def get_highlights_via_list_progress(highlightLists, c=None):
340
342
  @run
341
343
  async def get_highlight_post(model_id, c=None):
342
344
  highlightList = await get_highlight_list(model_id, c)
343
- return await get_highlights_via_list(highlightList)
345
+ return await get_highlights_via_list(highlightList, c)
344
346
 
345
347
 
346
348
  async def get_highlight_list(model_id, c=None):
@@ -382,9 +384,12 @@ async def get_highlight_list(model_id, c=None):
382
384
 
383
385
 
384
386
  async def get_highlights_via_list(highlightLists, c):
387
+ job_progress = None
385
388
  tasks = []
386
389
  [
387
- tasks.append(asyncio.create_task(scrape_highlights(c, i, job_progress=None)))
390
+ tasks.append(
391
+ asyncio.create_task(scrape_highlights(c, i, job_progress=job_progress))
392
+ )
388
393
  for i in highlightLists
389
394
  ]
390
395
 
@@ -487,7 +492,9 @@ async def scrape_highlight_list(c, user_id, job_progress=None, offset=0) -> list
487
492
 
488
493
  finally:
489
494
  sem.release()
490
- job_progress.remove_task(task) if job_progress and task else None
495
+ job_progress.remove_task(
496
+ task
497
+ ) if job_progress and task != None else None
491
498
 
492
499
  return data, new_tasks
493
500
 
@@ -540,7 +547,9 @@ async def scrape_highlights(c, id, job_progress=None) -> list:
540
547
 
541
548
  finally:
542
549
  sem.release()
543
- job_progress.remove_task(task) if job_progress and task else None
550
+ job_progress.remove_task(
551
+ task
552
+ ) if job_progress and task != None else None
544
553
 
545
554
  return resp_data["stories"], new_tasks
546
555
 
@@ -173,7 +173,9 @@ async def scrape_labels(c, model_id, job_progress=None, offset=0):
173
173
 
174
174
  finally:
175
175
  sem.release()
176
- job_progress.remove_task(task) if job_progress and task else None
176
+ job_progress.remove_task(
177
+ task
178
+ ) if job_progress and task != None else None
177
179
 
178
180
 
179
181
  @run
@@ -344,7 +346,9 @@ async def scrape_labelled_posts(c, label, model_id, job_progress=None, offset=0)
344
346
 
345
347
  finally:
346
348
  sem.release()
347
- job_progress.remove_task(task) if job_progress and task else None
349
+ job_progress.remove_task(
350
+ task
351
+ ) if job_progress and task != None else None
348
352
 
349
353
  return label, posts, new_tasks
350
354
 
@@ -136,7 +136,7 @@ Setting initial message scan date for {username} to {arrow.get(after).format('YY
136
136
  if len(IDArray) <= 2:
137
137
  tasks.append(
138
138
  asyncio.create_task(
139
- scrape_messages(c, model_id, job_progress, message_id=None)
139
+ scrape_messages(c, model_id, job_progress=job_progress, message_id=None)
140
140
  )
141
141
  )
142
142
 
@@ -156,7 +156,7 @@ Setting initial message scan date for {username} to {arrow.get(after).format('YY
156
156
  scrape_messages(
157
157
  c,
158
158
  model_id,
159
- job_progress,
159
+ job_progress=job_progress,
160
160
  message_id=None,
161
161
  required_ids=set(splitArraysTime[0]),
162
162
  )
@@ -168,7 +168,7 @@ Setting initial message scan date for {username} to {arrow.get(after).format('YY
168
168
  scrape_messages(
169
169
  c,
170
170
  model_id,
171
- job_progress,
171
+ job_progress=job_progress,
172
172
  message_id=splitArraysID[0][0],
173
173
  required_ids=set(splitArraysTime[0]),
174
174
  )
@@ -181,7 +181,7 @@ Setting initial message scan date for {username} to {arrow.get(after).format('YY
181
181
  scrape_messages(
182
182
  c,
183
183
  model_id,
184
- job_progress,
184
+ job_progress=job_progress,
185
185
  required_ids=set(splitArraysTime[i]),
186
186
  message_id=splitArraysID[i - 1][-1],
187
187
  )
@@ -195,7 +195,7 @@ Setting initial message scan date for {username} to {arrow.get(after).format('YY
195
195
  scrape_messages(
196
196
  c,
197
197
  model_id,
198
- job_progress,
198
+ job_progress=job_progress,
199
199
  message_id=splitArraysID[-2][-1],
200
200
  )
201
201
  )
@@ -206,7 +206,7 @@ Setting initial message scan date for {username} to {arrow.get(after).format('YY
206
206
  scrape_messages(
207
207
  c,
208
208
  model_id,
209
- job_progress,
209
+ job_progress=job_progress,
210
210
  message_id=splitArraysID[-1][-1],
211
211
  )
212
212
  )
@@ -217,7 +217,7 @@ Setting initial message scan date for {username} to {arrow.get(after).format('YY
217
217
  scrape_messages(
218
218
  c,
219
219
  model_id,
220
- job_progress,
220
+ job_progress=job_progress,
221
221
  message_id=IDArray[0],
222
222
  required_ids=set(postedAtArray[1:]),
223
223
  )
@@ -282,7 +282,7 @@ async def get_messages(model_id, username, forced_after=None, c=None):
282
282
  global sem
283
283
  sem = sems.get_req_sem()
284
284
  global after
285
-
285
+ job_progress = None
286
286
  tasks = []
287
287
  responseArray = []
288
288
  # require a min num of posts to be returned
@@ -371,7 +371,7 @@ Setting initial message scan date for {username} to {arrow.get(after).format('YY
371
371
  if len(IDArray) <= 2:
372
372
  tasks.append(
373
373
  asyncio.create_task(
374
- scrape_messages(c, model_id, job_progress=None, message_id=None)
374
+ scrape_messages(c, model_id, job_progress=job_progress, message_id=None)
375
375
  )
376
376
  )
377
377
 
@@ -512,7 +512,7 @@ def set_check(unduped, model_id, after):
512
512
 
513
513
 
514
514
  async def scrape_messages(
515
- c, model_id, progress=None, message_id=None, required_ids=None
515
+ c, model_id, job_progress=None, message_id=None, required_ids=None
516
516
  ) -> list:
517
517
  global sem
518
518
  global tasks
@@ -543,10 +543,10 @@ async def scrape_messages(
543
543
  attempt.set(attempt.get(0) + 1)
544
544
 
545
545
  task = (
546
- progress.add_task(
546
+ job_progress.add_task(
547
547
  f"Attempt {attempt.get()}/{constants.getattr('NUM_TRIES')}: Message ID-> {message_id if message_id else 'initial'}"
548
548
  )
549
- if progress
549
+ if job_progress
550
550
  else None
551
551
  )
552
552
  if r.ok:
@@ -596,7 +596,7 @@ async def scrape_messages(
596
596
  scrape_messages(
597
597
  c,
598
598
  model_id,
599
- progress,
599
+ job_progress=job_progress,
600
600
  message_id=messages[-1]["id"],
601
601
  )
602
602
  )
@@ -618,7 +618,7 @@ async def scrape_messages(
618
618
  scrape_messages(
619
619
  c,
620
620
  model_id,
621
- progress,
621
+ job_progress=job_progress,
622
622
  message_id=messages[-1]["id"],
623
623
  required_ids=required_ids,
624
624
  )
@@ -640,7 +640,9 @@ async def scrape_messages(
640
640
  raise E
641
641
  finally:
642
642
  sem.release()
643
- progress.remove_task(task) if progress and task else None
643
+ job_progress.remove_task(
644
+ task
645
+ ) if job_progress and task != None else None
644
646
  return messages, new_tasks
645
647
 
646
648
 
@@ -682,8 +684,8 @@ def get_after(model_id, username, forced_after=None):
682
684
  if len(curr) == 0:
683
685
  log.debug("Setting date to zero because database is empty")
684
686
  return 0
685
- missing_items = list(filter(lambda x: x[-2] == 0, curr))
686
- missing_items = list(sorted(missing_items, key=lambda x: arrow.get(x[-1])))
687
+ missing_items = list(filter(lambda x: x[10] != 1, curr))
688
+ missing_items = list(sorted(missing_items, key=lambda x: arrow.get(x[12])))
687
689
  if len(missing_items) == 0:
688
690
  log.debug(
689
691
  "Using last db date because,all downloads in db are marked as downloaded"
@@ -695,4 +697,4 @@ def get_after(model_id, username, forced_after=None):
695
697
  log.debug(
696
698
  f"Setting date slightly before earliest missing item\nbecause {len(missing_items)} messages in db are marked as undownloaded"
697
699
  )
698
- return arrow.get(missing_items[0][-1]).float_timestamp - 1000
700
+ return arrow.get(missing_items[0][12]).float_timestamp - 1000
@@ -101,11 +101,15 @@ async def get_paid_posts(model_id, username, c=None):
101
101
  sem = sems.get_req_sem()
102
102
  responseArray = []
103
103
  tasks = []
104
+ job_progress = None
105
+ page_count = 0
104
106
 
105
107
  # async with c or sessionbuilder.sessionBuilder(
106
108
  # limit=constants.getattr("API_MAX_CONNECTION")
107
109
  # ) as c:
108
- tasks.append(asyncio.create_task(scrape_paid(c, username, job_progress=None)))
110
+ tasks.append(
111
+ asyncio.create_task(scrape_paid(c, username, job_progress=job_progress))
112
+ )
109
113
  while bool(tasks):
110
114
  new_tasks = []
111
115
  try:
@@ -247,25 +251,20 @@ async def scrape_paid(c, username, job_progress=None, offset=0):
247
251
  @run
248
252
  async def get_all_paid_posts():
249
253
  global sem
250
- sem = semaphoreDelayed(constants.getattr("MAX_SEMAPHORE"))
254
+ sem = sems.get_req_sem()
251
255
  with ThreadPoolExecutor(
252
256
  max_workers=constants.getattr("MAX_REQUEST_WORKERS")
253
257
  ) as executor:
254
258
  asyncio.get_event_loop().set_default_executor(executor)
255
- overall_progress = Progress(
256
- SpinnerColumn(style=Style(color="blue")),
257
- TextColumn("Getting all paid media...\n{task.description}"),
258
- )
259
- job_progress = Progress("{task.description}")
260
- progress_group = Group(overall_progress, Panel(Group(job_progress)))
261
259
 
262
260
  output = []
263
261
  min_posts = 100
264
262
  tasks = []
265
263
  page_count = 0
266
- with Live(
267
- progress_group, refresh_per_second=5, console=console.get_shared_console()
268
- ):
264
+ with progress_utils.setup_all_paid_live():
265
+ job_progress = progress_utils.all_paid_progress
266
+ overall_progress = progress_utils.overall_progress
267
+
269
268
  async with sessionbuilder.sessionBuilder() as c:
270
269
  allpaid = cache.get(f"purchased_all", default=[])
271
270
  log.debug(f"[bold]All Paid Cache[/bold] {len(allpaid)} found")
@@ -49,7 +49,7 @@ async def get_pinned_post(model_id, c=None):
49
49
  scrape_pinned_posts(
50
50
  c,
51
51
  model_id,
52
- job_progress,
52
+ job_progress=job_progress,
53
53
  timestamp=read_args.retriveArgs().after.float_timestamp
54
54
  if read_args.retriveArgs().after
55
55
  else None,
@@ -102,7 +102,9 @@ async def get_pinned_post(model_id, c=None):
102
102
  return list(outdict.values())
103
103
 
104
104
 
105
- async def scrape_pinned_posts(c, model_id, progress, timestamp=None, count=0) -> list:
105
+ async def scrape_pinned_posts(
106
+ c, model_id, job_progress=None, timestamp=None, count=0
107
+ ) -> list:
106
108
  global sem
107
109
  sem = semaphoreDelayed(constants.getattr("AlT_SEM"))
108
110
  posts = None
@@ -131,7 +133,7 @@ async def scrape_pinned_posts(c, model_id, progress, timestamp=None, count=0) ->
131
133
  await asyncio.sleep(1)
132
134
  try:
133
135
  attempt.set(attempt.get(0) + 1)
134
- task = progress.add_task(
136
+ task = job_progress.add_task(
135
137
  f"Attempt {attempt.get()}/{constants.getattr('NUM_TRIES')}: Timestamp -> {arrow.get(math.trunc(float(timestamp))) if timestamp!=None else 'initial'}",
136
138
  visible=True,
137
139
  )
@@ -184,7 +186,7 @@ async def scrape_pinned_posts(c, model_id, progress, timestamp=None, count=0) ->
184
186
  scrape_pinned_posts(
185
187
  c,
186
188
  model_id,
187
- progress,
189
+ job_progress=job_progress,
188
190
  timestamp=posts[-1]["postedAtPrecise"],
189
191
  count=count + len(posts),
190
192
  )
@@ -205,5 +207,5 @@ async def scrape_pinned_posts(c, model_id, progress, timestamp=None, count=0) ->
205
207
 
206
208
  finally:
207
209
  sem.release()
208
- progress.remove_task(task)
210
+ job_progress.remove_task(task)
209
211
  return posts, new_tasks
@@ -43,13 +43,13 @@ async def get_subscription(accounts=None):
43
43
 
44
44
  with Progress(
45
45
  SpinnerColumn(style=Style(color="blue")), TextColumn("{task.description}")
46
- ) as progress:
47
- task1 = progress.add_task(
46
+ ) as job_progress:
47
+ task1 = job_progress.add_task(
48
48
  f"Getting the following accounts => {accounts} (this may take awhile)..."
49
49
  )
50
50
  async with sessionbuilder.sessionBuilder() as c:
51
51
  out = await get_subscription_helper(c, accounts)
52
- progress.remove_task(task1)
52
+ job_progress.remove_task(task1)
53
53
  outdict = {}
54
54
  for ele in filter(lambda x: x["username"] != "modeldeleted", out):
55
55
  outdict[ele["id"]] = ele
@@ -51,8 +51,8 @@ async def get_subscriptions(subscribe_count, account="active"):
51
51
 
52
52
  with Progress(
53
53
  SpinnerColumn(style=Style(color="blue")), TextColumn("{task.description}")
54
- ) as progress:
55
- task1 = progress.add_task(
54
+ ) as job_progress:
55
+ task1 = job_progress.add_task(
56
56
  f"Getting your {account} subscriptions (this may take awhile)..."
57
57
  )
58
58
  async with sessionbuilder.sessionBuilder() as c:
@@ -60,7 +60,7 @@ async def get_subscriptions(subscribe_count, account="active"):
60
60
  out = await activeHelper(subscribe_count, c)
61
61
  else:
62
62
  out = await expiredHelper(subscribe_count, c)
63
- progress.remove_task(task1)
63
+ job_progress.remove_task(task1)
64
64
  outdict = {}
65
65
  for ele in out:
66
66
  outdict[ele["id"]] = ele