usercount icon indicating copy to clipboard operation
usercount copied to clipboard

ValueError: substring not found

Open ghost opened this issue 7 years ago • 1 comments

Hi, I've a got a "locale" problem between Mastodon and usercount bot. When i put in .env.production file of Mastodon : DEFAULT_LOCALE=fr then usercount stop working and give an error :

Traceback (most recent call last): File "usercount.py", line 98, in current_id = int( get_between(pagecontent, "Home to", "users").replace(",", "")) File "usercount.py", line 92, in get_between return s[(s.index(substring1)+len(substring1)):s.index(substring2)] ValueError: substring not found

ghost avatar Apr 20 '17 07:04 ghost

its caused by these lines: Get the number of users, removing commas current_id = int( get_between(pagecontent, "Home to", "users").replace(",", ""))

Get the number of toots, removing commas num_toots = int (get_between(pagecontent, "Who authored", "statuses").replace(",", ""))

try to replace Home to, users, Who authored and statuses .

csabyka avatar Aug 22 '18 05:08 csabyka