Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Arrow library #161

Closed
bd-git opened this issue Jan 5, 2021 · 2 comments
Closed

Problem with Arrow library #161

bd-git opened this issue Jan 5, 2021 · 2 comments

Comments

@bd-git
Copy link

bd-git commented Jan 5, 2021

I installed shreddit to my windows PC using pip install -U shreddit in a python 3.9 venv.

I modified the praw ini and shreddit.yml files and am getting this error when I run:

INFO:shreddit:Logged in as <my_username>.
Traceback (most recent call last):
  File "<path_to_my_venv>\Scripts\shreddit-script.py", line 33, in <module>
    sys.exit(load_entry_point('shreddit==6.0.7', 'console_scripts', 'shreddit')())
  File "<path_to_my_venv>\lib\site-packages\shreddit\app.py", line 44, in main
    shredder = Shredder(default_config, args.user)
  File "<path_to_my_venv>\lib\site-packages\shreddit\shredder.py", line 33, in __init__
    self._recent_cutoff = arrow.now().replace(hours=-self._hours)
  File "<path_to_my_venv>\lib\site-packages\arrow\arrow.py", line 807, in replace
    raise AttributeError('unknown attribute: "{}"'.format(key))
AttributeError: unknown attribute: "hours"

FYI, here is the shreddit yaml I used if needed

---
# How many hours of comments you want to keep
# 24 hours in a day,
# 168 hours in a week,
# 672 hours in two fortnights,
# 720 hours in a month (30 days),
# 8766 hours in a year (365.25 days)
hours: 1

# Max score, higher than this and it'll be kept.
max_score: 9999

# Options: new, top, controversial, more?
sort: new

# Enables print statements to notify you of what's going on
verbose: True

# Removes your vote before deleting the item
clear_vote: True

# Options: comments, submitted, overview
# See: https://github.com/mellort/reddit_api/blob/master/reddit/objects.py#L359
# Overview: both submissions and comments. Comments / Submitted are as expected
item: overview

# Anything in this list won't be deleted, coma delimited
# spaces should work as .strip() is called after splitting
# on comma.
whitelist: [AskScience]

# If you want any specific posts to be whitelisted stick 'em in here
whitelist_ids: []

# If you want to whitelist or blacklist specific multireddits, add them here
# Each one must be a list of 2 elements: username, multireddit
# Example:
# multi_blacklist:
#     - [myusername, mymulti]
#     - [someotheruser, theirmulti]
multi_blacklist: []
multi_whitelist: []

# If you set this then no editing or deleting will be done
# but the output from the program will be shown as an example
trial_run: True

# Ignore distinguished comments.
whitelist_distinguished: False

# Ignore gilded (gold) comments
whitelist_gilded: False

# Delete everything older that this date, **This ignores whitelists**.
# Can be used as a second deletion, as in "delete items older than 24 hours
# except on whitelisted subreddits but after 3 months delete everything.
nuke_hours: 24

# Save a copy to disk of comments and posts before deleting them.
keep_a_copy: False
save_directory: /tmp

# Replacement text format
# Defines what you want to edit deleted content with pre-deletion (to ensure
# it's not saved in their database).
# Default: Random string. But this can be detected as spam in some cases.
# options: [random, dot, "user entered string"]
replacement_format: "Used a script to delete posts"

# Debug level, how much output you want
# See: https://docs.python.org/3/library/logging.html#logging-levels
debug: DEBUG

# Define your own wordlist to use as substitution text when
# replacement_format == random
wordlist: []

# Batch cooldown
# This controls how long (in seconds) to wait between each set of 1000 deletions.
batch_cooldown: 10

# vim: syntax=yaml ts=2
@825i
Copy link

825i commented Jan 8, 2021

This fork was written 4 years ago

See #159

@bd-git bd-git closed this as completed Jan 15, 2021
@bd-git
Copy link
Author

bd-git commented Jan 15, 2021

pip install didnt work but when i did a clone and ran from CLI it worked just fine. I'm good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants