toddrob99 / searcharr

Sonarr & Radarr & Readarr Telegram Bot
MIT License
244 stars 62 forks source link

Command is not a valid bot command #61

Closed axelmvt closed 1 year ago

axelmvt commented 1 year ago

Looks like searcharr stopped working. All I get is the following:

`Traceback (most recent call last): File "/app/searcharr.py", line 1778, in tgr.run() File "/app/searcharr.py", line 1422, in run updater.dispatcher.add_handler(CommandHandler(c, self.cmd_movie)) File "/usr/local/lib/python3.9/site-packages/telegram/ext/commandhandler.py", line 164, in init raise ValueError('Command is not a valid bot command') ValueError: Command is not a valid bot command

Traceback (most recent call last): File "/app/searcharr.py", line 1778, in tgr.run() File "/app/searcharr.py", line 1422, in run updater.dispatcher.add_handler(CommandHandler(c, self.cmd_movie)) File "/usr/local/lib/python3.9/site-packages/telegram/ext/commandhandler.py", line 164, in init raise ValueError('Command is not a valid bot command') ValueError: Command is not a valid bot command`

And the container keeps restarting. Is anyone else having this issue?

Thanks in advance!

toddrob99 commented 1 year ago

It's still working fine for me. I'm guessing there's a misconfiguration in your settings.py. Based on the error message, I think it's trying to register a command that is either empty or contains an unsupported character. Please enable debug logging and see what is in your log prior to the crash.

axelmvt commented 1 year ago

thanks for the reply!

all I see is a warning regarding no root folder provided:

