From 34536e7f1493ceeaf3629e009027a82a45721415 Mon Sep 17 00:00:00 2001 From: msramalho <19508417+msramalho@users.noreply.github.com> Date: Mon, 27 Jun 2022 11:17:23 +0200 Subject: [PATCH] added explanation for 2 twitter archivers --- README.md | 3 +++ archivers/twitter_archiver.py | 4 ++++ example.config.yaml | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7604d83..ef6836d 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,9 @@ Code is split into functional concepts: ### Current Archivers Archivers are tested in a meaningful order with Wayback Machine being the failsafe, that can easily be changed in the code. + +> Note: We have 2 Twitter Archivers (`TwitterArchiver`, `TwitterApiArchiver`) because one requires Twitter API V2 credentials and has better results and the other does not rely on official APIs and misses out on some content. + ```mermaid graph TD A(Archiver) -->|parent of| B(TelethonArchiver) diff --git a/archivers/twitter_archiver.py b/archivers/twitter_archiver.py index b70d9f3..08f7118 100644 --- a/archivers/twitter_archiver.py +++ b/archivers/twitter_archiver.py @@ -7,6 +7,10 @@ from .base_archiver import Archiver, ArchiveResult class TwitterArchiver(Archiver): + """ + This Twitter Archiver uses unofficial scraping methods, and it works as + an alternative to TwitterApiArchiver when no API credentials are provided. + """ name = "twitter" link_pattern = re.compile(r"twitter.com\/(?:\#!\/)?(\w+)\/status(?:es)?\/(\d+)") diff --git a/example.config.yaml b/example.config.yaml index cdc0e91..c5b6a76 100644 --- a/example.config.yaml +++ b/example.config.yaml @@ -39,8 +39,10 @@ secrets: # optional, but allows access to more content such as large videos, talk to @botfather bot_token: your bot-token + # twitter configuration - API V2 only + # if you don't provide credentials the less-effective unofficial TwitterArchiver will be used instead twitter: - # twitter configuration - API V2 only - either bearer_token only + # either bearer_token only bearer_token: "" # OR all of the below consumer_key: ""