OG instructions below but I changed a couple things
- the script assumes that the database and cookies are in
/data
- so in dockermain.py
is in/app
and then you should volume mount in the directory with the cookies and db to/data
inside the container running the bot
A simple Telegram bot to send urls from a Telegram chat to Archivebox.
Archivebox
Python-telegram-bot module
- Download the script and put it in the archivebox directory containing the
index.sqlite3
database. - Go to your Archivebox webpage and export the cookies to a
cookies.txt
file and put it in the same directory. Chrome extension - Paste your ArchiveBox url on line 6.
- Place the chatids of the chats on which you want the bot to respond to on line 7.
- Create a telegram bot and paste the token on line 8
- Go to your Archivebox and add an url. While you do so open the dev console of your browser and find the
csrfmiddlewaretoken
in the request header section. - Paste the
csrfmiddlewaretoken
on line 9. - Now run the bot. Every url you send to the bot will be archived by Archivebox.
/help
Show info about bot.
/get <url>
Get latest archived version of the url from Archivebox.
/get all <keyword>
Get all urls in archivebox containing keyword
in part of the url.