From 092f2ab3711c965af91e0ca3d963fc8dc62e8e32 Mon Sep 17 00:00:00 2001 From: JC Francois Date: Sun, 5 Apr 2020 10:37:54 +0200 Subject: [PATCH] Cleanup and README.md update for release --- README.md | 12 ++++++++++-- twitterdl.py | 22 ++++++++++++++++++++++ twoot.py | 5 +++-- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 873f899..585777f 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,17 @@ +# Twoot + +Twoot is a python script that extracts tweets from a twitter feed and +reposts them as toots on a Mastodon account. + I started twoot when [tootbot](https://github.com/cquest/tootbot) stopped working. Tootbot relies on rss feeds from https://twitrss.me that broke when Twitter refreshed their web UI in July 2019. Instead twoot is self contained and handles all the processing. +**UPDATE 05 APR 2020** VERSION 1.0. Twoot can now optionally download +videos from Twitter and upload them on Mastodon. + **UPDATE 17 MAR 2020** Added command line switch (`-r`) to also post reply-to tweets on the mastodon account. They will not be included by default anymore. @@ -66,9 +74,9 @@ Make sure python3 is installed. Twoot depends on `beautifulsoup4` and `Mastodon.py` python modules. -If you plan to use the `-v` switch to download videos, the additional depedencies are required: +**Only If you plan to download videos** with the `-v` switch, are the additional dependencies required: * Python modules `m3u8` and `ffmpeg-python` -* [ffmpeg](https://ffmpeg.org/download.html) (check the package manager of your distribution) +* [ffmpeg](https://ffmpeg.org/download.html) (installed with the package manager of your distribution) ``` > pip install beautifulsoup4 Mastodon.py m3u8 ffmpeg-python diff --git a/twitterdl.py b/twitterdl.py index 3ba32fb..984f6a9 100755 --- a/twitterdl.py +++ b/twitterdl.py @@ -1,5 +1,27 @@ #! /usr/bin/env python3 +""" + This file is a modification of + https://github.com/h4ckninja/twitter-video-downloader/ + The original package has an unknown license. The modified version + is released here under GPL v3. + + Copyright (C) 2019 Jean-Christophe Francois + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +""" + import argparse import requests import json diff --git a/twoot.py b/twoot.py index ec80a7e..0c65369 100755 --- a/twoot.py +++ b/twoot.py @@ -1,7 +1,7 @@ #! /usr/bin/env python3 # -*- coding: utf-8 -*- -''' +""" Copyright (C) 2019 Jean-Christophe Francois This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . -''' +""" import sys import argparse @@ -551,5 +551,6 @@ def main(argv): except FileNotFoundError: # The directory does not exist pass + if __name__ == "__main__": main(sys.argv)