Coder Social home page Coder Social logo

shreddit's Introduction

shreddit

Crates.io

shreddit is a tool to delete Reddit comments and posts.

Deactivating a Reddit account will not delete comments or submissions - it will only disassociate your account from them.

Shreddit overwrites your comments with random text before deleting them to ensure that the originals are (probably) not preserved.

If you don't want your post history to follow you around forever, you can use shreddit on a cron job.

If you're deactivating your account, you can run shreddit first to ensure your posts are deleted.

About

Because the original Shreddit project was abandoned in 2017, I decided to rewrite it in Rust.

This brings several benefits:

  • You don't need to have Python or anything else installed.
  • Instead of having shreddit.yml and praw.ini config files, all configuration can be done through CLI commands with environment variables as default fallbacks.

Installation

Manual

Download the binary from the GitHub Releases page.

Cargo

cargo install shreddit

How to use

Create Reddit app credentials

  1. Navigate to Reddit -> preferences -> apps (tab) and click create another app...
  2. Give the app a name, like 'shreddit`. The name doesn't matter.
  3. Select script.
  4. Set the redirect URL to be http://localhost:8080.
  5. Click create app.

This will provide with a client ID and client secret. The CLIENT_ID value used by Shreddit is shown under the name of the app you created. The CLIENT_SECRET is shown after clicking edit.

IMPORTANT: If you are using TOTP, you will need to pass it in via the PASSWORD settings like PASSWORD:TOTP. It's currently a bit awkward to do since you need to do so before the token expires, so in the future we can add a CLI prompt to make this easier. In the meantime, you can just use the --password CLI argument, fill in --password your-password: and paste the TOTP after that and hit enter.

Overwrite and delete your Reddit account history.

Usage: shreddit [OPTIONS] --username <USERNAME> --password <PASSWORD> --client-id <CLIENT_ID> --client-secret <CLIENT_SECRET>

