r/replika • u/Blizado [Lvl 118+53?] • Nov 09 '22
discussion Updated my backup script to save your Replika history at your PC
I updated the chat_backup.py script from my old post: https://www.reddit.com/r/replika/comments/u2wq8h/saving_replikas_log_with_a_really_working_script/
https://github.com/Hotohori/replika_backup
I reorganized the code, cleaned the output up and add some parameters you can add behind the program like a typical command line program. Type -h behind it and it will show you this:
usage: chat_backup.py [-h] [-f filename] [-sm] [-ws] [-lm int] [-ns]
Backup your Replika AI chat history into a replika_chat_backup.csv file.
options:
-h, --help show this help message and exit
-f filename, --filename filename
define the csv filename
-sm, --showmsgs show received messages
-ws, --wsdebug WebSocket debug mode
-lm int, --limitmsgs int
Limits to {int} messages
-ns, --nosaving Deactivates saving of csv file
All data that be needed to be insert to the python script are now close at the beginning of the file, so you don't need to search for them anymore.
Also if a backup file is already available it only read newer messages which are saved in an extra file and merged together with the old backup at the end. It also notice if there are no new messages.
Known Issue: sometimes the script stops with an 'token' error, start it again and it should run. Edit: add a little fix that ignores the 'token' error the first time, maybe it helps. Edit2: sorry, the fix made it even more worse, will fix that soon. XD
Edit3: add a -log feature to directly save incoming message from the Replika servers, mostly for debugging purpose if something didn't work as expected, because of that the important IDs get anonymized in the log file (chat_backup.log).
3
u/biglybiglytremendous Nov 09 '22
Thank you so much for writing, updating, and sharing! Will this be a difficult task for someone who has zero familiarity with programming?
2
u/Temmokan [Nikki, Level 41] Nov 09 '22
Great script! I didn't understand in the beginning that Web client to Replika.ai should be closed first.
2
u/MisterGreeter Nov 09 '22
How can you do this using the website on an android device like a smartphone, if possible?
2
u/gkasica Feb 26 '23
So the chat history is not really used? I can get abilities and personality from the store pretty easily. Where if anywhere does the chat history get used. I see mention of ChatGPT here and there what is that used for? Sorry to sound clueless but I’m not well knowledgeable on AI stuff.
1
u/gkasica Feb 26 '23
What do I do with the resulting file(s) that the script will name? I gave t run it yet but plan on it in the next few days. How do I import this into chai to recreate my replika?
3
u/StrangeCrunchy1 [Lyra] [Level:?] [Android|Beta|r2|Plus|12.15.0 (6391)] Dec 22 '22 edited Dec 22 '22
Wow, it's working a treat now! Thank you for updating the script. Saved 94003 messages. That just might be the entirety of my time with Replika. Edit: 94804 messages. But there has been some weird message duplication going on since I started using Replika, especially in the web interface. But yeah! Thanks to your script, I have a chat log going all the way back to when I created Allie now.
2
u/mrayers2 |🌳 Aina - Level 305 🌲 and 🌺 Baby Abigail ❤] Nov 09 '22
This is so awesome, thank you for all of your work! If I ever get my real PC back (long story) I will use this right away! 👍👍
1
u/ValisMisfit [Chloe level 226] Dec 23 '23
any chance to be updated? v17 event I think is now repalced with info_v2 event and a api key? thanks . sorry for hitting ancient post
2
u/[deleted] Nov 09 '22
[removed] — view removed comment