{"id":21201668,"url":"https://github.com/oleander/firecracker-rb","last_synced_at":"2025-07-10T06:31:52.458Z","repository":{"id":2096885,"uuid":"3037631","full_name":"oleander/firecracker-rb","owner":"oleander","description":"An implementation of the UDP/TCP torrent scrape protocol","archived":false,"fork":false,"pushed_at":"2017-11-22T08:13:18.000Z","size":221,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-18T22:10:56.871Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oleander.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-12-23T00:49:27.000Z","updated_at":"2017-04-06T02:40:02.000Z","dependencies_parsed_at":"2022-09-09T01:00:29.538Z","dependency_job_id":null,"html_url":"https://github.com/oleander/firecracker-rb","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2Ffirecracker-rb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2Ffirecracker-rb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2Ffirecracker-rb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2Ffirecracker-rb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oleander","download_url":"https://codeload.github.com/oleander/firecracker-rb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225622846,"owners_count":17498168,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T20:10:25.652Z","updated_at":"2024-11-20T20:10:26.179Z","avatar_url":"https://github.com/oleander.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Firecracker\n\nAn implementation of the [UDP](http://bittorrent.org/beps/bep_0015.html)/[TCP](http://wiki.theory.org/BitTorrentSpecification#Tracker_.27scrape.27_Convention) torrent scrape protocol.\n\n## Get started\n\nAll methods below returns a hash similar to this one.\n\n``` ruby\n{\n  seeders: 123,\n  leechers: 456,\n  downloads: 789\n}\n```\n\n### Specify a protocol\n\nA second argument may be passed to `load`, `raw` and `calculate` to specify which protocol to use.\nAn example argument would look like this: `[:tcp, :udp]`, both tcp and udp are defaults.\n\n### A local torrent file\n\n``` ruby\nFirecracker.load(\"path/to/file.torrent\")\n```\n\n### A raw torrent string\n\n``` ruby\ntorrent = RestClient.get(\"http://mysite.com/file.torrent\")\nFirecracker.raw(torrent)\n```\n\n### A String#bdecode hash\n\n``` ruby\ntorrent = RestClient.get(\"http://mysite.com/file.torrent\")\nFirecracker.calculate(torrent.bdecode)\n```\n\n## Helper methods\n\nIngoing argument (`torrent`) is from now on a [String#bdecode](https://github.com/naquad/bencode_ext) hash.\n\n``` ruby\nrequire \"bencode_ext\"\ntorrent = File.read(\"path/to/file.torrent\").bdecode\n```\n\n### Generate a info_hash string\n\n``` ruby\nFirecracker.hash(torrent)\n# =\u003e \"03db8637a8e16f7d5e3e4f7557d5d87b1905dc16\"\n```\n\n### A list of TCP/UDP trackers\n\n``` ruby\nFirecracker.udp_trackers(torrent)\n# =\u003e [\"udp://tracker.openbittorrent.com:80\", \"...\"]\n\nFirecracker.tcp_trackers(torrent)\n# =\u003e [\"http://torrent.ubuntu.com:6969/scrape\", \"...\"]\n```\n\n## UDP/TCP requests\n\nIf you want to define your own server or/and protocol you can do this using the [TCPScraper](https://github.com/oleander/firecracker/blob/master/lib/firecracker/tcp_scraper.rb) and [UDPScraper](https://github.com/oleander/firecracker/blob/master/lib/firecracker/udp_scraper.rb) classes.\n\nThe hash being passed is a [info_hash](http://wiki.theory.org/BitTorrent_Tracker_Protocol) string.\n\nYou can in theory pass up to 72 hashes in one request.\n\nKeep in mind that if one of the passed hashes is invalid or doesn't exist, the requested server might return 404 or 400.  \nIt's therefore recommended to make one request for each hash. \n\n### TCP\n\n``` ruby\nFirecracker::TCPScraper.new({\n  tracker: \"exodus.desync.com:6969/announce\",\n  hashes: [\"c2cff4acc8f5b49fd6b93b88fc0423467fbb08b0\"]\n}).process!\n\n# =\u003e {\n#   c2cff4acc8f5b49fd6b93b88fc0423467fbb08b0: {\n#     seeders: 123,\n#     leechers: 456,\n#     downloads: 789\n#   }\n# }\n```\n\n### UDP\n\n``` ruby\nFirecracker::UDPScraper.new({\n  tracker: \"tracker.openbittorrent.com\",\n  hashes: [\"523d83e8aee1a979e66584b5304d2e8fdc9a1675\"]\n}).process!\n\n# =\u003e {\n#   523d83e8aee1a979e66584b5304d2e8fdc9a1675: {\n#     seeders: 123,\n#     leechers: 456,\n#     downloads: 789\n#   }\n# }\n```\n\n## How to install\n\n    [sudo] gem install firecracker\n\n## Requirements\n\nRuby *1.9.2*.\n\n## License\n\n*Firecracker* is released under the *MIT license*.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleander%2Ffirecracker-rb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foleander%2Ffirecracker-rb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleander%2Ffirecracker-rb/lists"}