Compare commits

..

No commits in common. "98eecc2f590c3518d7aa84d693e896594715c529" and "640429663129e2fe0a4254c8bd76ba8a8b3baae5" have entirely different histories.

3 changed files with 8 additions and 10 deletions

View File

@ -1,14 +1,13 @@
# Changelog # Changelog
**21 DEC 2022** VERSION 3.1.1 **11 DEC 2022**
Modified code that made twoot incompatible with python versions < 3.10
**11 DEC 2022** VERSION 3.1 HOTFIX VERSION 3.1 HOTFIX
* Added missing `default.toml` file * Added missing `default.toml` file
* Corrected a bug that could cause an infinity loop when log file is empty * Corrected a bug that could cause an infinity loop when log file is empty
**11 DEC 2022** VERSION 3.0 brings some important changes and new features: VERSION 3.0 brings some important changes and new features:
* Only potentially breaking change: **If you are using a version of python < 3.11 you need to install the `tomli` module** * Only potentially breaking change: **If you are using a version of python < 3.11 you need to install the `tomli` module**
* Twoot can be configured with a config file in [TOML](https://toml.io/) format. Check `default.toml` for details * Twoot can be configured with a config file in [TOML](https://toml.io/) format. Check `default.toml` for details
@ -21,6 +20,7 @@ Modified code that made twoot incompatible with python versions < 3.10
* The verbosity of logging messages can be set in the config file with `log_level=`. * The verbosity of logging messages can be set in the config file with `log_level=`.
* Config file option `log_days =` specifies how long to keep log messages in file. Older messages are deleted. * 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 **23 NOV 2022** VERSION 2.5 Added command-line option (`-l`) to remove
redirection from links included in tweets. Obfuscated links are replaced redirection from links included in tweets. Obfuscated links are replaced
by the URL that the resource is directly downloaded from. Also improved by the URL that the resource is directly downloaded from. Also improved

View File

@ -3,10 +3,9 @@
Twoot is a python script that mirrors tweets from a twitter account to a Mastodon account. 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. It is simple to set-up on a local machine, configurable and feature-rich.
**UPDATE XX JAN 2023** VERSION 3.1.2 **UPDATE 21 DEC 2022** VERSION 3.1.1
* *Posting Privacy* setting of the Mastodon account now defines visibility of toots posted with Twoot Modified code that made twoot incompatible with python versions < 3.10
* Modified URL building for compatibility with Windows
> Previous updates can be found in CHANGELOG. > Previous updates can be found in CHANGELOG.

View File

@ -30,7 +30,7 @@ import sqlite3
import sys import sys
import time import time
from pathlib import Path from pathlib import Path
from urllib.parse import urlparse, parse_qsl, urlencode, urlunparse, urljoin from urllib.parse import urlparse, parse_qsl, urlencode, urlunparse
import requests import requests
from bs4 import BeautifulSoup, element from bs4 import BeautifulSoup, element
@ -424,8 +424,7 @@ def process_attachments(nitter_url, attachments_container, status_id, author_acc
if TOML['options']['upload_videos']: if TOML['options']['upload_videos']:
import youtube_dl import youtube_dl
video_path = f"{author_account}/status/{status_id}" video_file = os.path.join('https://twitter.com', author_account, 'status', status_id)
video_file = urljoin('https://twitter.com', video_path)
ydl_opts = { ydl_opts = {
'outtmpl': "output/" + TOML['config']['twitter_account'] + "/" + status_id + "/%(id)s.%(ext)s", 'outtmpl': "output/" + TOML['config']['twitter_account'] + "/" + status_id + "/%(id)s.%(ext)s",
'format': "best[width<=500]", 'format': "best[width<=500]",