mirror of
https://gitlab.com/jeancf/twoot.git
synced 2025-02-23 16:38:42 +00:00
Compare commits
No commits in common. "bfe3aa050e436b24ad88fac7441d7c94b7ce9a91" and "341ba582c28522e3f8cc6df46e1aef34a5e8f9b4" have entirely different histories.
bfe3aa050e
...
341ba582c2
@ -1,17 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
**01 FEB 2023** VERSION 3.1.3
|
||||
|
||||
* Fixed *remove link redirections* option that would not work in some cases
|
||||
* Added `utm_brand` to list of blacklisted query parameters removed by *remove trackers from URLs* option
|
||||
|
||||
**04 JAN 2023** VERSION 3.1.2
|
||||
|
||||
* *Posting Privacy* setting of the Mastodon account now defines visibility of toots posted with Twoot
|
||||
* Modified URL building for compatibility with Windows
|
||||
|
||||
**21 DEC 2022** VERSION 3.1.1
|
||||
|
||||
Modified code that made twoot incompatible with python versions < 3.10
|
||||
|
||||
**11 DEC 2022** VERSION 3.1 HOTFIX
|
||||
@ -33,6 +27,7 @@ Modified code that made twoot incompatible with python versions < 3.10
|
||||
* Config file option `log_days =` specifies how long to keep log messages in file. Older messages are deleted.
|
||||
|
||||
**23 NOV 2022** VERSION 2.5 Added command-line option (`-l`) to remove
|
||||
redirection from links included in tweets. Obfuscated links are replaced
|
||||
by the URL that the resource is directly downloaded from. Also improved
|
||||
tracker removal by cleaning URL fragments as well (contrib: mathdatech,
|
||||
thanks!).
|
||||
|
@ -3,9 +3,10 @@
|
||||
Twoot is a python script that mirrors tweets from a twitter account to a Mastodon account.
|
||||
It is simple to set-up on a local machine, configurable and feature-rich.
|
||||
|
||||
**15/02/2023** VERSION 3.2 Added mitigation for Mastodon API error 422, 'Unprocessable Entity',
|
||||
'Cannot attach files that have not finished processing. Try again in a moment!' reported
|
||||
on some instances when posting toots with video.
|
||||
**UPDATE 01 FEB 2023** VERSION 3.1.3
|
||||
|
||||
* Fixed *remove link redirections* option that would not work in some cases
|
||||
* Added `utm_brand` to list of blacklisted query parameters removed by *remove trackers from URLs* option
|
||||
|
||||
> Previous updates can be found in CHANGELOG.
|
||||
|
||||
|
18
twoot.py
18
twoot.py
@ -981,24 +981,16 @@ def main(argv):
|
||||
# Post toot
|
||||
toot = {}
|
||||
try:
|
||||
mastodon = Mastodon(
|
||||
access_token=TOML['config']['mastodon_user'] + '.secret',
|
||||
api_base_url='https://' + TOML['config']['mastodon_instance']
|
||||
)
|
||||
|
||||
if len(media_ids) == 0:
|
||||
toot = mastodon.status_post(tweet['tweet_text'])
|
||||
else:
|
||||
toot = mastodon.status_post(tweet['tweet_text'], media_ids=media_ids)
|
||||
|
||||
except MastodonAPIError:
|
||||
# Assuming this is an:
|
||||
# ERROR ('Mastodon API returned error', 422, 'Unprocessable Entity', 'Cannot attach files that have not finished processing. Try again in a moment!')
|
||||
logging.warning('Mastodon API Error 422: Cannot attach files that have not finished processing. Waiting 15 seconds and retrying.')
|
||||
# Wait 15 seconds
|
||||
time.sleep(15)
|
||||
# retry posting
|
||||
try:
|
||||
toot = mastodon.status_post(tweet['tweet_text'], media_ids=media_ids)
|
||||
except MastodonError as me:
|
||||
logging.error('posting ' + tweet['tweet_text'] + ' to ' + TOML['config']['mastodon_instance'] + ' Failed')
|
||||
logging.error(me)
|
||||
|
||||
except MastodonError as me:
|
||||
logging.error('posting ' + tweet['tweet_text'] + ' to ' + TOML['config']['mastodon_instance'] + ' Failed')
|
||||
logging.error(me)
|
||||
|
Loading…
x
Reference in New Issue
Block a user