{ "info": { "author": "Jean-Christophe Saad-Dupuy", "author_email": "jc.saaddupuy@fsfe.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7" ], "description": "===============================\nStupid, simple torrent client\n===============================\n\n.. image:: https://img.shields.io/pypi/v/sstc.svg\n :target: https://pypi.python.org/pypi/sstc\n\n\nStupid, simple torrent client built on top of libtorrent python binding.\n\nLet you add torrents files and magnet and receive libtorrent alerts. That's all !\n\n* Free software: WTFPL\n\nFeatures\n--------\n\n* TODO\n\nFull example\n-------------\nThis example show how to add a magnet uri and how to create an alert handler.\n\nAlert handler methods sould be named 'on\\_ALERT', with ALERT the type of alert\nto handle.\n\nAll methods will receive the session as first argument and the alert\nas the second.\n\nPlease note that this example is not exhaustive.\n\n.. code-block:: python\n\n # coding: utf-8\n import sys\n import os\n import time\n import logging\n\n from sstc.sstc import TorrentClient\n\n logging.basicConfig(level=logging.DEBUG)\n logger = logging.getLogger(__name__)\n\n\n class AlertHandler(object):\n def on_torrent_added_alert(self, session, alert):\n logger.debug(\"on_torrent_added_alert\")\n\n def on_state_changed_alert(self, session, alert):\n logger.debug(\"on_state_changed_alert\")\n logger.debug(alert.message())\n\n def on_torrent_resumed_alert(self, session, alert):\n logger.debug(\"on_torrent_resumed_alert\")\n\n def on_torrent_checked_alert(self, session, alert):\n logger.debug(\"on_torrent_checked_alert\")\n handler = alert.handle\n info = handler.get_torrent_info()\n files = info.files()\n # Do something with torrent infos, like filter files to download\n # torrent was added paused, we resume it\n handler.resume()\n\n def on_torrent_finished_alert(self, session, alert):\n logger.debug(\"on_torrent_finished_alert\")\n # if you want to remove the torrent immediately :\n #session.remove_torrent(handler)\n\n def on_piece_finished_alert(self, session, alert):\n logger.debug(\"on_torrent_finished_alert\")\n handler = alert.handle\n\n def on_block_finished_alert(self, session, alert):\n logger.debug(\"on_block_finished_alert\")\n handler = alert.handle\n\n def on_file_completed_alert(self, session, alert):\n logger.debug(\"on_file_completed_alert\")\n handler = alert.handle\n info = handler.get_torrent_info()\n f = info.file_at(alert.index)\n logger.debug(\"%s : completed\", f.path)\n\n def main():\n # starts client with 100Mib/s download limit\n # and 10Mib/s uploadlimit\n client = TorrentClient(\n download_rate_limit=100 << 20,\n upload_rate_limit=10 << 20,\n )\n\n # start client alert dispatcher\n client.start()\n\n to_download=[\n # support local torrentfile\n \"./big_buck_bunny.torrent\"\n # also magnet url\n \"magnet:?xt=urn:btih:0E876CE2A1A504F849CA72A5E2BC07347B3BC957&dn=big+buck+bunny+720p+psiclone&tr=udp%3A%2F%2Fopen.demonii.com%3A1337%2Fannounce\",\n # also from http/https url\n \"http://www.frostclick.com/torrents/video/animation/Big_Buck_Bunny_1080p_surround_frostclick.com_frostwire.com.torrent\",\n ]\n\n try:\n for item in to_download:\n client.add(item, is_paused=True, alert_handler=AlertHandler())\n\n # Blocking loop\n client.loop()\n\n except (KeyboardInterrupt, Exception) as e:\n client.stop()\n\n if __name__ == \"__main__\":\n main()\n\n\n\n\n\nHistory\n-------\n\n0.1.0 (2015-01-11)\n---------------------\n\n* First release on PyPI.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jcsaaddupuy/sstc", "keywords": "sstc", "license": "WTFPL", "maintainer": null, "maintainer_email": null, "name": "sstc", "package_url": "https://pypi.org/project/sstc/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/sstc/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/jcsaaddupuy/sstc" }, "release_url": "https://pypi.org/project/sstc/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Simple torrent client on top of libtorrent rasterbar", "version": "0.1.0" }, "last_serial": 1481429, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "4983fca4eb5fc8cdf1f06ebc31e3ac94", "sha256": "afbb2501c43a85459a0ce109d3505bc8a6f3ab6aa742c2c14a2a702a5831d8ea" }, "downloads": -1, "filename": "sstc-0.1.0-py2.7.egg", "has_sig": false, "md5_digest": "4983fca4eb5fc8cdf1f06ebc31e3ac94", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 9310, "upload_time": "2015-03-28T17:25:22", "url": "https://files.pythonhosted.org/packages/88/30/3e287d1d37c95700b09c1e9667e136e3c93805014646fafd8b8c826d27da/sstc-0.1.0-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "224a7a92a75d0881a7d24246127a7bb4", "sha256": "898ae786fec5ed2e724c628d5bbfa6b2bb405326e69c939f1d539c7b0f321635" }, "downloads": -1, "filename": "sstc-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "224a7a92a75d0881a7d24246127a7bb4", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 7428, "upload_time": "2015-03-28T17:25:30", "url": "https://files.pythonhosted.org/packages/a1/ab/b66807f645a7c806491da4a130fa4a709e4a73744a5f2ed8ec148aa5dbc0/sstc-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6d16ce3fe4bb4b042b69e42dbd27c362", "sha256": "0a9421c88e6f5267cca4cd7fab39f46f40aec6ee3c161f1362496d75d5d262d7" }, "downloads": -1, "filename": "sstc-0.1.0.tar.gz", "has_sig": false, "md5_digest": "6d16ce3fe4bb4b042b69e42dbd27c362", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14712, "upload_time": "2015-03-28T17:25:12", "url": "https://files.pythonhosted.org/packages/ec/b4/761e238b998fe7de4dc7f3cc625dddf40ac8600e745891cad4947c6f54e0/sstc-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4983fca4eb5fc8cdf1f06ebc31e3ac94", "sha256": "afbb2501c43a85459a0ce109d3505bc8a6f3ab6aa742c2c14a2a702a5831d8ea" }, "downloads": -1, "filename": "sstc-0.1.0-py2.7.egg", "has_sig": false, "md5_digest": "4983fca4eb5fc8cdf1f06ebc31e3ac94", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 9310, "upload_time": "2015-03-28T17:25:22", "url": "https://files.pythonhosted.org/packages/88/30/3e287d1d37c95700b09c1e9667e136e3c93805014646fafd8b8c826d27da/sstc-0.1.0-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "224a7a92a75d0881a7d24246127a7bb4", "sha256": "898ae786fec5ed2e724c628d5bbfa6b2bb405326e69c939f1d539c7b0f321635" }, "downloads": -1, "filename": "sstc-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "224a7a92a75d0881a7d24246127a7bb4", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 7428, "upload_time": "2015-03-28T17:25:30", "url": "https://files.pythonhosted.org/packages/a1/ab/b66807f645a7c806491da4a130fa4a709e4a73744a5f2ed8ec148aa5dbc0/sstc-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6d16ce3fe4bb4b042b69e42dbd27c362", "sha256": "0a9421c88e6f5267cca4cd7fab39f46f40aec6ee3c161f1362496d75d5d262d7" }, "downloads": -1, "filename": "sstc-0.1.0.tar.gz", "has_sig": false, "md5_digest": "6d16ce3fe4bb4b042b69e42dbd27c362", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14712, "upload_time": "2015-03-28T17:25:12", "url": "https://files.pythonhosted.org/packages/ec/b4/761e238b998fe7de4dc7f3cc625dddf40ac8600e745891cad4947c6f54e0/sstc-0.1.0.tar.gz" } ] }