Skip to content

Commit

Permalink
Fixed error freezing everything
Browse files Browse the repository at this point in the history
More explanations about it on: bear/python-twitter#695
  • Loading branch information
LilithL authored Aug 25, 2021
1 parent 5a6f2ea commit 0aeea76
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,9 @@ def tweet_parser(twi_api, texte, toot_cont_warn, last_tweet_id=None, toot_media=
else:
formated_cw = ""

# Calculate the max link size depending on the number of medias
if len(toot_media) > 0:
url_lenght = len(toot_media) * twi_api.GetShortUrlLength(https=True)
else:
url_lenght = 0

if not any(word in toot_cont_warn.lower() for word in PARAMS['no_cp_indicators'].split(',')):
texte = Masto_crosspost_utils.process_toot_to_chunks(
texte, int(PARAMS['twi_limit']) - len(formated_cw) - url_lenght)
texte, int(PARAMS['twi_limit']) - len(formated_cw))
for contenu in texte:
try:
last_tweet_id = twi_api.PostUpdate(status=formated_cw + contenu, in_reply_to_status_id=last_tweet_id,
Expand Down

0 comments on commit 0aeea76

Please sign in to comment.