smashwilson/slack-emojinator

API Token can no longer be parsed from document.cookie

cainejette opened this issue · 3 comments

Looks like it is no longer included, or is encoded somehow.

$ pipenv run python export.py --concurrent-requests 3 github/
Loading .env environment variables…
Traceback (most recent call last):
  File "export.py", line 179, in <module>
    loop.run_until_complete(main())
  File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
    return future.result()
  File "export.py", line 161, in main
    token = await _fetch_api_token(session, base_url)
  File "export.py", line 102, in _fetch_api_token
    raise Exception("Could not parse API token from remote data! Regex requires updating.")
Exception: Could not parse API token from remote data! Regex requires updating.

Although grabbing the value from the emoji.list POST call that slack in the browser makes worked!

Although when I plug in the information of another workspace I want to upload emojis to, no go:

$ pipenv run python upload.py github/*.png
Loading .env environment variables…
Traceback (most recent call last):
  File "upload.py", line 183, in <module>
    main()
  File "upload.py", line 111, in main
    session = _session(args)
  File "upload.py", line 40, in _session
    session.api_token = _fetch_api_token(session)
  File "upload.py", line 106, in _fetch_api_token
    raise ParseError("No api_token found in page")
__main__.ParseError: No api_token found in page

It looks like the mechanism for retrieving the api token differs between export.py and upload.py