ofscraper-community 3.16.2__py3-none-any.whl

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 (370) hide show
  1. ofscraper/__main__.py +9 -0
  2. ofscraper/__version__.py +13 -0
  3. ofscraper/classes/labels.py +40 -0
  4. ofscraper/classes/of/base.py +54 -0
  5. ofscraper/classes/of/media.py +742 -0
  6. ofscraper/classes/of/models.py +230 -0
  7. ofscraper/classes/of/posts.py +347 -0
  8. ofscraper/classes/placeholder.py +556 -0
  9. ofscraper/classes/table/app.py +854 -0
  10. ofscraper/classes/table/compose.py +188 -0
  11. ofscraper/classes/table/const.py +1 -0
  12. ofscraper/classes/table/css.py +178 -0
  13. ofscraper/classes/table/fields/boolfield.py +36 -0
  14. ofscraper/classes/table/fields/datefield.py +94 -0
  15. ofscraper/classes/table/fields/downloadfield.py +65 -0
  16. ofscraper/classes/table/fields/mediafield.py +60 -0
  17. ofscraper/classes/table/fields/numfield.py +60 -0
  18. ofscraper/classes/table/fields/pricefield.py +47 -0
  19. ofscraper/classes/table/fields/responsefield.py +100 -0
  20. ofscraper/classes/table/fields/selectfield.py +69 -0
  21. ofscraper/classes/table/fields/sizefield.py +32 -0
  22. ofscraper/classes/table/fields/textsearch.py +45 -0
  23. ofscraper/classes/table/fields/timefield.py +129 -0
  24. ofscraper/classes/table/inputs/filterinput.py +16 -0
  25. ofscraper/classes/table/inputs/intergerinput.py +13 -0
  26. ofscraper/classes/table/inputs/strinput.py +10 -0
  27. ofscraper/classes/table/sections/sidebar.py +10 -0
  28. ofscraper/classes/table/sections/table.py +139 -0
  29. ofscraper/classes/table/sections/table_console.py +6 -0
  30. ofscraper/classes/table/utils/lock.py +2 -0
  31. ofscraper/classes/table/utils/names.py +30 -0
  32. ofscraper/commands/check.py +874 -0
  33. ofscraper/commands/db.py +370 -0
  34. ofscraper/commands/manual.py +322 -0
  35. ofscraper/commands/metadata/consumer.py +93 -0
  36. ofscraper/commands/metadata/desc.py +1 -0
  37. ofscraper/commands/metadata/manager.py +228 -0
  38. ofscraper/commands/metadata/metadata.py +295 -0
  39. ofscraper/commands/recover_collisions.py +156 -0
  40. ofscraper/commands/scraper/actions/download/download.py +147 -0
  41. ofscraper/commands/scraper/actions/download/managers/alt_download.py +580 -0
  42. ofscraper/commands/scraper/actions/download/managers/downloadmanager.py +283 -0
  43. ofscraper/commands/scraper/actions/download/managers/fansly_stream_download.py +311 -0
  44. ofscraper/commands/scraper/actions/download/managers/main_download.py +427 -0
  45. ofscraper/commands/scraper/actions/download/run.py +140 -0
  46. ofscraper/commands/scraper/actions/download/utils/chunk.py +29 -0
  47. ofscraper/commands/scraper/actions/download/utils/desc.py +1 -0
  48. ofscraper/commands/scraper/actions/download/utils/keyhelpers.py +242 -0
  49. ofscraper/commands/scraper/actions/download/utils/leaky.py +20 -0
  50. ofscraper/commands/scraper/actions/download/utils/retries.py +40 -0
  51. ofscraper/commands/scraper/actions/download/utils/text.py +32 -0
  52. ofscraper/commands/scraper/actions/like/like.py +180 -0
  53. ofscraper/commands/scraper/actions/utils/buffer.py +0 -0
  54. ofscraper/commands/scraper/actions/utils/chunk.py +14 -0
  55. ofscraper/commands/scraper/actions/utils/general.py +51 -0
  56. ofscraper/commands/scraper/actions/utils/globals.py +80 -0
  57. ofscraper/commands/scraper/actions/utils/log.py +64 -0
  58. ofscraper/commands/scraper/actions/utils/params.py +14 -0
  59. ofscraper/commands/scraper/actions/utils/paths.py +252 -0
  60. ofscraper/commands/scraper/actions/utils/progress/convert.py +14 -0
  61. ofscraper/commands/scraper/actions/utils/progress/update.py +6 -0
  62. ofscraper/commands/scraper/actions/utils/retries.py +31 -0
  63. ofscraper/commands/scraper/actions/utils/threads.py +52 -0
  64. ofscraper/commands/scraper/actions/utils/workers.py +8 -0
  65. ofscraper/commands/scraper/scraper.py +326 -0
  66. ofscraper/commands/scraper/utils/daemon.py +0 -0
  67. ofscraper/commands/scraper/utils/jobqueue.py +2 -0
  68. ofscraper/commands/scraper/utils/prepare.py +59 -0
  69. ofscraper/commands/scraper/utils/print.py +4 -0
  70. ofscraper/commands/scraper/utils/schedule.py +86 -0
  71. ofscraper/commands/utils/command.py +142 -0
  72. ofscraper/commands/utils/scrape_context.py +42 -0
  73. ofscraper/commands/utils/strings.py +25 -0
  74. ofscraper/data/api/archive.py +362 -0
  75. ofscraper/data/api/common/after.py +26 -0
  76. ofscraper/data/api/common/cache/read.py +20 -0
  77. ofscraper/data/api/common/cache/write.py +40 -0
  78. ofscraper/data/api/common/check.py +27 -0
  79. ofscraper/data/api/common/logs/logs.py +44 -0
  80. ofscraper/data/api/common/logs/strings.py +14 -0
  81. ofscraper/data/api/common/old.py +36 -0
  82. ofscraper/data/api/common/page.py +38 -0
  83. ofscraper/data/api/common/timeline.py +39 -0
  84. ofscraper/data/api/highlights.py +311 -0
  85. ofscraper/data/api/init.py +99 -0
  86. ofscraper/data/api/labels.py +464 -0
  87. ofscraper/data/api/me.py +82 -0
  88. ofscraper/data/api/messages.py +430 -0
  89. ofscraper/data/api/paid.py +318 -0
  90. ofscraper/data/api/pinned.py +149 -0
  91. ofscraper/data/api/profile.py +173 -0
  92. ofscraper/data/api/streams.py +355 -0
  93. ofscraper/data/api/subscriptions/common.py +48 -0
  94. ofscraper/data/api/subscriptions/individual.py +81 -0
  95. ofscraper/data/api/subscriptions/lists.py +272 -0
  96. ofscraper/data/api/subscriptions/subscriptions.py +237 -0
  97. ofscraper/data/api/tasks.py +67 -0
  98. ofscraper/data/api/timeline.py +411 -0
  99. ofscraper/data/models/utils/retriver.py +117 -0
  100. ofscraper/data/posts/post.py +660 -0
  101. ofscraper/data/posts/scrape_paid.py +141 -0
  102. ofscraper/db/__init__.py +1 -0
  103. ofscraper/db/backup.py +103 -0
  104. ofscraper/db/difference.py +37 -0
  105. ofscraper/db/merge.py +358 -0
  106. ofscraper/db/operations.py +105 -0
  107. ofscraper/db/operations_/empty.py +62 -0
  108. ofscraper/db/operations_/labels.py +253 -0
  109. ofscraper/db/operations_/media.py +801 -0
  110. ofscraper/db/operations_/messages.py +308 -0
  111. ofscraper/db/operations_/others.py +312 -0
  112. ofscraper/db/operations_/posts.py +456 -0
  113. ofscraper/db/operations_/profile.py +219 -0
  114. ofscraper/db/operations_/stories.py +227 -0
  115. ofscraper/db/operations_/wrapper.py +131 -0
  116. ofscraper/db/transition.py +280 -0
  117. ofscraper/db/utils/convert.py +7 -0
  118. ofscraper/db/utils/rebuild.py +55 -0
  119. ofscraper/filters/media/filters.py +352 -0
  120. ofscraper/filters/models/date.py +88 -0
  121. ofscraper/filters/models/flags.py +76 -0
  122. ofscraper/filters/models/other.py +35 -0
  123. ofscraper/filters/models/price.py +185 -0
  124. ofscraper/filters/models/sort.py +55 -0
  125. ofscraper/filters/models/subtype.py +31 -0
  126. ofscraper/filters/models/utils/logs.py +13 -0
  127. ofscraper/main/close/exit.py +34 -0
  128. ofscraper/main/close/final/final.py +23 -0
  129. ofscraper/main/close/final/final_log.py +43 -0
  130. ofscraper/main/open/load.py +62 -0
  131. ofscraper/main/open/run.py +32 -0
  132. ofscraper/managers/manager.py +135 -0
  133. ofscraper/managers/model.py +580 -0
  134. ofscraper/managers/postcollection.py +330 -0
  135. ofscraper/managers/profile.py +129 -0
  136. ofscraper/managers/sessionHandler.py +60 -0
  137. ofscraper/managers/sessionmanager/cert.py +152 -0
  138. ofscraper/managers/sessionmanager/ofsession.py +316 -0
  139. ofscraper/managers/sessionmanager/sessionmanager.py +772 -0
  140. ofscraper/managers/sessionmanager/sleepers.py +127 -0
  141. ofscraper/managers/stats.py +588 -0
  142. ofscraper/managers/utils/state.py +275 -0
  143. ofscraper/prompts/keybindings.py +38 -0
  144. ofscraper/prompts/promptConvert.py +272 -0
  145. ofscraper/prompts/prompt_groups/actions.py +41 -0
  146. ofscraper/prompts/prompt_groups/area.py +301 -0
  147. ofscraper/prompts/prompt_groups/auth.py +275 -0
  148. ofscraper/prompts/prompt_groups/config.py +854 -0
  149. ofscraper/prompts/prompt_groups/menu.py +46 -0
  150. ofscraper/prompts/prompt_groups/merge.py +129 -0
  151. ofscraper/prompts/prompt_groups/misc.py +18 -0
  152. ofscraper/prompts/prompt_groups/model.py +451 -0
  153. ofscraper/prompts/prompt_groups/profile.py +141 -0
  154. ofscraper/prompts/prompt_strings.py +273 -0
  155. ofscraper/prompts/prompt_validators.py +362 -0
  156. ofscraper/prompts/prompts.py +22 -0
  157. ofscraper/prompts/utils/model_helpers.py +85 -0
  158. ofscraper/prompts/utils/prompt_helpers.py +284 -0
  159. ofscraper/scripts/after_download_action_script.py +105 -0
  160. ofscraper/scripts/after_download_script.py +73 -0
  161. ofscraper/scripts/after_like_action_script.py +101 -0
  162. ofscraper/scripts/final_script.py +85 -0
  163. ofscraper/scripts/naming_script.py +101 -0
  164. ofscraper/scripts/skip_download_script.py +95 -0
  165. ofscraper/sites/__init__.py +88 -0
  166. ofscraper/sites/fansly/__init__.py +0 -0
  167. ofscraper/sites/fansly/api.py +208 -0
  168. ofscraper/sites/fansly/auth.py +200 -0
  169. ofscraper/sites/fansly/constants.py +27 -0
  170. ofscraper/sites/fansly/headers.py +58 -0
  171. ofscraper/sites/fansly/live.py +702 -0
  172. ofscraper/sites/fansly/live_api.py +73 -0
  173. ofscraper/sites/fansly/live_chat.py +174 -0
  174. ofscraper/sites/fansly/me.py +73 -0
  175. ofscraper/sites/fansly/normalize.py +355 -0
  176. ofscraper/sites/fansly/scrape.py +83 -0
  177. ofscraper/sites/fansly/signing.py +60 -0
  178. ofscraper/sites/fansly/video.py +346 -0
  179. ofscraper/utils/__init__.py +1 -0
  180. ofscraper/utils/actions.py +129 -0
  181. ofscraper/utils/ads.py +2 -0
  182. ofscraper/utils/args/accessors/actions.py +0 -0
  183. ofscraper/utils/args/accessors/areas.py +72 -0
  184. ofscraper/utils/args/accessors/output.py +9 -0
  185. ofscraper/utils/args/accessors/quality.py +22 -0
  186. ofscraper/utils/args/accessors/read.py +18 -0
  187. ofscraper/utils/args/accessors/time.py +53 -0
  188. ofscraper/utils/args/callbacks/arguments/post.py +6 -0
  189. ofscraper/utils/args/callbacks/arguments/username.py +9 -0
  190. ofscraper/utils/args/callbacks/parse/choice.py +14 -0
  191. ofscraper/utils/args/callbacks/parse/file.py +22 -0
  192. ofscraper/utils/args/callbacks/parse/string.py +38 -0
  193. ofscraper/utils/args/callbacks/parse/username.py +6 -0
  194. ofscraper/utils/args/globals.py +1 -0
  195. ofscraper/utils/args/helpers/hide_args.py +15 -0
  196. ofscraper/utils/args/main.py +70 -0
  197. ofscraper/utils/args/mutators/before.py +11 -0
  198. ofscraper/utils/args/mutators/user.py +29 -0
  199. ofscraper/utils/args/mutators/write.py +10 -0
  200. ofscraper/utils/args/parse/arguments/advanced_processing.py +33 -0
  201. ofscraper/utils/args/parse/arguments/advanced_program.py +73 -0
  202. ofscraper/utils/args/parse/arguments/advanced_user_filter.py +129 -0
  203. ofscraper/utils/args/parse/arguments/automatic.py +68 -0
  204. ofscraper/utils/args/parse/arguments/check.py +133 -0
  205. ofscraper/utils/args/parse/arguments/download.py +48 -0
  206. ofscraper/utils/args/parse/arguments/file.py +25 -0
  207. ofscraper/utils/args/parse/arguments/logging.py +50 -0
  208. ofscraper/utils/args/parse/arguments/media_content.py +166 -0
  209. ofscraper/utils/args/parse/arguments/metadata_filters.py +90 -0
  210. ofscraper/utils/args/parse/arguments/post_content.py +346 -0
  211. ofscraper/utils/args/parse/arguments/program.py +48 -0
  212. ofscraper/utils/args/parse/arguments/scripts.py +53 -0
  213. ofscraper/utils/args/parse/arguments/shared.py +1 -0
  214. ofscraper/utils/args/parse/arguments/user_list.py +120 -0
  215. ofscraper/utils/args/parse/arguments/user_select.py +81 -0
  216. ofscraper/utils/args/parse/arguments/user_sort.py +30 -0
  217. ofscraper/utils/args/parse/arguments/utils/date.py +13 -0
  218. ofscraper/utils/args/parse/arguments/utils/retry.py +22 -0
  219. ofscraper/utils/args/parse/commands/db.py +13 -0
  220. ofscraper/utils/args/parse/commands/main.py +19 -0
  221. ofscraper/utils/args/parse/commands/manual.py +9 -0
  222. ofscraper/utils/args/parse/commands/message.py +9 -0
  223. ofscraper/utils/args/parse/commands/metadata.py +11 -0
  224. ofscraper/utils/args/parse/commands/paid.py +9 -0
  225. ofscraper/utils/args/parse/commands/post.py +10 -0
  226. ofscraper/utils/args/parse/commands/story.py +9 -0
  227. ofscraper/utils/args/parse/group_bundles/advanced_common.py +17 -0
  228. ofscraper/utils/args/parse/group_bundles/check.py +89 -0
  229. ofscraper/utils/args/parse/group_bundles/common.py +23 -0
  230. ofscraper/utils/args/parse/group_bundles/db.py +111 -0
  231. ofscraper/utils/args/parse/group_bundles/main.py +35 -0
  232. ofscraper/utils/args/parse/group_bundles/manual.py +26 -0
  233. ofscraper/utils/args/parse/group_bundles/message_check.py +33 -0
  234. ofscraper/utils/args/parse/group_bundles/metadata.py +155 -0
  235. ofscraper/utils/args/parse/group_bundles/paid_check.py +32 -0
  236. ofscraper/utils/args/parse/group_bundles/post_check.py +33 -0
  237. ofscraper/utils/args/parse/group_bundles/story_check.py +35 -0
  238. ofscraper/utils/args/parse/group_bundles/utils/check.py +16 -0
  239. ofscraper/utils/args/parse/groups/advanced_processing.py +17 -0
  240. ofscraper/utils/args/parse/groups/advanced_program.py +29 -0
  241. ofscraper/utils/args/parse/groups/advanced_user_filter.py +43 -0
  242. ofscraper/utils/args/parse/groups/automatic.py +31 -0
  243. ofscraper/utils/args/parse/groups/check_content.py +28 -0
  244. ofscraper/utils/args/parse/groups/download.py +22 -0
  245. ofscraper/utils/args/parse/groups/file.py +26 -0
  246. ofscraper/utils/args/parse/groups/logging.py +24 -0
  247. ofscraper/utils/args/parse/groups/media_filter.py +47 -0
  248. ofscraper/utils/args/parse/groups/post_filter.py +49 -0
  249. ofscraper/utils/args/parse/groups/program.py +25 -0
  250. ofscraper/utils/args/parse/groups/scripts.py +23 -0
  251. ofscraper/utils/args/parse/groups/user_list.py +35 -0
  252. ofscraper/utils/args/parse/groups/user_select.py +26 -0
  253. ofscraper/utils/args/parse/groups/user_sort.py +16 -0
  254. ofscraper/utils/args/types/arrow.py +49 -0
  255. ofscraper/utils/args/types/choice.py +139 -0
  256. ofscraper/utils/async_cached_property.py +66 -0
  257. ofscraper/utils/auth/data.py +67 -0
  258. ofscraper/utils/auth/file.py +113 -0
  259. ofscraper/utils/auth/make.py +59 -0
  260. ofscraper/utils/auth/request.py +370 -0
  261. ofscraper/utils/auth/schema.py +34 -0
  262. ofscraper/utils/auth/utils/dict.py +43 -0
  263. ofscraper/utils/auth/utils/error.py +77 -0
  264. ofscraper/utils/auth/utils/prompt.py +42 -0
  265. ofscraper/utils/auth/utils/warning/check.py +7 -0
  266. ofscraper/utils/auth/utils/warning/print.py +39 -0
  267. ofscraper/utils/auth/utils/warning/warning.py +14 -0
  268. ofscraper/utils/cache/cache.py +82 -0
  269. ofscraper/utils/cache/profile.py +32 -0
  270. ofscraper/utils/checkers.py +46 -0
  271. ofscraper/utils/config/config.py +61 -0
  272. ofscraper/utils/config/data.py +738 -0
  273. ofscraper/utils/config/file.py +86 -0
  274. ofscraper/utils/config/menu.py +89 -0
  275. ofscraper/utils/config/schema.py +124 -0
  276. ofscraper/utils/config/utils/context.py +43 -0
  277. ofscraper/utils/config/utils/wrapper.py +16 -0
  278. ofscraper/utils/console.py +88 -0
  279. ofscraper/utils/const.py +34 -0
  280. ofscraper/utils/context/exit.py +113 -0
  281. ofscraper/utils/context/run_async.py +73 -0
  282. ofscraper/utils/context/stdout.py +30 -0
  283. ofscraper/utils/dates.py +107 -0
  284. ofscraper/utils/encoding.py +18 -0
  285. ofscraper/utils/hash.py +58 -0
  286. ofscraper/utils/live/classes/progress.py +109 -0
  287. ofscraper/utils/live/classes/task.py +53 -0
  288. ofscraper/utils/live/classes/transfercol.py +41 -0
  289. ofscraper/utils/live/clear.py +109 -0
  290. ofscraper/utils/live/empty.py +21 -0
  291. ofscraper/utils/live/groups.py +86 -0
  292. ofscraper/utils/live/live.py +39 -0
  293. ofscraper/utils/live/panel.py +5 -0
  294. ofscraper/utils/live/progress.py +106 -0
  295. ofscraper/utils/live/screens.py +284 -0
  296. ofscraper/utils/live/tasks.py +47 -0
  297. ofscraper/utils/live/updater.py +109 -0
  298. ofscraper/utils/logs/classes/classes.py +132 -0
  299. ofscraper/utils/logs/classes/handlers/discord.py +133 -0
  300. ofscraper/utils/logs/classes/handlers/text.py +23 -0
  301. ofscraper/utils/logs/close.py +32 -0
  302. ofscraper/utils/logs/logger.py +49 -0
  303. ofscraper/utils/logs/logs.py +132 -0
  304. ofscraper/utils/logs/other.py +56 -0
  305. ofscraper/utils/logs/stdout.py +51 -0
  306. ofscraper/utils/logs/utils/level.py +68 -0
  307. ofscraper/utils/logs/utils/sensitive.py +62 -0
  308. ofscraper/utils/logs/utils/trace.py +9 -0
  309. ofscraper/utils/markup.py +14 -0
  310. ofscraper/utils/me.py +25 -0
  311. ofscraper/utils/menu.py +140 -0
  312. ofscraper/utils/merge.py +44 -0
  313. ofscraper/utils/of_env/__init__.py +124 -0
  314. ofscraper/utils/of_env/load.py +97 -0
  315. ofscraper/utils/of_env/of_env.py +98 -0
  316. ofscraper/utils/of_env/values/action/download.py +126 -0
  317. ofscraper/utils/of_env/values/action/like.py +36 -0
  318. ofscraper/utils/of_env/values/action/metadata.py +31 -0
  319. ofscraper/utils/of_env/values/date.py +22 -0
  320. ofscraper/utils/of_env/values/dynamic.py +49 -0
  321. ofscraper/utils/of_env/values/general.py +122 -0
  322. ofscraper/utils/of_env/values/list.py +50 -0
  323. ofscraper/utils/of_env/values/live.py +56 -0
  324. ofscraper/utils/of_env/values/logger.py +30 -0
  325. ofscraper/utils/of_env/values/main.py +344 -0
  326. ofscraper/utils/of_env/values/path/bytes.py +38 -0
  327. ofscraper/utils/of_env/values/path/files.py +44 -0
  328. ofscraper/utils/of_env/values/path/general.py +34 -0
  329. ofscraper/utils/of_env/values/path/length.py +38 -0
  330. ofscraper/utils/of_env/values/prompts.py +87 -0
  331. ofscraper/utils/of_env/values/req/anon.py +21 -0
  332. ofscraper/utils/of_env/values/req/api.py +110 -0
  333. ofscraper/utils/of_env/values/req/auth.py +10 -0
  334. ofscraper/utils/of_env/values/req/cdm.py +42 -0
  335. ofscraper/utils/of_env/values/req/discord.py +42 -0
  336. ofscraper/utils/of_env/values/req/git.py +26 -0
  337. ofscraper/utils/of_env/values/req/mpd.py +57 -0
  338. ofscraper/utils/of_env/values/req/ratelimit.py +329 -0
  339. ofscraper/utils/of_env/values/req/req.py +209 -0
  340. ofscraper/utils/of_env/values/system.py +53 -0
  341. ofscraper/utils/of_env/values/test/test_constants.py +7355 -0
  342. ofscraper/utils/of_env/values/time.py +71 -0
  343. ofscraper/utils/of_env/values/url/dynamic.py +61 -0
  344. ofscraper/utils/of_env/values/url/other_url.py +33 -0
  345. ofscraper/utils/of_env/values/url/url.py +254 -0
  346. ofscraper/utils/paths/common.py +131 -0
  347. ofscraper/utils/paths/db.py +18 -0
  348. ofscraper/utils/paths/manage.py +89 -0
  349. ofscraper/utils/paths/paths.py +217 -0
  350. ofscraper/utils/profiles/data.py +50 -0
  351. ofscraper/utils/profiles/manage.py +77 -0
  352. ofscraper/utils/profiles/tools.py +49 -0
  353. ofscraper/utils/sems.py +1 -0
  354. ofscraper/utils/separate.py +36 -0
  355. ofscraper/utils/settings.py +257 -0
  356. ofscraper/utils/string.py +62 -0
  357. ofscraper/utils/system/ffmpeg.py +180 -0
  358. ofscraper/utils/system/ffprobe.py +124 -0
  359. ofscraper/utils/system/free.py +25 -0
  360. ofscraper/utils/system/network.py +71 -0
  361. ofscraper/utils/system/priority.py +19 -0
  362. ofscraper/utils/system/speed.py +51 -0
  363. ofscraper/utils/system/subprocess.py +195 -0
  364. ofscraper/utils/system/system.py +62 -0
  365. ofscraper/utils/text.py +69 -0
  366. ofscraper_community-3.16.2.dist-info/METADATA +245 -0
  367. ofscraper_community-3.16.2.dist-info/RECORD +370 -0
  368. ofscraper_community-3.16.2.dist-info/WHEEL +4 -0
  369. ofscraper_community-3.16.2.dist-info/entry_points.txt +2 -0
  370. ofscraper_community-3.16.2.dist-info/licenses/LICENSE +21 -0
