# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['emojifs']

package_data = \
{'': ['*']}

install_requires = \
['cachetools>=4,<5',
 'logzero>=1.5.0,<2.0.0',
 'refuse>=0,<1',
 'requests>=2,<3',
 'tomlkit>=0.6.0,<0.7.0']

entry_points = \
{'console_scripts': ['emojifs = emojifs.__main__:main']}

setup_kwargs = {
    'name': 'emojifs',
    'version': '0.2.0',
    'description': 'A FUSE filesystem to manipulate custom emojis on your various Slacks and Discords',
    'long_description': '<img align="right"\n  src="extras/ablobcouncil.gif"\n  title="yes! but no! but also, yes."\n  alt="the emojifs mascot: a blobmoji holding a \'yes\' sign as well as a \'no\' sign and emphatically waving both simultaneously">\n\n# emojifs\n\n## Introduction\n`emojifs` is a FUSE filesystem that allows you to manipulate custom emojis on your various Slacks and Discords.\n\n\n## Example usage applications\n\n    # Copy one emote from Slack to Discord.\n    cp /emoji/slack/xooglers/docker-fire.gif /emoji/discord/unchaind/\n\n    # Upload a whole pile of emoji.\n    cp ~/emojipacks/parrots/* /emoji/slack/mynewslack/\n\n    # Grab all those blobmoji across all my Discords and put them on Slack.\n    cp /emoji/discord/*/*blob* /emoji/slack/myslack/\n\n<!-- TODO xattr? -->\n\n## ⚠️ WARNING! ⚠️\n**☢️ 😱 DO NOT USE THIS PROGRAM. 😱 ☢️**  \nThis program is not a program of honor.  \n\nNo highly esteemed function is executed here.  \n\nWhat is here is dangerous and repulsive to us.  \n\nThe danger [is still present](https://support.discord.com/hc/en-us/articles/115002192352), in your time, as it was in ours,  \nwithout even the implied warranty of MERCHANTABILITY  \nor FITNESS FOR A PARTICULAR PURPOSE.  \n\nThis program is best shunned and left unused (but it is free software,  \nand you are welcome to redistribute it under certain conditions).  \n**😱 ☢️ DO NOT USE THIS PROGRAM. ☢️ 😱**  \n\n## Getting your Slack and Discord secrets\n\n**⚠️ SERIOUS WARNING! I MEAN IT! ⚠️**  \nDon\'t share your cookies or tokens with anyone or anything, including this program.  \nThey allow full control of your account!  \n**⚠️ SERIOUS WARNING! I MEAN IT! ⚠️**  \n\n### Slack\nFor Slack, the easiest thing to do is:\n* In your web browser, log in to all the Slacks you want to use with this hunk of junk.\n* Open your browser devtools network panel\n* Find a request going towards edgeapi.slack.com or api.slack.com or a URL path starting with /api.  In Chrome, you can just type `api` in the Filter box above the timeline.\n* Extract the cookie header value from your request, and use it in the config file below.\n\n### Discord\n* In your web browser, go to https://discord.com/app\n* Open your browser devtools network panel\n* Find a request going towards `https://discord.com/api/v6`.  In Chrome, you can just type `api` in the Filter box above the timeline.\n* Extract the value of the `authorization:` header from one of your requests, and use it in the config file below.\n\n<img align="left"\n  src="https://cdn.discordapp.com/emojis/739162266284458045.gif"\n  title="monkaTOS"\n  alt="Pepe the Frog, sweating, his eyes replaced with a blinking marquee reading TOS">\n**⚠️ SERIOUS WARNING! I MEAN IT! ⚠️**  \nUsing this program with Discord violates their [Terms of Service](https://support.discord.com/hc/en-us/articles/115002192352).  \nIt is possible your account could be banned.  \n**⚠️ SERIOUS WARNING! I MEAN IT! ⚠️**  \n\n&nbsp;  \n\n## Requirements\n* Python 3.7+\n* A system that supports libfuse2\n  * Linux or MacOS (or probably most BSDs, but I haven\'t tried)\n  * Windows might work with [WinFsp](https://github.com/billziss-gh/winfsp), also untested\n* A profound amount of either fearlessness, or foolishness, or both\n\n## Installation\n\nLike most Python packages, just `pip install emojifs`, or you can `git clone` the repo and `python setup.py install`.\n\nYou probably want to do either of the above inside a venv.\n\nIf you have [`poetry`](https://python-poetry.org/) installed, then `poetry install` will work great.\n\n## Writing a config file\n\nThe format is [TOML](https://toml.io/).  It looks a lot like an INI file, if that means something to you.\n\nThe default location for the configuration file is `~/.emojifs.toml`\n\n### A barebones config file\n\n```toml\n[emojifs]\nmountpoint = \'~/emoji\'\n\n[slack]\ncookies = [\'d=wpwQ4182w08qxmE4YP0gvlMb2L...\']\n\n[discord]\ntoken = \'mfa.x91xxxxx......\'\nacknowledged = "I understand that using this program violates Discord\'s ToS"\n```\n\nThat\'s all you need.  All Slacks you logged into will be autodetected.\n\nOn Windows, your mountpoint should be a drive letter:\n```toml\n[emojifs]\nmountpoint = \'E:\'\n```\n\n### A comprehensive configuration\nThere are a few niceties available:\n```toml\n[emojifs]\nmountpoint = \'/emoji\'  # if you want to feel extra cool\nforeground = true\n\n[slack]\ntokens = [\n  \'xoxp-asdf...\',\n  \'xoxs-qwer...\',\n]\n\ncookies = [\n  \'d=dvfib...\',\n  \'d=ivu80...\',\n]\n\n[slack.renames]\nthisisaverylongname = \'short\'\n\n```\n\nThis will:\n* mount everything under `/emoji`\n* keep emojifs in the foreground as it runs (necessary if you want verbose logging output)\n* first read the auth tokens one by one, then scrape logins for the cookies listed\n* instead of mounting `thisisaverylongname.slack.com`\'s emojis under the usual path, they\'ll appear under `/emoji/slack/short`.\n\n\n## Invoking emojifs\n\n```\nusage: emojifs [-h] [-m MOUNTPOINT] [-f FOREGROUND] [-c CONFIG] [-v] [-V]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -m MOUNTPOINT, --mountpoint MOUNTPOINT\n                        Where to mount emojifs. If present here, overrides\n                        mountpoint from config. (default: None)\n  -f FOREGROUND, --foreground FOREGROUND\n                        If set, stay in the foreground. (default: False)\n  -c CONFIG, --config CONFIG\n                        Path to your config file with secrets\n                        (default: ~/.emojifs.toml)\n  -v, --verbose         Verbosity (-v, -vv, etc). Higher verbosities will log\n                        all HTTP traffic (NB: at higher levels, this will log\n                        your auth secrets!) (default: 0)\n  -V, --version         show program\'s version number and exit\n\n```\n\n\n## A note on semantics\nEmojis are always \'rendered\' in the filesystem with extensions (`.png`, `.gif`, etc) attached; however, the filesystem will accept reads and writes to filenames without extensions (assuming, of course, the filenames are valid emoji names).\n\n## Known issues\n* The first time you `ls` a directory for a Slack or Discord, it will take a very long time: possibly dozens of seconds 😬 but will be much faster afterwards.  Sorry, there are hopefully some reasonable ways to fix this.  (If you\'re morbidly curious, look for `real_sizes` in `emojifs/slack.py`.)\n* While deletions and creations are supported, overwriting emojis in place is *not* yet supported.  As a workaround, you can use `cp --remove-destination` which, before writing new versions, will delete any existent emojis.\n* Some Slacks have emojis from long ago which are aliases to emojis that don\'t themselves appear in the emoji listing -- although there isn\'t actually data missing, as they have a `data:` URL.\n* The use of this program with Discord violates their Terms of Service.\n* The existence of this program is an unforgivable sin.\n\n## Future work\n* Aliases for Discord guild names, as they can be unwieldly from the CLI.\n* EaaFS: Integrating popular emojipacks as a filesystem.\n\n## Acknowledgements\n* The lovely [Requests library](https://requests.readthedocs.io/)\n* [FUSE and its predecessors](https://en.wikipedia.org/wiki/Filesystem_in_Userspace)\n* [SlackPirate by emtunc](https://github.com/emtunc/SlackPirate)\n* [slackmoji by ksindi](https://github.com/ksindi/slackmoji) and [emojipacks by lambtron](https://github.com/lambtron/emojipacks)\n* [Cult of the Party Parrot](https://cultofthepartyparrot.com/)\n* [blobs.gg](https://blobs.gg/)\n',
    'author': 'Chris Danis',
    'author_email': 'cdanis@gmail.com',
    'maintainer': None,
    'maintainer_email': None,
    'url': 'https://github.com/cdanis/emojifs',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'entry_points': entry_points,
    'python_requires': '>=3.7,<4.0',
}


setup(**setup_kwargs)
