2020-06-21 04:42:25 +02:00
|
|
|
from datetime import date, datetime, timedelta, timezone
|
2018-12-24 05:30:56 +01:00
|
|
|
import json
|
2020-07-04 02:56:23 +02:00
|
|
|
from mastodon import (
|
|
|
|
Mastodon,
|
|
|
|
MastodonError,
|
|
|
|
MastodonAPIError,
|
|
|
|
MastodonNetworkError,
|
|
|
|
MastodonRatelimitError,
|
|
|
|
)
|
2020-04-25 00:53:19 +02:00
|
|
|
import os
|
2020-04-21 00:49:34 +02:00
|
|
|
import requests
|
2020-04-25 00:53:19 +02:00
|
|
|
import subprocess
|
|
|
|
import sys
|
|
|
|
import time
|
|
|
|
|
2020-07-04 02:56:23 +02:00
|
|
|
|
2020-06-21 07:25:04 +02:00
|
|
|
def version(vnum):
|
|
|
|
try:
|
2020-07-04 02:56:23 +02:00
|
|
|
latest = requests.get(
|
|
|
|
"https://api.github.com/repos/hughrun/ephemetoot/releases/latest"
|
|
|
|
)
|
2020-06-21 07:25:04 +02:00
|
|
|
res = latest.json()
|
2020-07-04 02:56:23 +02:00
|
|
|
latest_version = res["name"]
|
|
|
|
print("\nYou are using ephemetoot Version " + vnum)
|
|
|
|
print("The latest release is " + latest_version + "\n")
|
|
|
|
|
2020-06-21 07:25:04 +02:00
|
|
|
except Exception as e:
|
2020-07-04 02:56:23 +02:00
|
|
|
print("Something went wrong:")
|
2020-06-21 07:25:04 +02:00
|
|
|
print(e)
|
|
|
|
|
2020-07-04 02:56:23 +02:00
|
|
|
|
2020-04-25 00:53:19 +02:00
|
|
|
def schedule(options):
|
|
|
|
try:
|
2020-07-04 02:56:23 +02:00
|
|
|
with open(options.schedule + "/ephemetoot.scheduler.plist", "r") as file:
|
2020-04-25 00:53:19 +02:00
|
|
|
lines = file.readlines()
|
2020-06-21 04:42:25 +02:00
|
|
|
|
2020-04-25 00:53:19 +02:00
|
|
|
if options.schedule == ".":
|
|
|
|
working_dir = os.getcwd()
|
2020-06-21 04:42:25 +02:00
|
|
|
|
2020-04-25 00:53:19 +02:00
|
|
|
else:
|
|
|
|
working_dir = options.schedule
|
2020-06-21 04:42:25 +02:00
|
|
|
|
2020-04-25 00:53:19 +02:00
|
|
|
lines[7] = " <string>" + working_dir + "</string>\n"
|
|
|
|
lines[10] = " <string>" + sys.argv[0] + "</string>\n"
|
|
|
|
lines[12] = " <string>" + working_dir + "/config.yaml</string>\n"
|
2020-06-21 04:42:25 +02:00
|
|
|
|
2020-04-25 00:53:19 +02:00
|
|
|
if options.time:
|
|
|
|
lines[21] = " <integer>" + options.time[0] + "</integer>\n"
|
|
|
|
lines[23] = " <integer>" + options.time[1] + "</integer>\n"
|
2020-06-21 04:42:25 +02:00
|
|
|
|
2020-07-04 02:56:23 +02:00
|
|
|
with open("ephemetoot.scheduler.plist", "w") as file:
|
2020-04-25 00:53:19 +02:00
|
|
|
file.writelines(lines)
|
2018-12-24 05:30:56 +01:00
|
|
|
|
2020-07-04 02:56:23 +02:00
|
|
|
sys.tracebacklimit = 0 # suppress Tracebacks
|
2020-04-25 00:53:19 +02:00
|
|
|
# save the plist file into ~/Library/LaunchAgents
|
|
|
|
subprocess.run(
|
2020-07-04 02:56:23 +02:00
|
|
|
[
|
|
|
|
"cp "
|
|
|
|
+ options.schedule
|
|
|
|
+ "/ephemetoot.scheduler.plist"
|
|
|
|
+ " ~/Library/LaunchAgents/"
|
|
|
|
],
|
|
|
|
shell=True,
|
2020-04-25 00:53:19 +02:00
|
|
|
)
|
|
|
|
# unload any existing file (i.e. if this is an update to the file) and suppress any errors
|
|
|
|
subprocess.run(
|
2020-07-04 02:56:23 +02:00
|
|
|
["launchctl unload ~/Library/LaunchAgents/ephemetoot.scheduler.plist"],
|
|
|
|
stdout=subprocess.DEVNULL,
|
2020-04-25 00:53:19 +02:00
|
|
|
stderr=subprocess.DEVNULL,
|
2020-07-04 02:56:23 +02:00
|
|
|
shell=True,
|
2020-04-25 00:53:19 +02:00
|
|
|
)
|
|
|
|
# load the new file and suppress any errors
|
|
|
|
subprocess.run(
|
|
|
|
["launchctl load ~/Library/LaunchAgents/ephemetoot.scheduler.plist"],
|
2020-07-04 02:56:23 +02:00
|
|
|
shell=True,
|
2020-04-25 00:53:19 +02:00
|
|
|
)
|
2020-07-04 02:56:23 +02:00
|
|
|
print("⏰ Scheduled!")
|
2020-04-25 00:53:19 +02:00
|
|
|
except Exception:
|
2020-07-04 02:56:23 +02:00
|
|
|
print("🙁 Scheduling failed.")
|
|
|
|
|
2020-04-25 00:53:19 +02:00
|
|
|
|
2020-04-27 07:28:07 +02:00
|
|
|
def checkToots(config, options, retry_count=0):
|
|
|
|
|
2020-07-04 02:56:23 +02:00
|
|
|
keep_pinned = "keep_pinned" in config and config["keep_pinned"]
|
|
|
|
toots_to_keep = config["toots_to_keep"] if "toots_to_keep" in config else []
|
|
|
|
visibility_to_keep = (
|
|
|
|
config["visibility_to_keep"] if "visibility_to_keep" in config else []
|
|
|
|
)
|
|
|
|
hashtags_to_keep = (
|
|
|
|
set(config["hashtags_to_keep"]) if "hashtags_to_keep" in config else set()
|
|
|
|
)
|
|
|
|
days_to_keep = config["days_to_keep"] if "days_to_keep" in config else 365
|
2020-05-09 06:45:38 +02:00
|
|
|
|
2020-04-21 00:49:34 +02:00
|
|
|
try:
|
2020-05-09 06:45:38 +02:00
|
|
|
print(
|
2020-07-04 02:56:23 +02:00
|
|
|
"Fetching account details for @"
|
|
|
|
+ config["username"]
|
|
|
|
+ "@"
|
|
|
|
+ config["base_url"]
|
2020-05-09 06:45:38 +02:00
|
|
|
)
|
|
|
|
|
2020-06-28 14:04:29 +02:00
|
|
|
def jsondefault(obj):
|
|
|
|
if isinstance(obj, (date, datetime)):
|
|
|
|
return obj.isoformat()
|
2020-06-29 13:45:44 +02:00
|
|
|
|
2020-04-27 07:28:07 +02:00
|
|
|
def checkBatch(timeline, deleted_count=0):
|
|
|
|
for toot in timeline:
|
2020-07-04 02:56:23 +02:00
|
|
|
if "id" in toot and "archive" in config:
|
2020-07-18 07:45:20 +02:00
|
|
|
|
|
|
|
# define archive path
|
|
|
|
if config["archive"][0] == '~':
|
|
|
|
archive_path = os.path.expanduser(config["archive"])
|
|
|
|
elif config["archive"][0] == '/':
|
|
|
|
archive_path = config["archive"]
|
|
|
|
else:
|
|
|
|
archive_path = os.path.join( os.getcwd(), config["archive"] )
|
|
|
|
if archive_path[-1] != '/':
|
|
|
|
archive_path += '/'
|
2020-07-18 09:38:16 +02:00
|
|
|
|
2020-07-18 07:45:20 +02:00
|
|
|
filename = os.path.join(archive_path, str(toot["id"]) + ".json")
|
|
|
|
|
2020-07-18 09:38:16 +02:00
|
|
|
if not options.archive_deleted:
|
|
|
|
# write toot to archive
|
|
|
|
with open(filename, "w") as f:
|
|
|
|
f.write(json.dumps(toot, indent=4, default=jsondefault))
|
|
|
|
f.close()
|
2020-07-18 07:45:20 +02:00
|
|
|
|
2020-04-27 07:28:07 +02:00
|
|
|
toot_tags = set()
|
|
|
|
for tag in toot.tags:
|
|
|
|
toot_tags.add(tag.name)
|
|
|
|
try:
|
2020-05-09 06:45:38 +02:00
|
|
|
if keep_pinned and hasattr(toot, "pinned") and toot.pinned:
|
2020-07-18 10:02:30 +02:00
|
|
|
if not (options.hide_skipped or options.quiet):
|
2020-06-20 13:05:06 +02:00
|
|
|
if options.datestamp:
|
2020-07-04 02:56:23 +02:00
|
|
|
print(
|
|
|
|
str(
|
|
|
|
datetime.now(timezone.utc).strftime(
|
|
|
|
"%a %d %b %Y %H:%M:%S %z"
|
|
|
|
)
|
|
|
|
),
|
|
|
|
end=" : ",
|
|
|
|
)
|
|
|
|
|
|
|
|
print("📌 skipping pinned toot - " + str(toot.id))
|
2020-05-09 06:45:38 +02:00
|
|
|
elif toot.id in toots_to_keep:
|
2020-07-18 10:02:30 +02:00
|
|
|
if not (options.hide_skipped or options.quiet):
|
2020-06-20 13:05:06 +02:00
|
|
|
if options.datestamp:
|
2020-07-04 02:56:23 +02:00
|
|
|
print(
|
|
|
|
str(
|
|
|
|
datetime.now(timezone.utc).strftime(
|
|
|
|
"%a %d %b %Y %H:%M:%S %z"
|
|
|
|
)
|
|
|
|
),
|
|
|
|
end=" : ",
|
|
|
|
)
|
|
|
|
|
|
|
|
print("💾 skipping saved toot - " + str(toot.id))
|
2020-05-09 06:45:38 +02:00
|
|
|
elif toot.visibility in visibility_to_keep:
|
2020-07-18 10:02:30 +02:00
|
|
|
if not (options.hide_skipped or options.quiet):
|
2020-06-20 13:05:06 +02:00
|
|
|
if options.datestamp:
|
2020-07-04 02:56:23 +02:00
|
|
|
print(
|
|
|
|
str(
|
|
|
|
datetime.now(timezone.utc).strftime(
|
|
|
|
"%a %d %b %Y %H:%M:%S %z"
|
|
|
|
)
|
|
|
|
),
|
|
|
|
end=" : ",
|
|
|
|
)
|
|
|
|
|
2020-06-20 13:05:06 +02:00
|
|
|
print(
|
2020-07-04 02:56:23 +02:00
|
|
|
"👀 skipping "
|
|
|
|
+ toot.visibility
|
|
|
|
+ " toot - "
|
2020-06-20 13:05:06 +02:00
|
|
|
+ str(toot.id)
|
|
|
|
)
|
2020-05-09 06:45:38 +02:00
|
|
|
elif len(hashtags_to_keep.intersection(toot_tags)) > 0:
|
2020-07-18 10:02:30 +02:00
|
|
|
if not (options.hide_skipped or options.quiet):
|
2020-06-20 13:05:06 +02:00
|
|
|
if options.datestamp:
|
2020-07-04 02:56:23 +02:00
|
|
|
print(
|
|
|
|
str(
|
|
|
|
datetime.now(timezone.utc).strftime(
|
|
|
|
"%a %d %b %Y %H:%M:%S %z"
|
|
|
|
)
|
|
|
|
),
|
|
|
|
end=" : ",
|
|
|
|
)
|
|
|
|
|
|
|
|
print("#️⃣ skipping toot with hashtag - " + str(toot.id))
|
2020-04-27 07:28:07 +02:00
|
|
|
elif cutoff_date > toot.created_at:
|
|
|
|
if hasattr(toot, "reblog") and toot.reblog:
|
2020-07-18 10:02:30 +02:00
|
|
|
if not options.quiet:
|
|
|
|
if options.datestamp:
|
|
|
|
print(
|
|
|
|
str(
|
|
|
|
datetime.now(timezone.utc).strftime(
|
|
|
|
"%a %d %b %Y %H:%M:%S %z"
|
|
|
|
)
|
|
|
|
),
|
|
|
|
end=" : ",
|
|
|
|
)
|
|
|
|
|
2020-07-04 02:56:23 +02:00
|
|
|
print(
|
2020-07-18 10:02:30 +02:00
|
|
|
"👎 unboosting toot "
|
|
|
|
+ str(toot.id)
|
|
|
|
+ " boosted "
|
|
|
|
+ toot.created_at.strftime("%d %b %Y")
|
2020-07-04 02:56:23 +02:00
|
|
|
)
|
2020-04-27 07:28:07 +02:00
|
|
|
deleted_count += 1
|
|
|
|
# unreblog the original toot (their toot), not the toot created by boosting (your toot)
|
|
|
|
if not options.test:
|
|
|
|
if mastodon.ratelimit_remaining == 0:
|
2020-07-18 10:02:30 +02:00
|
|
|
if not options.quiet:
|
|
|
|
print(
|
|
|
|
"Rate limit reached. Waiting for a rate limit reset"
|
|
|
|
)
|
2020-07-18 09:38:16 +02:00
|
|
|
# check for --archive-deleted
|
|
|
|
if options.archive_deleted and "id" in toot and "archive" in config:
|
|
|
|
# write toot to archive
|
|
|
|
with open(filename, "w") as f:
|
|
|
|
f.write(json.dumps(toot, indent=4, default=jsondefault))
|
|
|
|
f.close()
|
2020-04-27 07:28:07 +02:00
|
|
|
mastodon.status_unreblog(toot.reblog)
|
|
|
|
else:
|
2020-07-18 10:02:30 +02:00
|
|
|
if not options.quiet:
|
|
|
|
if options.datestamp:
|
|
|
|
print(
|
|
|
|
str(
|
|
|
|
datetime.now(timezone.utc).strftime(
|
|
|
|
"%a %d %b %Y %H:%M:%S %z"
|
|
|
|
)
|
|
|
|
),
|
|
|
|
end=" : ",
|
|
|
|
)
|
|
|
|
|
2020-07-04 02:56:23 +02:00
|
|
|
print(
|
2020-07-18 10:02:30 +02:00
|
|
|
"❌ deleting toot "
|
|
|
|
+ str(toot.id)
|
|
|
|
+ " tooted "
|
|
|
|
+ toot.created_at.strftime("%d %b %Y")
|
2020-07-04 02:56:23 +02:00
|
|
|
)
|
2020-04-27 07:28:07 +02:00
|
|
|
deleted_count += 1
|
|
|
|
time.sleep(
|
|
|
|
2
|
|
|
|
) # wait 2 secs between deletes to be a bit nicer to the server
|
|
|
|
if not options.test:
|
2020-07-18 10:02:30 +02:00
|
|
|
if mastodon.ratelimit_remaining == 0 and not options.quiet:
|
2020-06-21 04:42:25 +02:00
|
|
|
|
|
|
|
now = time.time()
|
|
|
|
diff = mastodon.ratelimit_reset - now
|
|
|
|
|
2020-04-27 07:28:07 +02:00
|
|
|
print(
|
2020-07-04 02:56:23 +02:00
|
|
|
"\nRate limit reached at "
|
|
|
|
+ str(
|
|
|
|
datetime.now(timezone.utc).strftime(
|
|
|
|
"%a %d %b %Y %H:%M:%S %z"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
+ " - next reset due in "
|
|
|
|
+ str(format(diff / 60, ".0f"))
|
|
|
|
+ " minutes.\n"
|
2020-04-27 07:28:07 +02:00
|
|
|
)
|
2020-07-18 09:38:16 +02:00
|
|
|
# check for --archive-deleted
|
|
|
|
if options.archive_deleted and "id" in toot and "archive" in config:
|
|
|
|
# write toot to archive
|
|
|
|
with open(filename, "w") as f:
|
|
|
|
f.write(json.dumps(toot, indent=4, default=jsondefault))
|
|
|
|
f.close()
|
2020-07-18 10:02:30 +02:00
|
|
|
|
2020-04-27 07:28:07 +02:00
|
|
|
mastodon.status_delete(toot)
|
2020-06-21 04:42:25 +02:00
|
|
|
|
|
|
|
except MastodonRatelimitError:
|
|
|
|
|
|
|
|
now = time.time()
|
|
|
|
diff = mastodon.ratelimit_reset - now
|
|
|
|
|
|
|
|
print(
|
2020-07-04 02:56:23 +02:00
|
|
|
"\nRate limit reached at "
|
|
|
|
+ str(
|
|
|
|
datetime.now(timezone.utc).strftime(
|
|
|
|
"%a %d %b %Y %H:%M:%S %z"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
+ " - waiting for next reset due in "
|
|
|
|
+ str(format(diff / 60, ".0f"))
|
|
|
|
+ " minutes.\n"
|
2020-06-21 04:42:25 +02:00
|
|
|
)
|
|
|
|
|
2020-07-04 02:56:23 +02:00
|
|
|
time.sleep(diff + 1) # wait for rate limit to reset
|
2020-06-21 04:42:25 +02:00
|
|
|
|
2020-04-27 07:28:07 +02:00
|
|
|
except MastodonError as e:
|
2020-05-09 06:45:38 +02:00
|
|
|
print(
|
2020-07-04 02:56:23 +02:00
|
|
|
"🛑 ERROR deleting toot - " + str(toot.id) + " - " + str(e.args)
|
2020-05-09 06:45:38 +02:00
|
|
|
)
|
|
|
|
print("Waiting 1 minute before re-trying")
|
2020-04-27 07:28:07 +02:00
|
|
|
time.sleep(60)
|
|
|
|
try:
|
|
|
|
print("Attempting delete again")
|
|
|
|
mastodon.status_delete(toot)
|
|
|
|
time.sleep(
|
|
|
|
2
|
|
|
|
) # wait 2 secs between deletes to be a bit nicer to the server
|
|
|
|
except Exception as e:
|
2020-07-04 02:56:23 +02:00
|
|
|
print("🛑 ERROR deleting toot - " + str(toot.id))
|
2020-04-27 07:28:07 +02:00
|
|
|
print(e)
|
|
|
|
print("Exiting due to error.")
|
|
|
|
break
|
|
|
|
except KeyboardInterrupt:
|
|
|
|
print("Operation aborted.")
|
|
|
|
break
|
2020-05-09 06:45:38 +02:00
|
|
|
except KeyError as e:
|
|
|
|
print(
|
2020-07-04 02:56:23 +02:00
|
|
|
"⚠️ There is an error in your config.yaml file. Please add a value for "
|
|
|
|
+ str(e)
|
2020-05-09 06:45:38 +02:00
|
|
|
+ " and try again."
|
|
|
|
)
|
|
|
|
break
|
|
|
|
except:
|
|
|
|
e = sys.exc_info()
|
|
|
|
|
2020-07-04 02:56:23 +02:00
|
|
|
print("🛑 Unknown ERROR deleting toot - " + str(toot.id))
|
|
|
|
|
|
|
|
print("ERROR: " + str(e[0]) + " - " + str(e[1]))
|
2020-04-27 07:28:07 +02:00
|
|
|
|
|
|
|
# the account_statuses call is paginated with a 40-toot limit
|
|
|
|
# get the id of the last toot to include as 'max_id' in the next API call.
|
|
|
|
# then keep triggering new rounds of checkToots() until there are no more toots to check
|
|
|
|
try:
|
|
|
|
max_id = timeline[-1:][0].id
|
|
|
|
next_batch = mastodon.account_statuses(user_id, limit=40, max_id=max_id)
|
|
|
|
if len(next_batch) > 0:
|
|
|
|
checkBatch(next_batch, deleted_count)
|
|
|
|
else:
|
|
|
|
if options.test:
|
2020-06-20 12:52:34 +02:00
|
|
|
if options.datestamp:
|
2020-07-04 02:56:23 +02:00
|
|
|
print(
|
|
|
|
"\n\n"
|
|
|
|
+ str(
|
|
|
|
datetime.now(timezone.utc).strftime(
|
|
|
|
"%a %d %b %Y %H:%M:%S %z"
|
|
|
|
)
|
|
|
|
),
|
|
|
|
end=" : ",
|
|
|
|
)
|
2020-06-20 12:52:34 +02:00
|
|
|
|
2020-04-27 07:28:07 +02:00
|
|
|
print(
|
2020-06-20 12:52:34 +02:00
|
|
|
"Test run completed. This would have removed "
|
2020-04-27 07:28:07 +02:00
|
|
|
+ str(deleted_count)
|
|
|
|
+ " toots."
|
|
|
|
)
|
|
|
|
else:
|
2020-06-20 12:52:34 +02:00
|
|
|
if options.datestamp:
|
2020-07-04 02:56:23 +02:00
|
|
|
print(
|
|
|
|
"\n\n"
|
|
|
|
+ str(
|
|
|
|
datetime.now(timezone.utc).strftime(
|
|
|
|
"%a %d %b %Y %H:%M:%S %z"
|
|
|
|
)
|
|
|
|
),
|
|
|
|
end=" : ",
|
|
|
|
)
|
2020-06-20 12:52:34 +02:00
|
|
|
|
2020-07-04 02:56:23 +02:00
|
|
|
print("Removed " + str(deleted_count) + " toots.")
|
2020-04-27 07:28:07 +02:00
|
|
|
|
2020-07-18 10:02:30 +02:00
|
|
|
if not options.quiet:
|
|
|
|
print("\n---------------------------------------")
|
|
|
|
print("🥳 ==> 🧼 ==> 😇 User cleanup complete!")
|
|
|
|
print("---------------------------------------\n")
|
2020-04-27 07:28:07 +02:00
|
|
|
|
|
|
|
except IndexError:
|
|
|
|
print("No toots found!")
|
2020-05-09 06:45:38 +02:00
|
|
|
|
2020-06-21 04:42:25 +02:00
|
|
|
if options.pace:
|
|
|
|
mastodon = Mastodon(
|
2020-07-04 02:56:23 +02:00
|
|
|
access_token=config["access_token"],
|
|
|
|
api_base_url="https://" + config["base_url"],
|
2020-06-21 04:42:25 +02:00
|
|
|
ratelimit_method="pace",
|
|
|
|
)
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
mastodon = Mastodon(
|
2020-07-04 02:56:23 +02:00
|
|
|
access_token=config["access_token"],
|
|
|
|
api_base_url="https://" + config["base_url"],
|
2020-06-21 04:42:25 +02:00
|
|
|
ratelimit_method="wait",
|
|
|
|
)
|
|
|
|
|
2020-05-09 06:45:38 +02:00
|
|
|
cutoff_date = datetime.now(timezone.utc) - timedelta(days=days_to_keep)
|
2020-04-21 00:49:34 +02:00
|
|
|
user_id = mastodon.account_verify_credentials().id
|
|
|
|
account = mastodon.account(user_id)
|
|
|
|
timeline = mastodon.account_statuses(user_id, limit=40)
|
2018-12-24 05:30:56 +01:00
|
|
|
|
2020-07-18 10:02:30 +02:00
|
|
|
if not options.quiet:
|
|
|
|
print("Checking " + str(account.statuses_count) + " toots")
|
2019-02-13 22:59:57 +01:00
|
|
|
|
2020-04-27 07:28:07 +02:00
|
|
|
checkBatch(timeline)
|
2020-04-25 00:53:19 +02:00
|
|
|
|
2020-05-09 06:45:38 +02:00
|
|
|
except KeyError as val:
|
2020-07-04 02:56:23 +02:00
|
|
|
print("\n⚠️ error with in your config.yaml file!")
|
|
|
|
print("Please ensure there is a value for " + str(val) + "\n")
|
2020-05-09 06:45:38 +02:00
|
|
|
|
2020-04-21 00:49:34 +02:00
|
|
|
except MastodonAPIError:
|
2020-07-04 02:56:23 +02:00
|
|
|
print("\n🙅 User and/or access token does not exist or has been deleted")
|
2020-04-21 00:49:34 +02:00
|
|
|
except MastodonNetworkError:
|
2020-07-04 02:56:23 +02:00
|
|
|
print("\n📡 ephemetoot cannot connect to the server - are you online?")
|
2020-04-25 00:53:19 +02:00
|
|
|
if retry_count < 4:
|
2020-07-04 02:56:23 +02:00
|
|
|
print("Waiting 1 minute before trying again")
|
2020-04-25 00:53:19 +02:00
|
|
|
time.sleep(60)
|
|
|
|
retry_count += 1
|
2020-07-04 02:56:23 +02:00
|
|
|
print("Attempt " + str(retry_count + 1))
|
2020-04-27 07:28:07 +02:00
|
|
|
checkToots(config, options, retry_count)
|
2020-04-25 00:53:19 +02:00
|
|
|
else:
|
2020-07-04 02:56:23 +02:00
|
|
|
print("Gave up waiting for network")
|