mirror of
https://gitlab.com/jeancf/twoot.git
synced 2025-02-21 07:42:08 +00:00
Replaced suppress_retweets and get_vids
This commit is contained in:
parent
99a63463d3
commit
739009ba97
17
twoot.py
17
twoot.py
|
@ -386,21 +386,22 @@ def main(argv):
|
||||||
toml['options']['tweet_delay'] = float(args['d'])
|
toml['options']['tweet_delay'] = float(args['d'])
|
||||||
if args['c'] is not None:
|
if args['c'] is not None:
|
||||||
toml['options']['toot_cap'] = int(args['c'])
|
toml['options']['toot_cap'] = int(args['c'])
|
||||||
|
mast_password = args['p']
|
||||||
|
|
||||||
# Verify that we have a minimum config to run
|
# Verify that we have a minimum config to run
|
||||||
if 'twitter_account' not in toml['config'].keys():
|
if 'twitter_account' not in toml['config'].keys():
|
||||||
print('Missing Twitter account')
|
print('CRITICAL: Missing Twitter account')
|
||||||
exit(-1)
|
exit(-1)
|
||||||
if 'mastodon_instance' not in toml['config'].keys():
|
if 'mastodon_instance' not in toml['config'].keys():
|
||||||
print('Missing Mastodon instance')
|
print('CRITICAL: Missing Mastodon instance')
|
||||||
exit(-1)
|
exit(-1)
|
||||||
if 'mastodon_user' not in toml['config'].keys():
|
if 'mastodon_user' not in toml['config'].keys():
|
||||||
print('Missing Mastodon user')
|
print('CRITICAL: Missing Mastodon user')
|
||||||
|
exit(-1)
|
||||||
|
if mast_password is None:
|
||||||
|
print('CRITICAL: Missing Mastodon user password')
|
||||||
exit(-1)
|
exit(-1)
|
||||||
|
|
||||||
# mast_password = args['p']
|
|
||||||
# suppress_retweets = args['s']
|
|
||||||
# get_vids = args['v']
|
|
||||||
# remove_trackers = args['u']
|
# remove_trackers = args['u']
|
||||||
# max_age = float(args['a'])
|
# max_age = float(args['a'])
|
||||||
# min_delay = float(args['d'])
|
# min_delay = float(args['d'])
|
||||||
|
@ -539,7 +540,7 @@ def main(argv):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Check if retweets must be skipped
|
# Check if retweets must be skipped
|
||||||
if suppress_retweets:
|
if toml['options']['skip_retweets']:
|
||||||
# Check if this tweet is a retweet
|
# Check if this tweet is a retweet
|
||||||
if len(status.select("div.tweet-body > div > div.retweet-header")) != 0:
|
if len(status.select("div.tweet-body > div > div.retweet-header")) != 0:
|
||||||
logging.debug("Retweet ignored per command-line configuration")
|
logging.debug("Retweet ignored per command-line configuration")
|
||||||
|
@ -602,7 +603,7 @@ def main(argv):
|
||||||
# Process attachment: capture image or .mp4 url or download twitter video
|
# Process attachment: capture image or .mp4 url or download twitter video
|
||||||
attachments_class = status.find('div', class_='attachments')
|
attachments_class = status.find('div', class_='attachments')
|
||||||
if attachments_class is not None:
|
if attachments_class is not None:
|
||||||
pics, vid_in_tweet = process_attachments(nitter_url, attachments_class, get_vids, toml['config']['twitter_account'], status_id,
|
pics, vid_in_tweet = process_attachments(nitter_url, attachments_class, toml['options']['upload_videos'], toml['config']['twitter_account'], status_id,
|
||||||
author_account)
|
author_account)
|
||||||
photos.extend(pics)
|
photos.extend(pics)
|
||||||
if vid_in_tweet:
|
if vid_in_tweet:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user