-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Hi,
I got your script to work today, it's currently running. Here I post the steps, I had to take for others to replicate or someone to incorporate:
- to get the python packages:
- under Fedora:
- in an empty directory:
- create python virtual environment to install the packages in:
python -m venv .venv - activate:
. .venv/bin/activate - install the packages:
pip install requests simplejson fpdf2(the 2 is important,fpdfis 8 years old and incompatible)
- under NixOS:
nix-shell -p python312Packages.requests -p python312Packages.simplejson -p python312Packages.fpdf2
For authentification I used a token from a website input:
- for authentification I do not know what to input for the --auth option. The password is not sufficiant.
- I did a login in my mattermost server in Firefox, went into the developer view (Right-click - Inspect (Q)), opened Tab "Network"
- for any request with a lock symbol, under Cookies on the right, it showed values for "MMAUTHTOKEN", "MMCSRF", "MMUSERID"
- right-click - copy all -> you get a dict. Paste the innermost dict with the three key-value pairs into the MMExport script as a global variable cookies
- replace-all in the MMExport....py script:
headers=headersbyheaders=headers, cookies=cookies(in the requests.get calls)
Now the second error comes from missing fonts.
- under Fedora:
- search in
/usr/share/fontsforNotoSans-Regular.ttf(e.g. withfind -name "NotoSans-Regular.ttf") - fix the paths in lines 727 and following. Currently it was
SYSTEM_TTFONTS = 'usr/share/fonts/google-notoand removing thenotofrom the individual file names in the following lines
- search in
- under NixOS:
find NotoSans-Regular.ttfin all of/nix/storetook too long. So I didfor i in /nix/store/*noto*; do find "$i" -name "NotoSans-Regular.ttf" >> ~/tmp/fonts ; done and it gave me/nix/store/9xz6bdv0yyzin2qa2pw0w1qy1ygipi8y-noto-64351-tex/fonts/truetype/google/noto/NotoSans-Regular.ttf`- hence my change in the python-script was
SYSTEM_TTFONTS = '/nix/store/9xz6bdv0yyzin2qa2pw0w1qy1ygipi8y-noto-64351-tex/fonts/truetype/google/'
Running the script now worked with some warning from fpdf2 because of deprecated functions and classes. But it works:
-u usernameusername is not the displayname but the username you use to login. It's displayed after a@when clicked on your profile picture in the upper right corner-a authauth can be anything since authentification is done via the cookie-t teamthe team is the group name that is shown above the search field-s serverthe server is the url withouthttps://or anything after/, so for examplemattermost.myinstitute.fr
In my case the output was a 4 GB pdf. I would definitly prefer a html/markdown output as signal-export by carderne does.
Thank you for your work. It took me about 90 minutes to figure all this out for two computers and accounts but that's much less than doing anything from scratch or even considering downloading, screenshotting, copy-pasting all by hand.
Metadata
Metadata
Assignees
Labels
No labels