diff --git a/README.md b/README.md index fac834a..873f899 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ of last week. ``` twoot.py [-h] -t -i -m -p [-r] + account> -p [-r] [-v] [-a ] [-d ] ``` @@ -42,19 +42,19 @@ is @superduperbot@botsin.space |Switch |Description | Example | Req | |-------|--------------------------------------------------|--------------------|-----| -| -t | twitter account name without '@' | `SuperDuperBot` | Yes | +| -t | twitter account name without '@' | `SuperDuper` | Yes | | -i | Mastodon instance domain name | `botsin.space` | Yes | | -m | Mastodon username | `superduperbot` | Yes | | -p | Mastodon password | `my_Sup3r-S4f3*pw` | Yes | | -v | upload videos to Mastodon | *N/A* | No | | -r | Post reply-to tweets (ignored by default) | *N/A* | No | -| -a | Max. age of tweet to post (in days) | `1` | No | +| -a | Max. age of tweet to post (in days) | `5` | No | | -d | Min. delay before posting new tweet (in minutes) | `15` | No | When using the `-v` switch consider: -* The copyright of the content that you want to cross-post -* The storage / transfer limitations of the Mastodon instance that you are posting to -* The upstream bandwidth that you may consume on your internet connection +* whether the copyright of the content that you want to cross-post allows it +* the storage / transfer limitations of the Mastodon instance that you are posting to +* the upstream bandwidth that you may consume on your internet connection Default max age is 1 day. Decimal values are OK. @@ -64,13 +64,15 @@ Default min delay is 0 minutes. Make sure python3 is installed. -Twoot depends on beautifulsoup4 and mastodon python module. It also -requires m3u8 and ffmpeg-python. +Twoot depends on `beautifulsoup4` and `Mastodon.py` python modules. -ffmpeg must also be installed. - - pip install beautifulsoup4 Mastodon.py m3u8 ffmpeg-python +If you plan to use the `-v` switch to download videos, the additional depedencies are required: +* Python modules `m3u8` and `ffmpeg-python` +* [ffmpeg](https://ffmpeg.org/download.html) (check the package manager of your distribution) +``` +> pip install beautifulsoup4 Mastodon.py m3u8 ffmpeg-python +``` In your user folder, execute `git clone https://gitlab.com/jeancf/twoot.git` to clone repo with twoot.py script. diff --git a/twoot.py b/twoot.py index 2abc50b..a8e4dc4 100755 --- a/twoot.py +++ b/twoot.py @@ -126,9 +126,10 @@ def cleanup_tweet_text(tt_iter, tweet_uri, get_vids): data_expanded_path = tag['data-expanded-path'] if 'video' in data_expanded_path: if get_vids: - # Download video from twitter and store in filesystem - # TODO set output location to ./output/twit_account + # Download video from twitter and store in filesystem. Running as subprocess to avoid + # requirement to install ffmpeg and ffmpeg-python for those that do not want to post videos try: + # TODO set output location to ./output/twit_account dl_feedback = subprocess.run(["./twitterdl.py", tweet_uri, "-w 500"], capture_output=True) if dl_feedback.returncode != 0: # TODO Log dl_feedback.stderr