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 return ret
def login(instance, account, password): def login(instance, account, password):
# Create Mastodon application if it does not exist yet # Create Mastodon application if it does not exist yet
if not os.path.isfile(instance + '.secret'): if not os.path.isfile(instance + '.secret'):
@ -305,7 +306,7 @@ def main(argv):
mastodon_instance, mastodon_account, tweet_id)''') mastodon_instance, mastodon_account, tweet_id)''')
# Select random nitter instance to fetch updates from # 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 # 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) logging.info('Nitter page downloaded successfully from ' + url)
# DEBUG: Save page to file # DEBUG: Save page to file
#of = open(twit_account + '.html', 'w') # of = open(twit_account + '.html', 'w')
#of.write(twit_account_page.text) # of.write(twit_account_page.text)
#of.close() # of.close()
# Make soup # Make soup
soup = BeautifulSoup(twit_account_page.text, 'html.parser') 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') logging.info(str(in_db_cnt) + ' tweets already in database')
# DEBUG: Print extracted tweets # DEBUG: Print extracted tweets
#for t in tweets: # for t in tweets:
#print(t) # print(t)
# Login to account on maston instance # Login to account on maston instance
mastodon = None mastodon = None
@ -550,7 +551,7 @@ def main(argv):
logging.debug("Uploading video failed") logging.debug("Uploading video failed")
pass pass
else: # Only upload pic if no video was uploaded else: # Only upload pic if no video_file_listdeo was uploaded
# Upload photos # Upload photos
for photo in tweet['photos']: for photo in tweet['photos']:
media = False media = False