{ "info": { "author": "Giesela Inc.", "author_email": "team@giesela.dev", "bugtrack_url": null, "classifiers": [], "description": "# LPTrack\n\nLavaPlayer encoded track encoder and decoder.\n\n\n## Introduction\n\nLPTrack is a small library which allows you to interpret the encoded\ntrack data used by LavaPlayer.\n\nThis is useful when you're dealing with standalone LavaLink instances\nlike [Lavalink](https://github.com/Frederikam/Lavalink) and [Andesite](https://github.com/natanbc/andesite-node),\nbecause it allows you to interpret the track data directly.\n\n\n## Installation\n\n#### From PyPI\n\n```shell\npip install lptrack\n```\n\n\n## Usage\n\n```python\nimport lptrack\n\ntrack = lptrack.Track(\n version = 2,\n source = lptrack.Youtube(),\n\n info = lptrack.TrackInfo(\n title=\"A song\",\n author=\"Some random artist\",\n duration=120, # duration is in seconds!\n identifier=\"dQw4w9WgXcQ\",\n is_stream=False,\n ),\n)\n\nencoded = lptrack.encode(track)\nprint(encoded)\n# b'QAAARQIABkEgc29uZwASU29tZSByYW5kb20gYXJ0aXN0AAAAAAAB1MAAC2RRdzR3OVdnWGNRAAAAB3lvdXR1YmUAAAAAAAAAAA=='\n\ndecoded = lptrack.decode(encoded)\n\nassert decoded == encoded\n```\n\n## Obligatory rant about CESU-8\n\nWithout going into too much detail, LavaPlayer (or Java, to be more\nspecific) uses a special encoding for strings called [MUTF-8](https://en.wikipedia.org/wiki/UTF-8#Modified_UTF-8)\nwhich in turn is based on [CESU-8](https://en.wikipedia.org/wiki/CESU-8).\nCharacters from the [BMP](https://github.com/LuminosoInsight/python-ftfy)\n(which contains pretty much all characters from modern languages) are\nencoded like normal UTF-8. But special characters like\nemojis will be encoded in an incompatible manner.\n\nWhile lptrack doesn't force you to use it, it's strongly recommended to\nhave [ftfy](https://github.com/LuminosoInsight/python-ftfy) installed.\nIt allows lptrack to properly decode MUTF-8 encoded strings. If ftfy\nisn't installed lptrack will treat the strings as UTF-8, but allows\nsurrogates. Note that it doesn't parse the surrogates properly (i.e. it\nwill look like a mess), but it will include them in the re-encoded track\ndata.\n\nftfy is listed as a dependency of lptrack, so unless you really don't\nwant it, you'll enjoy its benefits.\n\nlptrack itself doesn't produce CESU-8 strings, so it's possible that\nthe re-encoded track data differs from the original track data.\n\nIt's possible to manually set the desired codec using the\nkeyword-argument `string_codec` which accepts a `lptrack.strcodec.Codec`\ninstance. The following values are pre-defined:\n\n- `lptrack.strcodec.UTF8`: Allows surrogates but doesn't parse them\n properly. Should be used if re-encoded track data needs to be equal\n to the input.\n\n- `lptrack.strcodec.MUTF8`: Codec handling CESU-8. Requires ftfy to\n work.\n\n- `lptrack.strcodec.DEFAULT`: MUTF8 if ftfy is installed, UTF8 otherwise.\n This codec is used by default.\n\n- `lptrack.strcodec.UTF8STRICT`: Same as UTF8 but rejects surrogates\n outright.\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/gieseladev/lptrack", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "lptrack", "package_url": "https://pypi.org/project/lptrack/", "platform": "", "project_url": "https://pypi.org/project/lptrack/", "project_urls": { "Homepage": "https://github.com/gieseladev/lptrack" }, "release_url": "https://pypi.org/project/lptrack/1.0.0/", "requires_dist": [ "ftfy" ], "requires_python": "~=3.7", "summary": "", "version": "1.0.0" }, "last_serial": 5978779, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "00972b539281efc60e5e5b0ac9ff4a8a", "sha256": "16621207834645255b7ca3ebe606a6fb943367d0fda54a1468063ed3ce585bb3" }, "downloads": -1, "filename": "lptrack-0.0.1.tar.gz", "has_sig": false, "md5_digest": "00972b539281efc60e5e5b0ac9ff4a8a", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.7", "size": 4572, "upload_time": "2019-07-23T16:43:06", "url": "https://files.pythonhosted.org/packages/93/16/5bf9b97066cafb8a13a8e10ec9d04b47e7a1c46069b0cdb9d1e2b9f734b7/lptrack-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "4d6a9eee49fe46876ba3a25c824bb4cf", "sha256": "880bdca28d16514e9bb71cd9121cf5ba3f2ce16c8d42a67c1623eb84367c8b63" }, "downloads": -1, "filename": "lptrack-0.1.0.tar.gz", "has_sig": false, "md5_digest": "4d6a9eee49fe46876ba3a25c824bb4cf", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.7", "size": 5613, "upload_time": "2019-07-24T16:15:02", "url": "https://files.pythonhosted.org/packages/94/c0/db8e977e16ca9403b000c24d9df8adfeaa7f55862d9c0fdd4a4a7968b058/lptrack-0.1.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "ffb2c555ba6b7a3dfece6797b8bd2f28", "sha256": "f67a12fc8707b04e7a6069ee74a7ea8fe30eec77b8ae977a37ddd179b4f1b894" }, "downloads": -1, "filename": "lptrack-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "ffb2c555ba6b7a3dfece6797b8bd2f28", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.7", "size": 9584, "upload_time": "2019-10-15T18:26:04", "url": "https://files.pythonhosted.org/packages/b8/57/4b707609805bef63d26fdc49920094ce7e77e1126202e7ae5e5708152aca/lptrack-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dbe2396156e6bc512591efa2bdeb70f6", "sha256": "522faee875c0d7be2ba2fa3716202b7ced8f74bb58d11c77bc4c4d46ef889ac6" }, "downloads": -1, "filename": "lptrack-1.0.0.tar.gz", "has_sig": false, "md5_digest": "dbe2396156e6bc512591efa2bdeb70f6", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.7", "size": 7054, "upload_time": "2019-10-15T18:26:06", "url": "https://files.pythonhosted.org/packages/a0/95/197db8bf4678ca808295c7c9ece6cddb07e354f42a1e1a30ed7043cb34f4/lptrack-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ffb2c555ba6b7a3dfece6797b8bd2f28", "sha256": "f67a12fc8707b04e7a6069ee74a7ea8fe30eec77b8ae977a37ddd179b4f1b894" }, "downloads": -1, "filename": "lptrack-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "ffb2c555ba6b7a3dfece6797b8bd2f28", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.7", "size": 9584, "upload_time": "2019-10-15T18:26:04", "url": "https://files.pythonhosted.org/packages/b8/57/4b707609805bef63d26fdc49920094ce7e77e1126202e7ae5e5708152aca/lptrack-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dbe2396156e6bc512591efa2bdeb70f6", "sha256": "522faee875c0d7be2ba2fa3716202b7ced8f74bb58d11c77bc4c4d46ef889ac6" }, "downloads": -1, "filename": "lptrack-1.0.0.tar.gz", "has_sig": false, "md5_digest": "dbe2396156e6bc512591efa2bdeb70f6", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.7", "size": 7054, "upload_time": "2019-10-15T18:26:06", "url": "https://files.pythonhosted.org/packages/a0/95/197db8bf4678ca808295c7c9ece6cddb07e354f42a1e1a30ed7043cb34f4/lptrack-1.0.0.tar.gz" } ] }