Compare commits

..

2 Commits

Author SHA1 Message Date
jeancf
98eecc2f59 Documented release 2023-01-03 11:08:00 +01:00
jeancf
97f6187e40 Correction of URL building 2023-01-03 11:00:41 +01:00
3 changed files with 10 additions and 8 deletions

View File

@ -1,13 +1,14 @@
# Changelog
**11 DEC 2022**
**21 DEC 2022** VERSION 3.1.1
Modified code that made twoot incompatible with python versions < 3.10
VERSION 3.1 HOTFIX
**11 DEC 2022** VERSION 3.1 HOTFIX
* Added missing `default.toml` file
* Corrected a bug that could cause an infinity loop when log file is empty
VERSION 3.0 brings some important changes and new features:
**11 DEC 2022** 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**
* Twoot can be configured with a config file in [TOML](https://toml.io/) format. Check `default.toml` for details
@ -20,7 +21,6 @@ VERSION 3.0 brings some important changes and new features:
* 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.
**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

View File

@ -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.
**UPDATE 21 DEC 2022** VERSION 3.1.1
**UPDATE XX JAN 2023** VERSION 3.1.2
Modified code that made twoot incompatible with python versions < 3.10
* *Posting Privacy* setting of the Mastodon account now defines visibility of toots posted with Twoot
* Modified URL building for compatibility with Windows
> Previous updates can be found in CHANGELOG.

View File

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