{ "info": { "author": "Dmitry Karikh", "author_email": "the.dr.hax@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 3.6", "Topic :: Multimedia :: Sound/Audio :: Analysis", "Topic :: Multimedia :: Video :: Conversion", "Topic :: Utilities" ], "description": "# Python utils for Twitch [![PyPI version](https://badge.fury.io/py/tdh-twitch-utils.svg)](https://badge.fury.io/py/tdh-twitch-utils)\n\n```\npip3 install tdh-twitch-utils\n```\n\nThis module consists of three different scripts:\n\n## concat\n\nThis script uses MPEG-TS timestamps to concatenate multiple\nvideo segments into a single file without re-encoding. It is\nmost useful for assembling partial stream recordings in case\nof interruption or error during stream download. Overlapping\nparts will be removed precisely with ffmpeg's concat demuxer.\n\n### Example\n\n```\n# download two overlapping segments (60 seconds each)\nVOD=\"YOUR VOD ID\"\nstreamlink -o 1.ts --hls-duration 60 \"twitch.tv/videos/$VOD\" best\nstreamlink -o 2.ts --hls-start-offset 30 --hls-duration 60 \"twitch.tv/videos/$VOD\" best\n\n# concatenate two segments into one video\ntwitch_utils concat 1.ts 2.ts -o result.mp4\n```\n\n## record\n\nThis script can be used to record live streams without waiting\nfor them to end. It starts to record live stream immediately,\nthen downloads VOD and concatenates them into full stream recording.\n\nObviously, this script requires channel to have public VODs and streams.\n\nAlgorithm:\n1. Check if channel is live and VOD for current stream already exists;\n2. Get VOD ID from Twitch API (uses part of Twitch-Chat-Downloader library);\n3. Start downloading live stream into file `VOD.end.ts`;\n4. Wait 10 minutes and start downloading VOD into file `VOD.start.ts`;\n5. Wait for both downloads to finish;\n6. Concatenate two parts via `concat` script (see above).\n\nBandwidth limiting is implemented by piping output of streamlink\nthrough `pv` utility, thus you will need to install this program\nto use `-b` flag.\n\n### Example\n\n```\n# Record live stream of channel 'blackufa' using 2 threads and\n# limiting bandwidth to 2 MiB/s\n\ntwitch_utils record blackufa -j 2 -b 2M \n```\n\n## offset\n\nThis script performs cross-correlation of two audio files to find\noffset between them. First argument is cropped and used as template.\nSecond argument can have any duration -- it will be divided into\nseparate chunks to reduce memory usage (otherwise it wouldn't be\npossible to use exceptionally big files). Both arguments can be\nvideos or audio files -- audio track will be extracted and converted.\nYou can even use HTTP links if `ffprobe` is able to correctly determine\nsecond argument's duration.\n\n### Example\n\n```\n# Cut small segment from big video file (offset: 123 seconds)\nffmpeg -ss 123 -i YOUR_FILE.mp4 -t 60 -c copy template.mp4\n\n# Find offset of template.mp4 within YOUR_FILE.mp4\ntwitch_utils offset template.mp4 YOUR_FILE.mp4\n# ... returns 122.99997732426303\n\n# Same command, but result will be rounded to nearest integer\ntwitch_utils offset template.mp4 YOUR_FILE.mp4 --round\n# ... returns 123\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/TheDrHax/Twitch-Utils", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "tdh-twitch-utils", "package_url": "https://pypi.org/project/tdh-twitch-utils/", "platform": "", "project_url": "https://pypi.org/project/tdh-twitch-utils/", "project_urls": { "Homepage": "https://github.com/TheDrHax/Twitch-Utils" }, "release_url": "https://pypi.org/project/tdh-twitch-utils/1.1.1/", "requires_dist": [ "tdh-tcd (==2.4)", "streamlink (>=1.0.0)", "docopt (>=0.6.2)", "praat-parselmouth (>=0.3.3)" ], "requires_python": "", "summary": "Record, concatenate and synchronize Twitch live streams", "version": "1.1.1" }, "last_serial": 5879119, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "4d9a8178ed2b64ebd3ae2e4de2e518b9", "sha256": "0c1409d8196c14839c78ff5334809d04beb5ecdb9ec7b384794dc210b0204b7e" }, "downloads": -1, "filename": "tdh_twitch_utils-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4d9a8178ed2b64ebd3ae2e4de2e518b9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 22548, "upload_time": "2019-08-21T01:20:22", "url": "https://files.pythonhosted.org/packages/7a/8b/55871024502a36879456d80c7fa70973a92d4fe1752e8da2f1a903851bed/tdh_twitch_utils-1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "19b42e70c6ea1467cf1ee9cc667aee16", "sha256": "980487410fcc5904d78e2dece0ed667960a9316bbc311137d33d163b75ed09fd" }, "downloads": -1, "filename": "tdh-twitch-utils-1.0.tar.gz", "has_sig": false, "md5_digest": "19b42e70c6ea1467cf1ee9cc667aee16", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8222, "upload_time": "2019-08-21T01:20:25", "url": "https://files.pythonhosted.org/packages/fe/d7/353c7262fb3f901b0bfbfbac89884b1a823ecf22da6e7c5d2adb25080b04/tdh-twitch-utils-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "8a9ad9bf7e3569df450fbf0be5be2e33", "sha256": "cdafcc4286d27018e82c77ed9513e1040ceb2f0455a223db5b55ba2704d8eba9" }, "downloads": -1, "filename": "tdh_twitch_utils-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8a9ad9bf7e3569df450fbf0be5be2e33", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 22612, "upload_time": "2019-08-21T17:06:05", "url": "https://files.pythonhosted.org/packages/1d/24/dc0a64d97fa3aec7496ecd8a5ab534a93e3382614684017080873a262f6e/tdh_twitch_utils-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0d858e5149a7868d7cd60b622c6847ae", "sha256": "dad5d4f7cccffd73030baa38c6d94aa54f7c99b074823f56ec18ffbc87960a7b" }, "downloads": -1, "filename": "tdh-twitch-utils-1.0.1.tar.gz", "has_sig": false, "md5_digest": "0d858e5149a7868d7cd60b622c6847ae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8256, "upload_time": "2019-08-21T17:06:07", "url": "https://files.pythonhosted.org/packages/92/2c/deb0030064f8f3d9ad7936565f6d2d444009ccf518cfcc94e76775589ed6/tdh-twitch-utils-1.0.1.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "a104a08968722eab828d433c4c190cc8", "sha256": "4cb6cb353b628ee26355c16ea34fe970a11b1ca13c3d926d8767dfb57cdc2746" }, "downloads": -1, "filename": "tdh_twitch_utils-1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a104a08968722eab828d433c4c190cc8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 22609, "upload_time": "2019-08-26T19:13:38", "url": "https://files.pythonhosted.org/packages/e9/07/c22465f8e936b549c9139919d7ab2fdc1a04c840448903b53e9a5ecf6497/tdh_twitch_utils-1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "70e05a2bfec5fc2b87bf2597022bc0ea", "sha256": "2d09c90ff398d612fcac797935e4aa467af1f5e2d26174605257b6ee43b9ed0d" }, "downloads": -1, "filename": "tdh-twitch-utils-1.1.tar.gz", "has_sig": false, "md5_digest": "70e05a2bfec5fc2b87bf2597022bc0ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8296, "upload_time": "2019-08-26T19:13:40", "url": "https://files.pythonhosted.org/packages/b6/aa/fda7885b024e177a9760e2bc7a4964504ca97c940725ef45f9170e2fefc3/tdh-twitch-utils-1.1.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "4979c31948d3cb4067bc87cdc3148008", "sha256": "e7010235385320ea427b1c5f5be77fc1b326510717cda4fd25569c6e381580ba" }, "downloads": -1, "filename": "tdh_twitch_utils-1.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "4979c31948d3cb4067bc87cdc3148008", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 22695, "upload_time": "2019-09-24T11:31:30", "url": "https://files.pythonhosted.org/packages/1b/a1/4930476ba7f5e7bdc0153d5157c6d0a072ff942ea8491d0bf6776007c78b/tdh_twitch_utils-1.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e7d52058e8e5b293579932565c44a480", "sha256": "c2c107e0ffd6ff826e665cb2d9f79c457e31d2dae05bb2e4c45e5f37f0598e93" }, "downloads": -1, "filename": "tdh-twitch-utils-1.1.1.tar.gz", "has_sig": false, "md5_digest": "e7d52058e8e5b293579932565c44a480", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8349, "upload_time": "2019-09-24T11:31:31", "url": "https://files.pythonhosted.org/packages/ca/05/201556c8e1141626f257ae395a05533ba4a6e04f4e80310932974a400415/tdh-twitch-utils-1.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4979c31948d3cb4067bc87cdc3148008", "sha256": "e7010235385320ea427b1c5f5be77fc1b326510717cda4fd25569c6e381580ba" }, "downloads": -1, "filename": "tdh_twitch_utils-1.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "4979c31948d3cb4067bc87cdc3148008", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 22695, "upload_time": "2019-09-24T11:31:30", "url": "https://files.pythonhosted.org/packages/1b/a1/4930476ba7f5e7bdc0153d5157c6d0a072ff942ea8491d0bf6776007c78b/tdh_twitch_utils-1.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e7d52058e8e5b293579932565c44a480", "sha256": "c2c107e0ffd6ff826e665cb2d9f79c457e31d2dae05bb2e4c45e5f37f0598e93" }, "downloads": -1, "filename": "tdh-twitch-utils-1.1.1.tar.gz", "has_sig": false, "md5_digest": "e7d52058e8e5b293579932565c44a480", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8349, "upload_time": "2019-09-24T11:31:31", "url": "https://files.pythonhosted.org/packages/ca/05/201556c8e1141626f257ae395a05533ba4a6e04f4e80310932974a400415/tdh-twitch-utils-1.1.1.tar.gz" } ] }