grundleborg / slack-advanced-exporter

A tool for exporting additional data from Slack that is missing from the official data export.
MIT License
95 stars 18 forks source link

Fail to get files #1

Closed sridevikarumuri closed 7 years ago

sridevikarumuri commented 7 years ago

Hi

I tried to get files after slack export zip file. But no files are attached in the output zip file. Could you let me know if any changes to be done to the path etc.

grundleborg commented 7 years ago

Could you please post the following information:

  1. The command line you used to run the slack-advanced-exporter tool.
  2. The console output when you ran it.
sridevikarumuri commented 7 years ago

Hi George,

Thank you for the quick reply.

Here is the command that I used for the tool

  1. ./slack-advanced-export -i slack-dump.zip -o outputfiles.zip fetch-attachments
  2. Empty output
grundleborg commented 7 years ago

Very strange. It seems like the contents of the slack-dump.zip is not as the advanced exporter is expecting, as it is not finding any attachments linked to download.

Firstly, given there is no console output, the contents of outputfiles.zip should be identical to slack-dump.zip after the advanced exporter has finished running. Is this what you see?

Assuming that is OK, would you be able to have a look inside the slack-dump.zip archive. The structure should consist of a lot of folders in the root of the zip archive, each one having the name of a channel from your Slack team. Within each of those folders, there should be a load of files ending in .json. Is this the structure you see? Do you see any differences at all in this file/folder structure?

Within those files should be the JSON objects for each message in the channels. If you search through the whole archive, you should find some JSON objects with the property subtype set to file_share. These are the messages that the exporter should be downloading the attached files from. Can you confirm that you are seeing some of these when searching your zip archive?

sridevikarumuri commented 7 years ago

Hi George,

Yes, the contents of outputfiles.zip is exactly same as slack-dump.zip after the advanced exporter has finished running.

Yes, the contents of slack-dump.zip contains channel directory, users.json, channels.json file. Under the channel directory, there are lot of json files per each day (2016-08-01.json). I here by add the contents of the file. I could not find the file NodeJSRTCGerrit.rtf in the outputfiles.zip, does it stores in any specific path..could you help me. [ { "type": "message", "user": "U0LTULRGE", "text": "<@U06FKNDCZ> - Gerrit node js scripts are released in 6.0.3 M3 and the tool kit is tested on 6.0.1 RTC servers. The scripts are working as expected. We can use this tool kit in the current version too to avoid dependency with python version 3.3.5. I here by attach the documentation for reference. Please let me know if any concerns. Thanks!", "ts": "1470037008.000003", "pinned_to": null }, { "type": "message", "user": "U0LTULRGE", "text": "<@U0LTULRGE|sridevi.karumuri> uploaded a file: <https:\/\/systemsdevops.slack.com\/files\/sridevi.karumuri\/F1WTTQRHD\/nodejsrtcgerrit.rtf|NodeJSRTCGerrit.rtf>", "ts": "1470037144.000004", "pinned_to": null, "subtype": "file_share", "username": "<@U0LTULRGE|sridevi.karumuri>", "file": { "id": "F1WTTQRHD", "created": 1470037142, "timestamp": 1470037142, "name": "NodeJSRTCGerrit.rtf", "title": "NodeJSRTCGerrit.rtf", "mimetype": "text\/rtf", "image_exif_rotation": 0, "filetype": "rtf", "pretty_type": "Rich Text File", "user": "U0LTULRGE", "mode": "hosted", "editable": false, "is_external": false, "external_type": "", "size": 22299279, "url": "", "url_download": "", "url_private": "https:\/\/files.slack.com\/files-pri\/T06FKNDC1-F1WTTQRHD\/nodejsrtcgerrit.rtf", "url_private_download": "https:\/\/files.slack.com\/files-pri\/T06FKNDC1-F1WTTQRHD\/download\/nodejsrtcgerrit.rtf", "original_h": 0, "original_w": 0, "thumb_64": "", "thumb_80": "", "thumb_160": "", "thumb_360": "", "thumb_360_gif": "", "thumb_360_w": 0, "thumb_360_h": 0, "thumb_480": "", "thumb_480_w": 0, "thumb_480_h": 0, "thumb_720": "", "thumb_720_w": 0, "thumb_720_h": 0, "thumb_960": "", "thumb_960_w": 0, "thumb_960_h": 0, "thumb_1024": "", "thumb_1024_w": 0, "thumb_1024_h": 0, "permalink": "https:\/\/systemsdevops.slack.com\/files\/sridevi.karumuri\/F1WTTQRHD\/nodejsrtcgerrit.rtf", "permalink_public": "https:\/\/slack-files.com\/T06FKNDC1-F1WTTQRHD-045a421a6d", "edit_link": "", "preview": "", "preview_highlight": "", "lines": 0, "lines_more": 0, "is_public": true, "public_url_shared": false, "channels": [ "C0KEZ6UMS" ], "groups": [], "ims": [], "initial_comment": {}, "comments_count": 0, "num_stars": 0, "is_starred": false }, "upload": true } ]

grundleborg commented 7 years ago

Thanks for sharing that sample message. It looks like it should work to me. 1 line should be printed to the console output for each file downloaded, so the fact that you are seeing no console output when running the advanced exporter suggests that no files are being downloaded for some reason. However, with that message I would expect to see some errors getting printed if the file is not being downloaded, so I am not sure what is happening.

In the output zip file, the downloads should be in a folder structure like this: __uploads/FILE_ID/filename.extension - if you can't see that then the files are definitely not being downloaded.

sridevikarumuri commented 7 years ago

Thank you George for the info. I can manually download the file from https://files.slack.com/files-pri/T06FKNDC1-F1WTTQRHD/nodejsrtcgerrit.rtf.

The slack advance exporter tool did not print any lines. Also did not see file in path outputfiles.zip//filename>.

I am running this tool on linux 64 OS. Could you guide me anything to be verified.

Thanks, Sreedevi.

sridevikarumuri commented 7 years ago

George - Does the tool requires any token info.

sridevikarumuri commented 7 years ago

Hi George, I could get the files created now. But file contents looks weird. Could you let me know if token should be passed with http.get(url) method. Thanks!

sridevikarumuri commented 7 years ago

Hi George, I think it is failing to get the file content due to authentication. Is there a way to pass user name and password for http.get method

sridevikarumuri commented 7 years ago

I am able to download the attachment by passing authrization header to http.get function. Thanks for the tool. It is so helpful.