Cosmetic changes

This commit is contained in:
jeancf 2022-09-14 16:28:48 +02:00
parent 4ccce6aac1
commit bfbe9704f7

View File

@ -200,6 +200,7 @@ def is_time_valid(timestamp, max_age, min_delay):
return ret
def login(instance, account, password):
# Create Mastodon application if it does not exist yet
if not os.path.isfile(instance + '.secret'):
@ -305,7 +306,7 @@ def main(argv):
mastodon_instance, mastodon_account, tweet_id)''')
# Select random nitter instance to fetch updates from
nitter_url = NITTER_URLS[random.randint(0, len(NITTER_URLS)-1)]
nitter_url = NITTER_URLS[random.randint(0, len(NITTER_URLS) - 1)]
# **********************************************************
# Load twitter page of user. Process all tweets and generate
@ -348,9 +349,9 @@ def main(argv):
logging.info('Nitter page downloaded successfully from ' + url)
# DEBUG: Save page to file
#of = open(twit_account + '.html', 'w')
#of.write(twit_account_page.text)
#of.close()
# of = open(twit_account + '.html', 'w')
# of.write(twit_account_page.text)
# of.close()
# Make soup
soup = BeautifulSoup(twit_account_page.text, 'html.parser')
@ -516,8 +517,8 @@ def main(argv):
logging.info(str(in_db_cnt) + ' tweets already in database')
# DEBUG: Print extracted tweets
#for t in tweets:
#print(t)
# for t in tweets:
# print(t)
# Login to account on maston instance
mastodon = None
@ -550,7 +551,7 @@ def main(argv):
logging.debug("Uploading video failed")
pass
else: # Only upload pic if no video was uploaded
else: # Only upload pic if no video_file_listdeo was uploaded
# Upload photos
for photo in tweet['photos']:
media = False