1
0
Fork 0
Commit Graph

8 Commits

Author SHA1 Message Date
Lucidiot 39a94276d5
Add auto-retry on 429 when listing emojis for export 2022-07-20 10:18:35 +02:00
Tyrol ea44a2a453 Update export.py script to handle new Slack emoji page (resolves #27) 2019-11-18 20:44:40 -06:00
David Lord af453e6f39 Coerce `--concurrent-requests`/`-r` to type int
It comes through from the environment variable as a string. Fixes this
unhelpful error message:

`TypeError: '<' not supported between instances of 'str' and 'int'`
2018-06-12 19:50:36 +10:00
David Lord 25a3405192 Follow pagination for >500 emoji
At some point, Slack started paginating on the export page for teams with huge emoji collections.
This means the export process would only detect the 500 emoji on that first page (ordered alphabetically).
It now looks to other pages and exports those as well, restoring full functionality.

Tested on a team with ~1300 emoji (3 pages).
2018-06-12 19:17:59 +10:00
David Lord 2d4e355849 Initial implementation of aiohttp export
Makes the export script require Python 3.6.
(async/await were added in 3.5, so maybe there?)

I'll need to tidy it up a bit, but this is v1 of functionality.

Adds -r/--concurrent-requests for throttling. Defaults to 200.
(configured in .env as CONCURRENT_REQUESTS)

Caveats:
- Adds an aiohttp dependency.
- Stops using upload._session, effectively duplicating the
functionality to get access to aiohttp.ClientSession.
- Adds logging to record the files downloaded. Previously silent.

I've also noticed a bug in filename parsing where a bunch of files all
named `apple.png` are created. This script parses the URL to retrieve
the filename, which exposes this duplication. My version does more
parsing in the HTML to detect the :emoji_name: as used by Slack clients.
Currently I'm not addressing this.
2017-10-25 14:20:28 +10:00
Ash Wilson 7b0cedb0f1 Typo fix 2017-10-20 21:02:02 -04:00
Stephen Brennan 8aa6cd1393 Export using cookie + scraping rather than API, to avoid API token. 2017-03-21 23:46:12 -04:00
David Michael 17f52c1c03 Adding a script to export emoji to a given dir from an existing slack team. 2017-01-30 11:51:25 -06:00