Options:
  -u, --username <USERNAME>
          Your Reddit username [env: SHREDDIT_USERNAME=]
  -p, --password <PASSWORD>
          Your Reddit password [env: SHREDDIT_PASSWORD=]
      --client-id <CLIENT_ID>
          To create client credentials, you need to navigate to `https://www.reddit.com/prefs/apps/`, click `create another app...` and fill out the form. Select the `script` type, and set `redirect uri` as `http://localhost:8080` [env: SHREDDIT_CLIENT_ID=]
      --client-secret <CLIENT_SECRET>
          The client secret from when you created client credentials [env: SHREDDIT_CLIENT_SECRET=]
      --dry-run
          If set, shreddit will not modify or delete anything. It will simply log what it would do if not in dry run mode. This allows you to preview the plan of action before executing [env: SHREDDIT_DRY_RUN=]
      --thing-types <THING_TYPES>
          What "things" you want to delete [env: SHREDDIT_THING_TYPES=] [default: posts comments] [possible values: posts, comments, friends, saved-posts, saved-comments]
      --before <BEFORE>
          [env: SHREDDIT_BEFORE=] [default: "2023-06-25 14:42:43.828192320 UTC"]
      --max-score <MAX_SCORE>
          [env: SHREDDIT_MAX_SCORE=]
  -r, --replacement-comment <REPLACEMENT_COMMENT>
          Allows a user to specify a custom string as their comment replacement text [env: SHREDDIT_REPLACEMENT_COMMENT=] [default: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."]
      --user-agent <USER_AGENT>
          The User-Agent for Reddit API requests [env: SHREDDIT_USER_AGENT=] [default: ShredditRustClient]
      --gdpr-export-dir <GDPR_EXPORT_DIR>
          The path of the directory of the unzipped GDPR export data. If set, `shreddit` will use the GDPR export folder instead of Reddit's APIs for discovering your data [env: SHREDDIT_GDPR_EXPORT_DIR=]
      --edit-only
          If specified, comments will only be edited, not deleted. - Requires gdpr_export [env: SHREDDIT_EDIT_ONLY=]
      --skip-subreddits <SKIP_SUBREDDITS>
          If specified, will skip these subreddits [env: SHREDDIT_SKIP_SUBREDDITS=] 
      --skip-comment-ids <SKIP_COMMENT_IDS>
          If specified, will skip comments and saved comments with listed ids [env: SHREDDIT_SKIP_COMMENT_IDS=]
      --skip-post-ids <SKIP_POST_IDS>
          If specified, will skip posts and saved posts with listed ids [env: SHREDDIT_SKIP_POST_IDS=]
  -h, --help
          Print help
  -V, --version
          Print version

You can choose to pass in configuration settings via CLI arguments like:

shreddit --username YouRedditUsername --password YourSuperSecretPassword123  --client-id k1jh2342k3j --client-secret 2345JHLJ_34kjhkj3h453453

or by setting them as environment variables (e.g. SHREDDIT_CLIENT_SECRET) and simply running shreddit.

On startup, shreddit looks for a shreddit.env file in the current directory and sets any variables declared there. However, this is purely optional.

Dry run

You can use --dry-run or SHREDDIT_DRY_RUN=true to see what it would do without it actually doing anything.

Delete ALL your data using GDPR export

  1. Request an archive of all your data by following these steps.
  2. Download the archive and extract it.
  3. Run shreddit with the --gdpr-export-dir flag set to the path of the directory it was extracted to.

Other features

These are the other features Python Shreddit had.

I'll be adding these as I go along. PRs are welcome!

  • Dry run - preview what would happen with given configuration.
  • Preserve comments made after a given datetime.
  • Max score - preserve comments with a score higher than this.
  • Comment sorting
  • Clear vote - Remove your votes before deleting.
  • Item - configure what kinds of items to delete (submissions, comments, etc.)
  • Subreddit whitelist - anything in given subreddits will not be deleted.
  • Whitelist IDs - preserve specific posts by listing their IDs.
  • Preserve distinguished - Don't deleted distinguished comments.
  • Preserve gilded - Don't deleted gilded comments.

Other feature ideas are welcome.

shreddit's People

Contributors

andrewbanchich avatar donoftime avatar rfbomb avatar staticrocket avatar vhscom avatar woodgun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

shreddit's Issues

Immediate crash when running the Windows binary

Running the latest binary release (0.7.0) results in an immediate crash. Here's the verbose stacktrace:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: reqwest::Error { kind: Decode, source: Error("data did not match any variant of untagged enum AccessTokenResponse", line: 0, column: 0) }', src\access_token.rs:22:10
stack backtrace:
   0:     0x7ff65e833ca0 - std::backtrace_rs::backtrace::dbghelp::trace::h0cbe98da16679aac
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\std\src\..\..\backtrace\src\backtrace/dbghelp.rs:98:5
   1:     0x7ff65e833ca0 - std::backtrace_rs::backtrace::trace_unsynchronized::hb434b45930b80e34
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\std\src\..\..\backtrace\src\backtrace/mod.rs:66:5
   2:     0x7ff65e833ca0 - std::sys_common::backtrace::_print_fmt::h96c3729db5e2a8a1
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\std\src\sys_common/backtrace.rs:65:5
   3:     0x7ff65e833ca0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hbf171bd7f0118a33
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\std\src\sys_common/backtrace.rs:44:22
   4:     0x7ff65e8944ab - core::fmt::write::hb22cdfc2fa5ec795
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\core\src\fmt/mod.rs:1208:17
   5:     0x7ff65e826445 - std::io::Write::write_fmt::head66d9b1394f42d
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\std\src\io/mod.rs:1682:15
   6:     0x7ff65e8339f4 - std::sys_common::backtrace::_print::heb838a6573dc6674
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\std\src\sys_common/backtrace.rs:47:5
   7:     0x7ff65e8339f4 - std::sys_common::backtrace::print::hf6ba081f1eb2c6e7
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\std\src\sys_common/backtrace.rs:34:9
   8:     0x7ff65e836cbf - std::panicking::default_hook::{{closure}}::h93ea785abbbe90bf
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\std\src/panicking.rs:267:22
   9:     0x7ff65e836993 - std::panicking::default_hook::h90332eef4943d9ce
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\std\src/panicking.rs:286:9
  10:     0x7ff65e837603 - std::panicking::rust_panic_with_hook::hf9b5b9ac2430bc03
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\std\src/panicking.rs:688:13
  11:     0x7ff65e837376 - std::panicking::begin_panic_handler::{{closure}}::he3e86f98d9b628f1
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\std\src/panicking.rs:579:13
  12:     0x7ff65e8347cf - std::sys_common::backtrace::__rust_end_short_backtrace::had7e7e5c444d2c2c
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\std\src\sys_common/backtrace.rs:137:18
  13:     0x7ff65e837080 - rust_begin_unwind
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\std\src/panicking.rs:575:5
  14:     0x7ff65e890cc5 - core::panicking::panic_fmt::h421bf8d6cb47d0bf
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\core\src/panicking.rs:64:14
  15:     0x7ff65e891296 - core::result::unwrap_failed::h7d46c234080deb8e
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\core\src/result.rs:1791:5
  16:     0x7ff65e36b567 - shreddit::main::{{closure}}::h1b55403d6eb7de88
  17:     0x7ff65e353341 - tokio::runtime::scheduler::current_thread::Context::enter::hf2fde053ce164ec9
  18:     0x7ff65e3742b0 - tokio::macros::scoped_tls::ScopedKey<T>::set::h542e1d00d3dab19d
  19:     0x7ff65e352fd9 - tokio::runtime::scheduler::current_thread::CurrentThread::block_on::h369e8cd262556650
  20:     0x7ff65e3896df - tokio::runtime::runtime::Runtime::block_on::h47aebc2d39d4d308
  21:     0x7ff65e31b4e0 - shreddit::main::h6250ab3fb126cda9
  22:     0x7ff65e300b26 - std::sys_common::backtrace::__rust_begin_short_backtrace::h7ea2dfc74adc8cc3
  23:     0x7ff65e31ff8c - std::rt::lang_start::{{closure}}::he82dffa03006e9e9
  24:     0x7ff65e8185e5 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h744a7898f6b57c9d
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\core\src\ops/function.rs:606:13
  25:     0x7ff65e8185e5 - std::panicking::try::do_call::hacef15c93887bb9b
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\std\src/panicking.rs:483:40
  26:     0x7ff65e8185e5 - std::panicking::try::h4c575fe78cd5baa2
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\std\src/panicking.rs:447:19
  27:     0x7ff65e8185e5 - std::panic::catch_unwind::h02c0d4967d414c4d
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\std\src/panic.rs:137:14
  28:     0x7ff65e8185e5 - std::rt::lang_start_internal::{{closure}}::h6de5ec9aa31df30b
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\std\src/rt.rs:148:48
  29:     0x7ff65e8185e5 - std::panicking::try::do_call::h2a585e8572d2bce7
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\std\src/panicking.rs:483:40
  30:     0x7ff65e8185e5 - std::panicking::try::hb6cd518eaad0a679
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\std\src/panicking.rs:447:19
  31:     0x7ff65e8185e5 - std::panic::catch_unwind::ha20eca80b62d7156
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\std\src/panic.rs:137:14
  32:     0x7ff65e8185e5 - std::rt::lang_start_internal::haf6dd254fb13f778
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library\std\src/rt.rs:148:20
  33:     0x7ff65e31b5ed - main
  34:     0x7ff65e2f1445 - __tmainCRTStartup
  35:     0x7ff65e2f1146 - mainCRTStartup
  36:     0x7ffa46e426bd - <unknown>
  37:     0x7ffa4806dfb8 - <unknown>

Error with numeric subreddits in GDPR mode

shreddit reliably chokes on parsing comments.csv when the subreddit field is all-numeric, e.g. for /r/404 or /r/2012. For example, if I change ...,technology,... to ...,2012,... in the first record of my comments.csv in the GDPR export, I get the following error:

  2023-07-08T21:34:11.153874Z  INFO  Shredding Comments...
    at src/main.rs:52

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(Deserialize { pos: Some(Position { byte: 63, line: 1, record: 1 }), err: DeserializeError { field: None, kind: Message("data did not match any variant of untagged enum Source") } })', src/sources/gdpr.rs:17:41
stack backtrace:
   0: rust_begin_unwind
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:578:5
   1: core::panicking::panic_fmt
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/panicking.rs:67:14
   2: core::result::unwrap_failed
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/result.rs:1687:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/result.rs:1089:23
   4: shreddit::sources::gdpr::list::{{closure}}
             at ./src/sources/gdpr.rs:17:39
   5: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ops/function.rs:310:13
...

Maybe the csv Reader is producing a numeric type when there's an all-numeric sequence, and then deserialize fails because the types don't match?

My current workaround is to remove the subreddit: String field from the Gdpr enum variant in comment.rs, as it's not currently used for anything. Removing the offending lines from the .csv should also work.

Remember last run for GDPR

When processing a GDPR archive, Shreddit should be able to remember where it left off and resume from there.

[BUG] Username not recognized when username begins with a dash

When entering this command (replaced with fake user, pass, client, and secret):

shreddit --dry-run --replacement-comment "oops" --before "2023-11-01 14:42:43.828192320 UTC" --username "-fakeUsername" --password "Fake*Password29538398257" --client-id 3P8B2cD2fMUl-GqK-3ukaaPQ --client-secret 3zso6CW7ZfsT83Faq2KmwNY3yeM_OaNw

It results in this error:

zsh: no matches found: Fake*Password29538398257

I added the quotes because I thought the dash at the start of my username would be a problem, and it was, I think. When removing the quotes, I get this error instead:

error: a value is required for '--username <USERNAME>' but none was supplied

For more information, try '--help'.

I've also included a * in my fake password, as my actual password also has one. Not sure if that's an issue here or not.

"error":403,"message":"Forbidden"

  ๏ฟฝ[2m2023-02-26T05:33:16.872246Z๏ฟฝ[0m ๏ฟฝ[32m INFO๏ฟฝ[0m  ๏ฟฝ[32mShredding Posts...๏ฟฝ[0m
    ๏ฟฝ[2;3mat๏ฟฝ[0m src\cli.rs:52

  ๏ฟฝ[2m2023-02-26T05:33:16.872566Z๏ฟฝ[0m ๏ฟฝ[32m INFO๏ฟฝ[0m  ๏ฟฝ[32mFetching Posts...๏ฟฝ[0m
    ๏ฟฝ[2;3mat๏ฟฝ[0m src\things.rs:115
    ๏ฟฝ[2;3min๏ฟฝ[0m ๏ฟฝ[1mlist๏ฟฝ[0m ๏ฟฝ[2;3mwith๏ฟฝ[0m ๏ฟฝ[1mthing_type๏ฟฝ[0m: Posts

  ๏ฟฝ[2m2023-02-26T05:33:17.101877Z๏ฟฝ[0m ๏ฟฝ[31mERROR๏ฟฝ[0m  ๏ฟฝ[31m{"error":403,"message":"Forbidden"}:#?๏ฟฝ[0m
    ๏ฟฝ[2;3mat๏ฟฝ[0m src\things.rs:164

  ๏ฟฝ[2m2023-02-26T05:33:17.102290Z๏ฟฝ[0m ๏ฟฝ[34mDEBUG๏ฟฝ[0m  ๏ฟฝ[34mCompleted listing Posts๏ฟฝ[0m
    ๏ฟฝ[2;3mat๏ฟฝ[0m src\cli.rs:67

  ๏ฟฝ[2m2023-02-26T05:33:17.103852Z๏ฟฝ[0m ๏ฟฝ[32m INFO๏ฟฝ[0m  ๏ฟฝ[32mShredding Comments...๏ฟฝ[0m
    ๏ฟฝ[2;3mat๏ฟฝ[0m src\cli.rs:52

  ๏ฟฝ[2m2023-02-26T05:33:17.104409Z๏ฟฝ[0m ๏ฟฝ[32m INFO๏ฟฝ[0m  ๏ฟฝ[32mFetching Comments...๏ฟฝ[0m
    ๏ฟฝ[2;3mat๏ฟฝ[0m src\things.rs:115
    ๏ฟฝ[2;3min๏ฟฝ[0m ๏ฟฝ[1mlist๏ฟฝ[0m ๏ฟฝ[2;3mwith๏ฟฝ[0m ๏ฟฝ[1mthing_type๏ฟฝ[0m: Comments

  ๏ฟฝ[2m2023-02-26T05:33:17.272778Z๏ฟฝ[0m ๏ฟฝ[31mERROR๏ฟฝ[0m  ๏ฟฝ[31m{"error":403,"message":"Forbidden"}:#?๏ฟฝ[0m
    ๏ฟฝ[2;3mat๏ฟฝ[0m src\things.rs:164

  ๏ฟฝ[2m2023-02-26T05:33:17.273170Z๏ฟฝ[0m ๏ฟฝ[34mDEBUG๏ฟฝ[0m  ๏ฟฝ[34mCompleted listing Comments๏ฟฝ[0m
    ๏ฟฝ[2;3mat๏ฟฝ[0m src\cli.rs:67

Linux binary release architecture support

Looks like it's arm64:

# file bin/shreddit
bin/shreddit: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, with debug_info, not stripped

Any plans for an x86_64 binary release? That'd be quite useful.

Cool project, thanks for taking it up.

Invalid_grant

I get the following error when running shreddit-mac:

  2023-05-07T21:51:46.790060Z ERROR  {"error":"invalid_grant"}
    at src/main.rs:34

Error: "{\"error\":\"invalid_grant\"}"

I have a shreddit.env file that looks like this:

SHREDDIT_USERNAME=...
SHREDDIT_PASSWORD=...
SHREDDIT_CLIENT_ID=...
SHREDDIT_CLIENT_SECRET=...

Using v0.7.2 Mac binary

"Cannot filter by max score when using GDPR data"

Hi, I'm running this on Windows 10, binary v0.9.1, the output looks something like this:

  2023-07-13T01:24:37.106648Z  INFO  Deleting...
    at src\things\post.rs:111
    in delete with self: Post { id: "", permalink: "", title: "", source: Gdpr { date: 2020-11-29T20:17:15Z, subreddit: "" } }, config: Config { username: "", password: "", client_id: "", client_secret: "", dry_run: false, thing_types: [Posts, Comments], before: 2023-07-12T00:00:00Z, max_score: Some(9999999), replacement_comment: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", user_agent: "ShredditRustClient", gdpr_export_dir: Some("C:\\Users\\xxx\\Downloads\\Firefox\\reddit"), edit_only: false }

  2023-07-13T01:24:37.106652Z ERROR  Cannot filter by max score when using GDPR data
    at src\things\post.rs:92
    in delete with self: Post { id: "", permalink: "", title: "", source: Gdpr { date: 2020-11-29T20:17:15Z, subreddit: "" } }, config: Config { username: "", password: "", client_id: "", client_secret: "", dry_run: false, thing_types: [Posts, Comments], before: 2023-07-12T00:00:00Z, max_score: Some(9999999), replacement_comment: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", user_agent: "ShredditRustClient", gdpr_export_dir: Some("C:\\Users\\xxx\\Downloads\\Firefox\\reddit"), edit_only: false }

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(Deserialize { pos: Some(Position { byte: 160823, line: 1494, record: 371 }), err: DeserializeError { field: None, kind: Message("data did not match any variant of untagged enum Source") } })', src\sources\gdpr.rs:17:41
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Redacted personal details

Edit: Removed the shreddit.env file and it seems to be working now.

thread 'main' panicked at 'called `Result::unwrap()`

I've been running this for a week or two now but just started receiving this error today.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: reqwest::Error { kind: Decode, source: Error("expected value", line: 1, column: 1) }', /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/shreddit-0.7.1/src/access_token.rs:23:10
stack backtrace:
   0:     0x5625289aea3a - std::backtrace_rs::backtrace::libunwind::trace::ha9053a9a07ca49cb
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x5625289aea3a - std::backtrace_rs::backtrace::trace_unsynchronized::h9c2852a457ad564e
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x5625289aea3a - std::sys_common::backtrace::_print_fmt::h457936fbfaa0070f
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x5625289aea3a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h5779d7bf7f70cb0c
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x5625289d3e9e - core::fmt::write::h5a4baaff1bcd3eb5
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/fmt/mod.rs:1232:17
   5:     0x5625289aba75 - std::io::Write::write_fmt::h4bc1f301cb9e9cce
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/io/mod.rs:1684:15
   6:     0x5625289ae805 - std::sys_common::backtrace::_print::h5fcdc36060f177e8
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x5625289ae805 - std::sys_common::backtrace::print::h54ca9458b876c8bf
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x5625289affbf - std::panicking::default_hook::{{closure}}::hbe471161c7664ed6
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:271:22
   9:     0x5625289afcfb - std::panicking::default_hook::ha3500da57aa4ac4f
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:290:9
  10:     0x5625289b0568 - std::panicking::rust_panic_with_hook::h50c09d000dc561d2
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:692:13
  11:     0x5625289b0469 - std::panicking::begin_panic_handler::{{closure}}::h9e2b2176e00e0d9c
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:583:13
  12:     0x5625289aeea6 - std::sys_common::backtrace::__rust_end_short_backtrace::h5739b8e512c09d02
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:150:18
  13:     0x5625289b0172 - rust_begin_unwind
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:579:5
  14:     0x56252862c173 - core::panicking::panic_fmt::hf33a1475b4dc5c3e
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:64:14
  15:     0x56252862c623 - core::result::unwrap_failed::hdff5465d74574b44
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/result.rs:1750:5
  16:     0x562528668f96 - shreddit::main::{{closure}}::h6e82294403626d58
  17:     0x56252869bdc1 - tokio::runtime::scheduler::current_thread::Context::enter::h47086dc8a0c5d187
  18:     0x5625286a55e2 - tokio::macros::scoped_tls::ScopedKey<T>::set::hc463bd22aa67b49c
  19:     0x56252869ba08 - tokio::runtime::scheduler::current_thread::CurrentThread::block_on::ha59e35b0f1a5af80
  20:     0x562528661716 - tokio::runtime::runtime::Runtime::block_on::h473cdb0b0417b6ab
  21:     0x562528640cb5 - shreddit::main::hd76dcd5dafc89bdb
  22:     0x5625286568e3 - std::sys_common::backtrace::__rust_begin_short_backtrace::ha006b79e85a8313f
  23:     0x56252864b1c9 - std::rt::lang_start::{{closure}}::h5ad75d9b66483ea3
  24:     0x5625289a701c - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hd6efcd3bec896f2c
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/ops/function.rs:287:13
  25:     0x5625289a701c - std::panicking::try::do_call::hce04e543bb1f4cbb
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:487:40
  26:     0x5625289a701c - std::panicking::try::h3342dd4e1f680968
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:451:19
  27:     0x5625289a701c - std::panic::catch_unwind::h148ce1e59ac0cee7
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panic.rs:140:14
  28:     0x5625289a701c - std::rt::lang_start_internal::{{closure}}::h25f9dda2057a67fe
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/rt.rs:148:48
  29:     0x5625289a701c - std::panicking::try::do_call::h7caaaeaf9401650b
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:487:40
  30:     0x5625289a701c - std::panicking::try::he7d15285746cbbc2
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:451:19
  31:     0x5625289a701c - std::panic::catch_unwind::h89fb4f50c0301fe0
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panic.rs:140:14
  32:     0x5625289a701c - std::rt::lang_start_internal::h078acd489417d3c1
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/rt.rs:148:20
  33:     0x562528640d95 - main
  34:     0x7f8d09aec09b - __libc_start_main
  35:     0x56252862c7ba - _start
  36:                0x0 - <unknown>

Delete / Edit before not working

Executing the following bash script via cron every day:

`export SHREDDIT_USERNAME=xxx
export SHREDDIT_PASSWORD=xxx
export SHREDDIT_CLIENT_ID=xxx
export SHREDDIT_CLIENT_SECRET=xxx
export SHREDDIT_BEFORE=$(date -u -d "40 days ago" +"%Y-%m-%d %H:%M:%S.%N %Z")
export SHREDDIT_REPLACEMENT_COMMENT="Content deleted for privacy protection"

/usr/local/shreddit/shreddit-linux
`

This has been working for a few months but noticed recently (since about Sept 24th or so) that the script isn't deleting or editing the posts and when run manually not throwing any errors - for example the output is:

`
2023-11-07T18:48:32.008009Z DEBUG Editing...
at src/things/comment.rs:94
in edit with self: Comment { id: "xxx", body: "text", permalink: "/r/link", source: Api { score: 2, created_utc: 1695598200.0, can_gild: false } }, config: Config { username: "xxx", password: "xx", client_id: "xxx", client_secret: "xx", dry_run: false, thing_types: [Posts, Comments], before: 2023-09-28T18:47:02.218205717Z, max_score: None, replacement_comment: "Content deleted for privacy protection", user_agent: "ShredditRustClient", gdpr_export_dir: None, edit_only: false }

2023-11-07T18:48:32.206916Z DEBUG Sleeping for 2s to prevent rate limiting.
at src/things/mod.rs:31
in edit with self: Comment { id: "xx", body: "text", permalink: "/r/link", source: Api { score: 2, created_utc: 1695598200.0, can_gild: false } }, config: Config { username: "xx", password: "xxx", client_id: "xx", client_secret: "xxx", dry_run: false, thing_types: [Posts, Comments], before: 2023-09-28T18:47:02.218205717Z, max_score: None, replacement_comment: "Content deleted for privacy protection", user_agent: "ShredditRustClient", gdpr_export_dir: None, edit_only: false }
`

No error messages that I can see.

Can't run

Whenever I install from cargo, I get the following errors.

error: could not compile futures-coredue to previous error error: failed to compileshreddit v0.7.2, intermediate artifacts can be found at /var/folders/nx/g122dr4d6bxgj6d770v8rtsw0000gn/T/cargo-installRHLeIz``

I also can't install from the file:

zsh: permission denied: ./shreddit

And if I try with sudo:

sudo: ./shreddit: command not found

I'm on macOS

Crash report: "missing field `jquery`"

RUST_BACKTRACE=1 SHREDDIT_DRY_RUN=false ./shreddit-linux
<snipped output>
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: reqwest::Error { kind: Decode, source: Error("missing field `jquery`", line: 1, column: 50) }', src/things.rs:206:14
stack backtrace:
   0: rust_begin_unwind
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/panicking.rs:64:14
   2: core::result::unwrap_failed
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/result.rs:1791:5
   3: shreddit::things::Thing::edit::{{closure}}::{{closure}}
   4: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll
   5: shreddit::things::Thing::shred::{{closure}}
   6: tokio::runtime::park::CachedParkThread::block_on
   7: tokio::runtime::scheduler::multi_thread::MultiThread::block_on
   8: tokio::runtime::runtime::Runtime::block_on
   9: shreddit::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

./shreddit-linux --version
shreddit 0.4.0

Panic while running in GDPR mode

I was running this in GDPR mode because I have a 14 year old reddit account that I'm trying to purge, and it ran for about 18 hours before panicking with the below error. I've set it to run again so I'll come back if it panics again at the same place.

thread 'main' panicked at 'called Result::unwrap() on an Err value: reqwest::Error { kind: Decode, source: Error("expected value", line: 2, column: 1) }', src\things\comment.rs:126:14
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Yup. Did it again. Any advice or workarounds on how to get the process to finish in GDPR mode?

Error with edit only

Getting this error when I run the script. I have specified my GDPR directory, and have selected edit only as an option.

Full backtrace:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(Deserialize { pos: Some(Position { byte: 39619, line: 423, record: 91 }), err: DeserializeError { field: None, kind: Message("data did not match any variant of untagged enum Source") } })', src/sources/gdpr.rs:17:41
stack backtrace:
   0:        0x108392836 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hae51cb91d407e2ef
   1:        0x1083b123b - core::fmt::write::h746bc0969202388b
   2:        0x10838f0fc - std::io::Write::write_fmt::h4098c2c7437a0bd7
   3:        0x10839260a - std::sys_common::backtrace::print::h8360bf0158e89b36
   4:        0x108393c60 - std::panicking::default_hook::{{closure}}::hedf04c568eb6e0bc
   5:        0x108393a10 - std::panicking::default_hook::h62889b2c29e2347d
   6:        0x1083941ba - std::panicking::rust_panic_with_hook::h22edd02828aff274
   7:        0x1083940d4 - std::panicking::begin_panic_handler::{{closure}}::h6895f44a9b7e2caa
   8:        0x108392c79 - std::sys_common::backtrace::__rust_end_short_backtrace::h013519e9b77978c5
   9:        0x108393e1d - _rust_begin_unwind
  10:        0x1083cd933 - core::panicking::panic_fmt::h2a51b60c12d11322
  11:        0x1083cddc5 - core::result::unwrap_failed::h52a6a55d409027df
  12:        0x108012827 - shreddit::main::{{closure}}::h0ebfa9763ec7fd1b
  13:        0x10806d879 - tokio::runtime::scheduler::current_thread::Context::enter::h5bba552e31bb72a4
  14:        0x108008343 - tokio::macros::scoped_tls::ScopedKey<T>::set::h900dc982390d4cc9
  15:        0x10806d4f4 - tokio::runtime::scheduler::current_thread::CurrentThread::block_on::h1cf7d3c0bff5eff2
  16:        0x10803b054 - tokio::runtime::runtime::Runtime::block_on::h9bc41c5dc33932cb
  17:        0x10802216c - shreddit::main::h8d61da09c2b5774c
  18:        0x10801c546 - std::sys_common::backtrace::__rust_begin_short_backtrace::h53a09829534cb3c6
  19:        0x10802e68c - std::rt::lang_start::{{closure}}::hde4d058064610883
  20:        0x10838ace2 - std::rt::lang_start_internal::h36134e47b0b0d769
  21:        0x10802971c - _main
  22:     0x7ff80b9be3a6 - <unknown>

Please let me know if I should provide anything else.

Filter by max score with GDPR export

Is it possible to filter by max score with the GDPR export? Can the client check the score locally, if you're already fetching the comment before deleting?

thread 'main' panicked again - No such file or directory

Credentials are correct, using env. file but same result with command line. Linux on Ubuntu flavour, installed rust then installed as per readme.

emma@pop-os:~$ shreddit
2023-04-18T12:23:58.580752Z INFO Shredding Posts...
at /home/emma/.cargo/registry/src/github.com-1ecc6299db9ec823/shreddit-0.7.1/src/main.rs:42

thread 'main' panicked at 'called Result::unwrap() on an Err value: Error(Io(Os { code: 2, kind: NotFound, message: "No such file or directory" }))', /home/emma/.cargo/registry/src/github.com-1ecc6299db9ec823/shreddit-0.7.1/src/sources/gdpr.rs:16:39
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Invalid Grant

Hello,

I followed the how to, I downloaded Shreddit after installing Cargo. I tried to run in cli command but it returns an error :

  2023-06-08T20:36:35.653591Z DEBUG  No shreddit.env config file found.
    at C:\Users\alexa\.cargo\registry\src\index.crates.io-6f17d22bba15001f\shreddit-0.7.3\src\main.rs:34

  2023-06-08T20:36:35.815718Z ERROR  {"error":"invalid_grant"}
    at C:\Users\alexa\.cargo\registry\src\index.crates.io-6f17d22bba15001f\shreddit-0.7.3\src\main.rs:41

Error: "{\"error\":\"invalid_grant\"}"

Is it related to my reddit's nickname ? It's look like -username-. I added an \ to escape : \-username-

Weird issue when deleting certain posts

First of all, thank you for keeping it alive!

I'm getting a strange error when I try to delete several of my posts; this is the first one:

2023-03-18T19:10:25.688200Z ERROR  {"data":{"after":null,"before":null,"children":[{"data":{"all_awardings":[],"allow_live_comments":false,"approved_at_utc":null,"approved_by":null,"archived":false,"author":"reddituser","author_flair_background_color":null,"author_flair_css_class":null,"author_flair_richtext":[],"author_flair_template_id":null,"author_flair_text":null,"author_flair_text_color":null,"author_flair_type":"text","author_fullname":"t2_hfe8y","author_is_blocked":false,"author_patreon_flair":false,"author_premium":false,"awarders":[],"banned_at_utc":null,"banned_by":null,"can_gild":false,"can_mod_post":false,"category":null,"clicked":false,"content_categories":null,"contest_mode":false,"created":1676189986.0,"created_utc":1676189986.0,"discussion_type":null,"distinguished":null,"domain":"self.podman","downs":0,"edited":false,"gilded":0,"gildings":{},"hidden":false,"hide_score":false,"id":"110apkw","is_created_from_ads_ui":false,"is_crosspostable":false,"is_meta":false,"is_original_content":false,"is_reddit_media_domain":false,"is_robot_indexable":true,"is_self":true,"is_video":false,"likes":null,"link_flair_background_color":"","link_flair_css_class":null,"link_flair_richtext":[],"link_flair_text":null,"link_flair_text_color":"dark","link_flair_type":"text","locked":false,"media":null,"media_embed":{},"media_only":false,"mod_note":null,"mod_reason_by":null,"mod_reason_title":null,"mod_reports":[],"name":"t3_110apkw","no_follow":true,"num_comments":5,"num_crossposts":0,"num_reports":null,"over_18":false,"parent_whitelist_status":"all_ads","permalink":"/r/podman/comments/110apkw/how_can_i_copy_a_folder_to_varlibmysqlfiles/","pinned":false,"pwls":6,"quarantine":false,"removal_reason":null,"removed_by":null,"removed_by_category":null,"report_reasons":null,"saved":false,"score":1,"secure_media":null,"secure_media_embed":{},"selftext":"Basically, I have set up a podman container with a MySQL server/db.\n\n    $ podman pull mysql:latest\n    $ mkdir /path/to/mysql_data\n    $ cd /path/to/mysql_data\n    $ podman run -d \\\n      --name mysql \\\n      -p 3306:3306 \\\n      -v /path/to/mysql_data:/var/lib/mysql:Z \\\n      -e MYSQL_ROOT_PASSWORD='my pw' \\\n      -e MYSQL_USER=myuser \\\n      -e MYSQL_PASSWORD='db user pw' \\\n      -e MYSQL_DATABASE=mydb \\\n      mysql:latest\n\nNow, I wanted to load a couple of CSVs into my db, but I got the infamous `secure_file_priv` error; running `SHOW VARIABLES LIKE \"secure_file_priv\";` points me towards /var/lib/mysql-files inside the container. The problem is that I am new to this whole containerization stuff, so I don't know how to copy the folder containing my CSV files into the \"virtual\" volume which contains /var/lib/mysql-files.\n\nI tried just copying the folder into the physical `mysql_data` dir and `chown` it to the user that the container creates (100998), but I couldn't move the dir to `mysql-files` since `sudo` is not available inside the container.\n\n&amp;#x200B;\n\nAny suggestions?","selftext_html":"&lt;!-- SC_OFF --&gt;&lt;div class=\"md\"&gt;&lt;p&gt;Basically, I have set up a podman container with a MySQL server/db.&lt;/p&gt;\n\n&lt;pre&gt;&lt;code&gt;$ podman pull mysql:latest\n$ mkdir /path/to/mysql_data\n$ cd /path/to/mysql_data\n$ podman run -d \\\n  --name mysql \\\n  -p 3306:3306 \\\n  -v /path/to/mysql_data:/var/lib/mysql:Z \\\n  -e MYSQL_ROOT_PASSWORD=&amp;#39;my pw&amp;#39; \\\n  -e MYSQL_USER=myuser \\\n  -e MYSQL_PASSWORD=&amp;#39;db user pw&amp;#39; \\\n  -e MYSQL_DATABASE=mydb \\\n  mysql:latest\n&lt;/code&gt;&lt;/pre&gt;\n\n&lt;p&gt;Now, I wanted to load a couple of CSVs into my db, but I got the infamous &lt;code&gt;secure_file_priv&lt;/code&gt; error; running &lt;code&gt;SHOW VARIABLES LIKE &amp;quot;secure_file_priv&amp;quot;;&lt;/code&gt; points me towards /var/lib/mysql-files inside the container. The problem is that I am new to this whole containerization stuff, so I don&amp;#39;t know how to copy the folder containing my CSV files into the &amp;quot;virtual&amp;quot; volume which contains /var/lib/mysql-files.&lt;/p&gt;\n\n&lt;p&gt;I tried just copying the folder into the physical &lt;code&gt;mysql_data&lt;/code&gt; dir and &lt;code&gt;chown&lt;/code&gt; it to the user that the container creates (100998), but I couldn&amp;#39;t move the dir to &lt;code&gt;mysql-files&lt;/code&gt; since &lt;code&gt;sudo&lt;/code&gt; is not available inside the container.&lt;/p&gt;\n\n&lt;p&gt;&amp;#x200B;&lt;/p&gt;\n\n&lt;p&gt;Any suggestions?&lt;/p&gt;\n&lt;/div&gt;&lt;!-- SC_ON --&gt;","send_replies":true,"spoiler":false,"stickied":false,"subreddit":"podman","subreddit_id":"t5_u1am9","subreddit_name_prefixed":"r/podman","subreddit_subscribers":3142,"subreddit_type":"public","suggested_sort":null,"thumbnail":"self","thumbnail_height":null,"thumbnail_width":null,"title":"How can I copy a folder to /var/lib/mysql-files inside my MySQL container?","top_awarded_type":null,"total_awards_received":0,"treatment_tags":[],"ups":1,"upvote_ratio":1.0,"url":"https://www.reddit.com/r/podman/comments/110apkw/how_can_i_copy_a_folder_to_varlibmysqlfiles/","user_reports":[],"view_count":null,"visited":false,"whitelist_status":"all_ads","wls":6},"kind":"t3"},{"data":{"all_awardings":[],"allow_live_comments":false,"approved_at_utc":null,"approved_by":null,"archived":false,"author":"reddituser","author_flair_background_color":null,"author_flair_css_class":"noob","author_flair_richtext":[],"author_flair_template_id":"f945e9fe-8c40-11e1-befc-12313d18ad57","author_flair_text":"Nooblet Brewer","author_flair_text_color":"dark","author_flair_type":"text","author_fullname":"t2_hfe8y","author_is_blocked":false,"author_patreon_flair":false,"author_premium":false,"awarders":[],"banned_at_utc":null,"banned_by":null,"can_gild":false,"can_mod_post":false,"category":null,"clicked":false,"content_categories":null,"contest_mode":false,"created":1674035863.0,"created_utc":1674035863.0,"discussion_type":null,"distinguished":null,"domain":"self.javahelp","downs":0,"edited":false,"gilded":0,"gildings"

and there are two/three more. I just copy-pasted the first one so that you can see what it is about - the other three are more or less the same as this one.

Also, I noticed another issue: I had to run the application several times, since it did a run, reported complete, but not all of my posts/comments were deleted. Not an issue per-se, but I just thought I'd let you know.

Secrets printed in plaintext

[Obligatory thanks for this excellent tool]

I noticed that the output includes password and client_secret, which probably should be hidden from debug info.

Exclamation mark ("!") in password needs to be escaped to work

Running shreddit-mac with a password that includes the sequence !<digits> (where <digits> is a sequence of digits, like 1234) gives me the error:

zsh: no such event: <digits>

Only if I escape the exclamation mark like this: pAsSwoRd\!<digits> does it work.

Shred text posts

It looks like text posts are currently just deleted, with no removal of the text. It gets shown as [deleted] but I expect it's still in the DB. It would be great if text-posts could be shredded the way comments are.

(Unfortunate that the title of a post can't be changed. Oh well.)

Application needs to be run several times to remove all comments/posts

I don't know if it's intended functionality, but the application stops after x amount of deletions, even if there are more posts left to delete.

I've run the command

shreddit --username MYUSERNAME --password MYPASS --client-id MYCLIENTID --client-secret MYCLIENTSECRET

As I said, it might be intended functionality, but if it isn't, I thought I'd let you know.

[request] - Skip [removed] from GDPR export

When running shreddit on a big export that already went through deletion, it still tries to fetch the comment and edit/remove it, wasting a lot of time.

A flag that adds a feature to trust that the GDPR export can be trusted when a comment has "[removed]" for content would speed the process a whole lot. This could be as simple as --skip-removed for example.

Forgot to use the GPDR folder for 1 post. Now it won't work!!

I ran the command without the GPDR flag because I forgot, then remembered I had it and added the flag and path. Now the program is trying to remove the same comment that has already been deleted in a loop. If the program was better, it would see it is already deleted and skip. Now I can't request another GPDR thing for another 30 days!! Also, this would mean that if you are using GPDR folder feature, and you kill the program for some reason, you can't start it back eider. Big issue IMO.

shreddit 0.4.2 stuck in a (seemingly) endless loop

$ shreddit --version
shreddit 0.4.2

Running like so, for example:

$ shreddit \
    --username "[redacted]" \
    --password "[redacted]" \
    --client-id "[redacted]" \
    --client-secret "[redacted]" \
    --before "2022-12-19 19:06:14.356955841 UTC"

Results in a loop of:

INFO  Fetching submitted...
DEBUG  Iterating over next page of results
DEBUG  Skipping due to `before` filter

Checking on the same posts/comments over and again, seemingly endlessly.

Allow newlines in edited comments

Whether setting the --replacement-comment flag or the SHREDDIT_REPLACEMENT_COMMENT environment variable, all \n occurences in it get replaced with \\n. Please replace them with actual newlines so that the replacement comment can have multiple paragraphs.

Error when deleting GDPR comments from private subs

I am getting an error when I run shreddit using the GDPR option. My account is very old and many of the comments I've made are in subs that are now private due to the protests that are currently underway.

The error back trace is as follows:


thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/shreddit-0.7.3/src/things/comment.rs:249:76
stack backtrace:
   0:     0x556aedd31cda - std::backtrace_rs::backtrace::libunwind::trace::ha9053a9a07ca49cb
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x556aedd31cda - std::backtrace_rs::backtrace::trace_unsynchronized::h9c2852a457ad564e
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x556aedd31cda - std::sys_common::backtrace::_print_fmt::h457936fbfaa0070f
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x556aedd31cda - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h5779d7bf7f70cb0c
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x556aedd5713e - core::fmt::write::h5a4baaff1bcd3eb5
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/fmt/mod.rs:1232:17
   5:     0x556aedd2ed15 - std::io::Write::write_fmt::h4bc1f301cb9e9cce
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/io/mod.rs:1684:15
   6:     0x556aedd31aa5 - std::sys_common::backtrace::_print::h5fcdc36060f177e8
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x556aedd31aa5 - std::sys_common::backtrace::print::h54ca9458b876c8bf
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x556aedd3325f - std::panicking::default_hook::{{closure}}::hbe471161c7664ed6
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:271:22
   9:     0x556aedd32f9b - std::panicking::default_hook::ha3500da57aa4ac4f
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:290:9
  10:     0x556aedd33808 - std::panicking::rust_panic_with_hook::h50c09d000dc561d2
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:692:13
  11:     0x556aedd336c2 - std::panicking::begin_panic_handler::{{closure}}::h9e2b2176e00e0d9c
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:581:13
  12:     0x556aedd32146 - std::sys_common::backtrace::__rust_end_short_backtrace::h5739b8e512c09d02
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:150:18
  13:     0x556aedd33412 - rust_begin_unwind
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:579:5
  14:     0x556aed9b54b3 - core::panicking::panic_fmt::hf33a1475b4dc5c3e
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:64:14
  15:     0x556aed9b554d - core::panicking::panic::h9533b2fee90b999e
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:114:5
  16:     0x556aeda33882 - <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll::hab9937b163fa2b04
  17:     0x556aeda1ae1e - <shreddit::things::comment::Comment as shreddit::things::Shred>::edit::{{closure}}::h7aed6537b0fcfb67
  18:     0x556aeda1e1a1 - shreddit::things::Shred::shred::{{closure}}::h9fb2f0c134e931a9
  19:     0x556aed9ec3fb - shreddit::main::{{closure}}::he58d28c40c55f4fb
  20:     0x556aeda259b1 - tokio::runtime::scheduler::current_thread::Context::enter::h1d86d3b4c3025ac0
  21:     0x556aeda2d4a2 - tokio::macros::scoped_tls::ScopedKey<T>::set::h8437cc472f971a7e
  22:     0x556aeda255f8 - tokio::runtime::scheduler::current_thread::CurrentThread::block_on::hbaabf4d71ca16121
  23:     0x556aed9e79e4 - tokio::runtime::runtime::Runtime::block_on::h9cefbe9cd38fe03d
  24:     0x556aed9bf625 - shreddit::main::h88e05cec64268fda
  25:     0x556aed9df323 - std::sys_common::backtrace::__rust_begin_short_backtrace::h84502011dbeb2ff9
  26:     0x556aed9d6539 - std::rt::lang_start::{{closure}}::hf169e3327e059a2e
  27:     0x556aedd2a2bc - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hd6efcd3bec896f2c
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/ops/function.rs:287:13
  28:     0x556aedd2a2bc - std::panicking::try::do_call::hce04e543bb1f4cbb
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:487:40
  29:     0x556aedd2a2bc - std::panicking::try::h3342dd4e1f680968
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:451:19
  30:     0x556aedd2a2bc - std::panic::catch_unwind::h148ce1e59ac0cee7
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panic.rs:140:14
  31:     0x556aedd2a2bc - std::rt::lang_start_internal::{{closure}}::h25f9dda2057a67fe
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/rt.rs:148:48
  32:     0x556aedd2a2bc - std::panicking::try::do_call::h7caaaeaf9401650b
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:487:40
  33:     0x556aedd2a2bc - std::panicking::try::he7d15285746cbbc2
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:451:19
  34:     0x556aedd2a2bc - std::panic::catch_unwind::h89fb4f50c0301fe0
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panic.rs:140:14
  35:     0x556aedd2a2bc - std::rt::lang_start_internal::h078acd489417d3c1
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/rt.rs:148:20
  36:     0x556aed9bf705 - main
  37:     0x7f592dc5bd0a - __libc_start_main
  38:     0x556aed9b5afa - _start
  39:                0x0 - <unknown>

Suggestion: 2 small README tweaks

I'd like to suggest two small tweaks to the README.

  1. Although the answer can be found in the Issues section, I think it's worth mentioning that if you have 2FA enabled, you need to append the (current) TOTP code to your password, eg PASSWORD:TOTP. Also, the user better type fast :)

  2. I also think that adding a phrase or with the instructions to "create your own app" would help- I don't think it's clear that the "client_id" is the ~22 character alphanumeric ID that's listed under the name of the app that you just created. Pointing that out could avoid some confusion!

Thanks for the tool, really appreciate it :)

Add Hours Environmental Variables

This would work the same as the the hours variable from the original shreddit's yaml file and would be an alternative to the BEFORE variable

Add LICENSE file in root of git repo

According to "Cargo.toml", this project is licensed under MIT. But no "LICENSE" file is to be found in the root of the git repo. By adding the MIT license to the root of the git repo, it will make the licensing official (currently, it could be argued in court that the program is proprietary) and it will make GitHub show the license in the side panel.

[request] - Relative time for --before

When configuring shreddit, a date must be entered in a "correct" format for it to work.

Enabling a relative time format would make it far simpler for a user to run, enabling commands such as shreddit --before "1month" removing anything older than a month.

Minor feature request: Custom comment message instead of random text

Hi there,

Given the current situation at Reddit I want to delete my comment history. However instead of just random text, I'd like to put a protest message in instructing others how to use this application.

I'm a complete novice with Rust but if you point me to the right function I'm happy to figure it out and send a PR.

Thanks!

Some comments will not be found and edited by this tool.

Hello and thanks for writing this little tool.

I've noticed that it's possible for some comments to appear if you sort by "top" on your own profile instead of new. Probably my old posts were never indexed properly under the new filter or they only bothered to store so many.

Just a heads up for folks.

Shreddit.env in current directory does nothing

When I run ./shreddit-mac and have a shreddit.env file right next to the executable, it doesn't use it for environment variables and I get the command's help output.

If I first do export $(cat shreddit.env | xargs) to get the env variables exported, then ./shreddit-mac works.

[request] Only scramble words

Hi!

I thought maybe it would be an idea to only rearrange words and/or letters as to not attract attention by any automated processes by reddits back-end.

Would that require a lot of work?

Also, thanks for providing a great tool in these times ๐Ÿ‘

Crash report: "ERROR RATE LIMITED"

$ RUST_BACKTRACE=1 SHREDDIT_DRY_RUN=false ./shreddit-linux
<snipped output>
  2023-02-13T03:49:40.904216Z ERROR  RATE LIMITED
    at src/things.rs:238
    in edit with dry_run: false
<snipped output>
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: RateLimited', src/things.rs:298:18
stack backtrace:
   0: rust_begin_unwind
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/panicking.rs:64:14
   2: core::result::unwrap_failed
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/result.rs:1791:5
   3: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll
   4: shreddit::things::Thing::shred::{{closure}}
   5: <core::pin::Pin<P> as core::future::future::Future>::poll
   6: tokio::runtime::scheduler::current_thread::Context::enter
   7: tokio::macros::scoped_tls::ScopedKey<T>::set
   8: tokio::runtime::scheduler::current_thread::CurrentThread::block_on
   9: tokio::runtime::runtime::Runtime::block_on
  10: shreddit::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
./shreddit-linux --version
shreddit 0.4.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.