Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion searcharr.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
DBFILE = "searcharr.db"
DBLOCK = Lock()


def parse_args():
parser = argparse.ArgumentParser(
prog="Searcharr", description="Start the Searcharr Bot."
Expand Down Expand Up @@ -414,6 +413,11 @@ def __init__(self, token):

def cmd_start(self, update, context):
logger.debug(f"Received start cmd from [{update.message.from_user.username}]")
if update.message.chat.type == "supergroup" and self._authenticated(update.message.chat.id):
self._add_user(
id=update.message.from_user.id,
username=str(update.message.from_user.username)
)
password = self._strip_entities(update.message)
if password and password == settings.searcharr_admin_password:
self._add_user(
Expand Down Expand Up @@ -1775,6 +1779,10 @@ def run(self):
"Developer mode is enabled; skipping registration of error handler--exceptions will be raised."
)

for chat_id in settings.auth_bypass_list.split(","):
logger.debug(f"Adding chat_id [{chat_id}] to auth bypass list")
self._add_user(id=int(chat_id), username="")

updater.start_polling()
updater.idle()

Expand Down
3 changes: 3 additions & 0 deletions settings-sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
# Telegram
tgram_token = ""

# Comma separated list of user ids that can bypass non-admin authentication
auth_bypass_list = ""

# Sonarr
sonarr_enabled = True
sonarr_url = "" # http://192.168.0.100:8989
Expand Down