2022-11-09 00:01:15,048 - DEBUG - searcharr.sonarr(140520535554888):18 - Logging started! 2022-11-09 00:01:15,048 - DEBUG - searcharr.sonarr(140520535554888):243 - Submitting GET request: [http://192.168.10.242:8989/api/profile?apikey=8529635812094b7ca08d31c992147369] 2022-11-09 00:01:15,053 - DEBUG - searcharr.sonarr(140520535554888):243 - Submitting GET request: [http://192.168.10.242:8989/api/RootFolder?apikey=8529635812094b7ca08d31c992147369] 2022-11-09 00:01:15,068 - DEBUG - searcharr.sonarr(140520535554888):73 - Refreshing all series cache... 2022-11-09 00:01:15,068 - DEBUG - searcharr.sonarr(140520535554888):243 - Submitting GET request: [http://192.168.10.242:8989/api/series?apikey=8529635812094b7ca08d31c992147369] 2022-11-09 00:01:15,075 - DEBUG - searcharr(140520535554888):80 - Looking up/validating Sonarr quality profile id for [720p]... 2022-11-09 00:01:15,075 - DEBUG - searcharr(140520535554888):87 - Found Sonarr quality profile for [720p]: [{'name': '720p', 'upgradeAllowed': False, 'cutoff': {'id': 14, 'name': 'WEBRip-720p', 'source': 'webRip', 'resolution': 720}, 'items': [{'quality': {'id': 0, 'name': 'Unknown', 'source': 'unknown', 'resolution': 0}, 'allowed': False}, {'quality': {'id': 1, 'name': 'SDTV', 'source': 'television', 'resolution': 480}, 'allowed': False}, {'quality': {'id': 12, 'name': 'WEBRip-480p', 'source': 'webRip', 'resolution': 480}, 'allowed': False}, {'quality': {'id': 8, 'name': 'WEBDL-480p', 'source': 'web', 'resolution': 480}, 'allowed': False}, {'quality': {'id': 2, 'name': 'DVD', 'source': 'dvd', 'resolution': 480}, 'allowed': False}, {'quality': {'id': 13, 'name': 'Bluray-480p', 'source': 'bluray', 'resolution': 480}, 'allowed': False}, {'quality': {'id': 4, 'name': 'HDTV-720p', 'source': 'television', 'resolution': 720}, 'allowed': True}, {'quality': {'id': 9, 'name': 'HDTV-1080p', 'source': 'television', 'resolution': 1080}, 'allowed': False}, {'quality': {'id': 10, 'name': 'Raw-HD', 'source': 'televisionRaw', 'resolution': 1080}, 'allowed': False}, {'quality': {'id': 14, 'name': 'WEBRip-720p', 'source': 'webRip', 'resolution': 720}, 'allowed': True}, {'quality': {'id': 5, 'name': 'WEBDL-720p', 'source': 'web', 'resolution': 720}, 'allowed': True}, {'quality': {'id': 6, 'name': 'Bluray-720p', 'source': 'bluray', 'resolution': 720}, 'allowed': False}, {'quality': {'id': 15, 'name': 'WEBRip-1080p', 'source': 'webRip', 'resolution': 1080}, 'allowed': False}, {'quality': {'id': 3, 'name': 'WEBDL-1080p', 'source': 'web', 'resolution': 1080}, 'allowed': False}, {'quality': {'id': 7, 'name': 'Bluray-1080p', 'source': 'bluray', 'resolution': 1080}, 'allowed': False}, {'quality': {'id': 20, 'name': 'Bluray-1080p Remux', 'source': 'blurayRaw', 'resolution': 1080}, 'allowed': False}, {'quality': {'id': 16, 'name': 'HDTV-2160p', 'source': 'television', 'resolution': 2160}, 'allowed': False}, {'quality': {'id': 17, 'name': 'WEBRip-2160p', 'source': 'webRip', 'resolution': 2160}, 'allowed': False}, {'quality': {'id': 18, 'name': 'WEBDL-2160p', 'source': 'web', 'resolution': 2160}, 'allowed': False}, {'quality': {'id': 19, 'name': 'Bluray-2160p', 'source': 'bluray', 'resolution': 2160}, 'allowed': False}, {'quality': {'id': 21, 'name': 'Bluray-2160p Remux', 'source': 'blurayRaw', 'resolution': 2160}, 'allowed': False}], 'id': 7}] 2022-11-09 00:01:15,075 - DEBUG - searcharr(140520535554888):80 - Looking up/validating Sonarr quality profile id for [HD - 720p/1080p]... 2022-11-09 00:01:15,075 - DEBUG - searcharr(140520535554888):87 - Found Sonarr quality profile for [HD - 720p/1080p]: [{'name': 'HD - 720p/1080p', 'upgradeAllowed': False, 'cutoff': {'id': 4, 'name': 'HDTV-720p', 'source': 'television', 'resolution': 720}, 'items': [{'quality': {'id': 0, 'name': 'Unknown', 'source': 'unknown', 'resolution': 0}, 'allowed': False}, {'quality': {'id': 1, 'name': 'SDTV', 'source': 'television', 'resolution': 480}, 'allowed': False}, {'quality': {'id': 12, 'name': 'WEBRip-480p', 'source': 'webRip', 'resolution': 480}, 'allowed': False}, {'quality': {'id': 8, 'name': 'WEBDL-480p', 'source': 'web', 'resolution': 480}, 'allowed': False}, {'quality': {'id': 2, 'name': 'DVD', 'source': 'dvd', 'resolution': 480}, 'allowed': False}, {'quality': {'id': 13, 'name': 'Bluray-480p', 'source': 'bluray', 'resolution': 480}, 'allowed': False}, {'quality': {'id': 4, 'name': 'HDTV-720p', 'source': 'television', 'resolution': 720}, 'allowed': True}, {'quality': {'id': 9, 'name': 'HDTV-1080p', 'source': 'television', 'resolution': 1080}, 'allowed': True}, {'quality': {'id': 10, 'name': 'Raw-HD', 'source': 'televisionRaw', 'resolution': 1080}, 'allowed': False}, {'quality': {'id': 14, 'name': 'WEBRip-720p', 'source': 'webRip', 'resolution': 720}, 'allowed': True}, {'quality': {'id': 5, 'name': 'WEBDL-720p', 'source': 'web', 'resolution': 720}, 'allowed': True}, {'quality': {'id': 6, 'name': 'Bluray-720p', 'source': 'bluray', 'resolution': 720}, 'allowed': True}, {'quality': {'id': 15, 'name': 'WEBRip-1080p', 'source': 'webRip', 'resolution': 1080}, 'allowed': True}, {'quality': {'id': 3, 'name': 'WEBDL-1080p', 'source': 'web', 'resolution': 1080}, 'allowed': True}, {'quality': {'id': 7, 'name': 'Bluray-1080p', 'source': 'bluray', 'resolution': 1080}, 'allowed': True}, {'quality': {'id': 20, 'name': 'Bluray-1080p Remux', 'source': 'blurayRaw', 'resolution': 1080}, 'allowed': False}, {'quality': {'id': 16, 'name': 'HDTV-2160p', 'source': 'television', 'resolution': 2160}, 'allowed': False}, {'quality': {'id': 17, 'name': 'WEBRip-2160p', 'source': 'webRip', 'resolution': 2160}, 'allowed': False}, {'quality': {'id': 18, 'name': 'WEBDL-2160p', 'source': 'web', 'resolution': 2160}, 'allowed': False}, {'quality': {'id': 19, 'name': 'Bluray-2160p', 'source': 'bluray', 'resolution': 2160}, 'allowed': False}, {'quality': {'id': 21, 'name': 'Bluray-2160p Remux', 'source': 'blurayRaw', 'resolution': 2160}, 'allowed': False}], 'id': 6}] 2022-11-09 00:01:15,075 - DEBUG - searcharr(140520535554888):96 - Using the following Sonarr quality profile(s): [(7, '720p'), (6, 'HD - 720p/1080p')] 2022-11-09 00:01:15,075 - WARNING - searcharr(140520535554888):118 - No valid Sonarr root folder(s) provided! Using all of the root folders I found in Sonarr: [{'path': '/downloads/series/', 'freeSpace': 138618433536, 'totalSpace': 491107581952, 'id': 3}, {'path': '/downloads/series2/', 'freeSpace': 736768770048, 'totalSpace': 965790089216, 'id': 4}] 2022-11-09 00:01:15,076 - DEBUG - searcharr.radarr(140520535554888):17 - Logging started! 2022-11-09 00:01:15,076 - DEBUG - searcharr.radarr(140520535554888):146 - Submitting GET request: [http://192.168.10.242:7878/api/v3/system/status?apikey=8529635812094b7ca08d31c992147369] 2022-11-09 00:01:15,079 - DEBUG - searcharr.radarr(140520535554888):34 - Discovered Radarr version 4.2.4.6635. Using v3 api. 2022-11-09 00:01:15,079 - DEBUG - searcharr.radarr(140520535554888):146 - Submitting GET request: [http://192.168.10.242:7878/api/v3/qualityProfile?apikey=8529635812094b7ca08d31c992147369] 2022-11-09 00:01:15,082 - DEBUG - searcharr.radarr(140520535554888):146 - Submitting GET request: [http://192.168.10.242:7878/api/v3/RootFolder?apikey=8529635812094b7ca08d31c992147369] 2022-11-09 00:01:15,088 - DEBUG - searcharr(140520535554888):176 - Looking up/validating Radarr quality profile id for [HD - 720p/1080p]... 2022-11-09 00:01:15,088 - DEBUG - searcharr(140520535554888):183 - Found Radarr quality profile for [HD - 720p/1080p]: [{'name': 'HD - 720p/1080p', 'upgradeAllowed': False, 'cutoff': 30, 'items': [{'quality': {'id': 0, 'name': 'Unknown', 'source': 'unknown', 'resolution': 0, 'modifier': 'none'}, 'items': [], 'allowed': False}, {'quality': {'id': 24, 'name': 'WORKPRINT', 'source': 'workprint', 'resolution': 0, 'modifier': 'none'}, 'items': [], 'allowed': False}, {'quality': {'id': 25, 'name': 'CAM', 'source': 'cam', 'resolution': 0, 'modifier': 'none'}, 'items': [], 'allowed': False}, {'quality': {'id': 26, 'name': 'TELESYNC', 'source': 'telesync', 'resolution': 0, 'modifier': 'none'}, 'items': [], 'allowed': False}, {'quality': {'id': 27, 'name': 'TELECINE', 'source': 'telecine', 'resolution': 0, 'modifier': 'none'}, 'items': [], 'allowed': False}, {'quality': {'id': 29, 'name': 'REGIONAL', 'source': 'dvd', 'resolution': 480, 'modifier': 'regional'}, 'items': [], 'allowed': False}, {'quality': {'id': 28, 'name': 'DVDSCR', 'source': 'dvd', 'resolution': 480, 'modifier': 'screener'}, 'items': [], 'allowed': False}, {'quality': {'id': 1, 'name': 'SDTV', 'source': 'tv', 'resolution': 480, 'modifier': 'none'}, 'items': [], 'allowed': False}, {'quality': {'id': 2, 'name': 'DVD', 'source': 'dvd', 'resolution': 480, 'modifier': 'none'}, 'items': [], 'allowed': False}, {'quality': {'id': 23, 'name': 'DVD-R', 'source': 'dvd', 'resolution': 480, 'modifier': 'remux'}, 'items': [], 'allowed': False}, {'name': 'WEB 480p', 'items': [{'quality': {'id': 8, 'name': 'WEBDL-480p', 'source': 'webdl', 'resolution': 480, 'modifier': 'none'}, 'items': [], 'allowed': False}, {'quality': {'id': 12, 'name': 'WEBRip-480p', 'source': 'webrip', 'resolution': 480, 'modifier': 'none'}, 'items': [], 'allowed': False}], 'allowed': False, 'id': 1000}, {'quality': {'id': 20, 'name': 'Bluray-480p', 'source': 'bluray', 'resolution': 480, 'modifier': 'none'}, 'items': [], 'allowed': False}, {'quality': {'id': 21, 'name': 'Bluray-576p', 'source': 'bluray', 'resolution': 576, 'modifier': 'none'}, 'items': [], 'allowed': False}, {'quality': {'id': 4, 'name': 'HDTV-720p', 'source': 'tv', 'resolution': 720, 'modifier': 'none'}, 'items': [], 'allowed': True}, {'name': 'WEB 720p', 'items': [{'quality': {'id': 5, 'name': 'WEBDL-720p', 'source': 'webdl', 'resolution': 720, 'modifier': 'none'}, 'items': [], 'allowed': True}, {'quality': {'id': 14, 'name': 'WEBRip-720p', 'source': 'webrip', 'resolution': 720, 'modifier': 'none'}, 'items': [], 'allowed': True}], 'allowed': True, 'id': 1001}, {'quality': {'id': 6, 'name': 'Bluray-720p', 'source': 'bluray', 'resolution': 720, 'modifier': 'none'}, 'items': [], 'allowed': True}, {'quality': {'id': 9, 'name': 'HDTV-1080p', 'source': 'tv', 'resolution': 1080, 'modifier': 'none'}, 'items': [], 'allowed': True}, {'name': 'WEB 1080p', 'items': [{'quality': {'id': 3, 'name': 'WEBDL-1080p', 'source': 'webdl', 'resolution': 1080, 'modifier': 'none'}, 'items': [], 'allowed': True}, {'quality': {'id': 15, 'name': 'WEBRip-1080p', 'source': 'webrip', 'resolution': 1080, 'modifier': 'none'}, 'items': [], 'allowed': True}], 'allowed': True, 'id': 1002}, {'quality': {'id': 7, 'name': 'Bluray-1080p', 'source': 'bluray', 'resolution': 1080, 'modifier': 'none'}, 'items': [], 'allowed': True}, {'quality': {'id': 30, 'name': 'Remux-1080p', 'source': 'bluray', 'resolution': 1080, 'modifier': 'remux'}, 'items': [], 'allowed': True}, {'quality': {'id': 16, 'name': 'HDTV-2160p', 'source': 'tv', 'resolution': 2160, 'modifier': 'none'}, 'items': [], 'allowed': False}, {'name': 'WEB 2160p', 'items': [{'quality': {'id': 18, 'name': 'WEBDL-2160p', 'source': 'webdl', 'resolution': 2160, 'modifier': 'none'}, 'items': [], 'allowed': False}, {'quality': {'id': 17, 'name': 'WEBRip-2160p', 'source': 'webrip', 'resolution': 2160, 'modifier': 'none'}, 'items': [], 'allowed': False}], 'allowed': False, 'id': 1003}, {'quality': {'id': 19, 'name': 'Bluray-2160p', 'source': 'bluray', 'resolution': 2160, 'modifier': 'none'}, 'items': [], 'allowed': False}, {'quality': {'id': 31, 'name': 'Remux-2160p', 'source': 'bluray', 'resolution': 2160, 'modifier': 'remux'}, 'items': [], 'allowed': False}, {'quality': {'id': 22, 'name': 'BR-DISK', 'source': 'bluray', 'resolution': 1080, 'modifier': 'brdisk'}, 'items': [], 'allowed': False}, {'quality': {'id': 10, 'name': 'Raw-HD', 'source': 'tv', 'resolution': 1080, 'modifier': 'rawhd'}, 'items': [], 'allowed': False}], 'minFormatScore': 0, 'cutoffFormatScore': 0, 'formatItems': [], 'language': {'id': -2, 'name': 'Original'}, 'id': 6}] 2022-11-09 00:01:15,088 - DEBUG - searcharr(140520535554888):192 - Using the following Radarr quality profile(s): [(6, 'HD - 720p/1080p')] 2022-11-09 00:01:15,088 - WARNING - searcharr(140520535554888):214 - No valid Radarr root folder(s) provided! Using all of the root folders I found in Radarr: [{'path': '/downloads/movies', 'freeSpace': 138618433536, 'totalSpace': None, 'id': 1}, {'path': '/downloads/movies2', 'freeSpace': 736768770048, 'totalSpace': None, 'id': 2}] 2022-11-09 00:01:15,089 - DEBUG - searcharr(140520535554888):1693 - Database connection established [/app/data/searcharr.db]. 2022-11-09 00:01:15,089 - DEBUG - searcharr(140520535554888):1725 - Executing query: [CREATE TABLE IF NOT EXISTS conversations ( id text primary key, username text not null, type text, results text );] with no args... 2022-11-09 00:01:15,089 - DEBUG - searcharr(140520535554888):1725 - Executing query: [CREATE TABLE IF NOT EXISTS users ( id integer primary key, username text not null, admin text, permissions text );] with no args... 2022-11-09 00:01:15,089 - DEBUG - searcharr(140520535554888):1725 - Executing query: [CREATE TABLE IF NOT EXISTS add_data ( cid text, key text, value text, primary key (cid, key) );] with no args... 2022-11-09 00:01:15,090 - DEBUG - searcharr(140520535554888):1415 - Registering [/help] as a help command 2022-11-09 00:01:15,090 - DEBUG - searcharr(140520535554888):1418 - Registering [/start] as a start command 2022-11-09 00:01:15,090 - DEBUG - searcharr(140520535554888):1421 - Registering [/1TB.movies] as a movie command 2022-11-09 00:01:15,857 - INFO - searcharr(140537273850696):64 - Searcharr v2.2 - Logging started!

I've already deleted the db and recreated the container, but the issue still remains! :(

toddrob99 commented 1 year ago

It is trying to register the command you configured for movies:

Registering [/1TB.movies] as a movie command

I don't think Telegram likes that command, it I don't know if it's because of the 1 or the dot. I suggest removing one or both of those characters and trying again.

axelmvt commented 1 year ago

Removing the . on the command solved the issue. So far the bot is working :D !! Thanks for your time Todd!

toddrob99 commented 1 year ago

Please note your API keys are in the log you posted. If your Sonarr or Radarr instances are exposed to the internet, I suggest generating new API keys in your Sonarr & Radarr settings.

axelmvt commented 1 year ago

Yeah I know, they are fake API keys. Thanks for the heads-up :D