ofscraper/__main__.py ADDED
@@ -0,0 +1,9 @@
1
+ import ofscraper.main.open.load as load
2
+
3
+
4
+ def main():
5
+ load.main()
6
+
7
+
8
+ if __name__ == "__main__":
9
+ main()
@@ -0,0 +1,13 @@
1
+ from __future__ import annotations
2
+ import importlib.metadata
3
+
4
+ # The version is now read from the installed package's metadata
5
+ try:
6
+ # The distribution is published as 'ofscraper-community'; the import
7
+ # package and the command are still 'ofscraper'. Keep the name a literal:
8
+ # PyInstaller looks for it to bundle the metadata into the binaries.
9
+ __version__ = importlib.metadata.version("ofscraper-community")
10
+ except importlib.metadata.PackageNotFoundError:
11
+ # This is a fallback for cases where the package is not installed at all,
12
+ # or you are in a situation where metadata is not available.
13
+ __version__ = "0.0.0" # A sensible fallback
@@ -0,0 +1,40 @@
1
+ import ofscraper.classes.of.posts as posts_
2
+
3
+
4
+ class Label:
5
+ def __init__(self, label, model_id, username):
6
+ self._label_id = label.get("id")
7
+ self._name = label.get("name")
8
+ self._type = label.get("type")
9
+ self._posts = list(
10
+ map(
11
+ lambda x: posts_.Post(x, model_id, username, label=self._name),
12
+ label.get("posts"),
13
+ )
14
+ )
15
+ self._model_id = int(model_id)
16
+ self._username = username
17
+
18
+ @property
19
+ def model_id(self):
20
+ return self._model_id
21
+
22
+ @property
23
+ def username(self):
24
+ return self._username
25
+
26
+ @property
27
+ def label_id(self):
28
+ return self._label_id
29
+
30
+ @property
31
+ def name(self):
32
+ return self._name
33
+
34
+ @property
35
+ def type(self):
36
+ return self._type
37
+
38
+ @property
39
+ def posts(self):
40
+ return self._posts
@@ -0,0 +1,54 @@
1
+ import importlib
2
+ import re
3
+
4
+ from bs4 import BeautifulSoup
5
+
6
+ import ofscraper.utils.settings as settings
7
+
8
+ html_parser = "lxml" if importlib.util.find_spec("lxml") else "html.parser"
9
+
10
+
11
+ class base:
12
+ def __init__(self):
13
+ None
14
+
15
+ def text_trunicate(self, text):
16
+ text = str(text)
17
+ if text is None:
18
+ return "None"
19
+ if len(text) == 0:
20
+ return text
21
+ length = int(settings.get_settings().text_length)
22
+ if length == 0:
23
+ return text
24
+ elif settings.get_settings().text_type == "letter":
25
+ return f"{''.join(list(text)[:length])}"
26
+ else:
27
+ # text has usually been through file_cleanup already, which swaps
28
+ # spaces for space_replacer, so words are split on that. If the
29
+ # original text already contained that character (e.g. "_" in a
30
+ # caption with "_" as the replacer), it also counts as a word
31
+ # break; the original spaces can't be told apart at this point.
32
+ sep = settings.get_settings().space_replacer or " "
33
+ if sep not in text:
34
+ sep = " "
35
+ words = [x for x in text.split(sep) if x]
36
+ text = sep.join(words[:length])
37
+ text = re.sub(" +$", "", text)
38
+ return text
39
+
40
+ def file_cleanup(self, text):
41
+ text = str(text)
42
+ text = re.sub("<[^>]*>", "", text)
43
+ text = re.sub(r'[\n<>:"/\|?*:;]+', "", text)
44
+ text = re.sub("-+", "_", text)
45
+ text = re.sub(" +", " ", text)
46
+ text = re.sub(" ", settings.get_settings().space_replacer, text)
47
+ return text
48
+
49
+ def db_cleanup(self, string):
50
+ string = string or ""
51
+ string = re.sub("<[^>]*>", "", string)
52
+ string = " ".join(string.split())
53
+ string = BeautifulSoup(string, html_parser).get_text()
54
+ return string