sebseager / slack-exporter

A Slack bot for exporting content from public and private channels.
GNU General Public License v3.0
132 stars 36 forks source link

Compatiblity with slack-exporter #5

Closed mr-flibble closed 2 years ago

mr-flibble commented 2 years ago

Helo, any idea how can output be manipulated, to be compatible with https://github.com/hfaran/slack-export-viewer ? Thanks

sebseager commented 2 years ago

Sure. Based on some quick testing of the official slack exporter, the output zip seems to have the following hierarchy:

Only users.json and channels.json seem to be required by slack-export-viewer. Since I don't have a paid Slack plan, I can't test groups.json and dms.json via the official exporter myself.

Also, the official slack export splits up message jsons in channel directories by date (e.g., 2021-11-18.json); fortunately slack-export-viewer doesn't seem to care about this, so a single .json inside each channel directory should work just fine.

To replicate this behavior with the slack-exporter, try the following:

  1. Make a directory to store everything
  2. Export all conversations with --lc --json to a file called channels.json at the root of this directory. Duplicate it to dms.json. In the channels file, delete any entry where "id" doesn't start with C. In the dms file, delete any entry where "id" doesn't start with D.
  3. Make a subdirectory for each channel and name it according to the "name" param. Export history for each channel and/or DM with -c --ch ID_HERE --json and put each json in its corresponding subdirectory.
  4. Point slack-export-viewer to that directory.

Hope this works! Feel free to close if so.

mr-flibble commented 2 years ago

Thanks! I haven't succeeded yet, but I'll let you know if I do