{"id":18619947,"url":"https://github.com/xtyxtyx/torrent_parser","last_synced_at":"2025-04-11T02:30:55.102Z","repository":{"id":56841394,"uuid":"197539744","full_name":"xtyxtyx/torrent_parser","owner":"xtyxtyx","description":"🧲 Utility to parse .torrent files, implemented in pure dartlang.","archived":false,"fork":false,"pushed_at":"2019-07-27T15:16:26.000Z","size":102,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T09:38:47.837Z","etag":null,"topics":["dart","flutter","parser","torrent"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/torrent_parser","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xtyxtyx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-18T07:55:11.000Z","updated_at":"2023-04-18T07:27:36.000Z","dependencies_parsed_at":"2022-08-29T12:51:16.885Z","dependency_job_id":null,"html_url":"https://github.com/xtyxtyx/torrent_parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtyxtyx%2Ftorrent_parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtyxtyx%2Ftorrent_parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtyxtyx%2Ftorrent_parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtyxtyx%2Ftorrent_parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xtyxtyx","download_url":"https://codeload.github.com/xtyxtyx/torrent_parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248329527,"owners_count":21085550,"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":["dart","flutter","parser","torrent"],"created_at":"2024-11-07T04:04:16.576Z","updated_at":"2025-04-11T02:30:54.816Z","avatar_url":"https://github.com/xtyxtyx.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"Utility to parse .torrent files. ![ci][ci]\n\nTo parse bencoded data consider using https://pub.dev/packages/torrent_bencode\n\n## Standalone executable\n\nInstallation\n```sh\n# install with pub\npub global activate torrent_parser\n```\n\nUsage\n```json\ntp ./test/multi.torrent\n\n{\n  \"encoding\": \"UTF-8\",\n  \"announce\": \"http://tr.bangumi.moe:6969/announce\",\n  \"created by\": \"rin-pr/0.5.1\",\n  \"creation date\": 1494251524,\n  \"info\": {\n    \"name\": \"[Sakurato.sub] [New Game!] [13_OVA] [GB] [720P]\",\n    \"length\": null,\n    \"piece length\": 131072,\n    \"files\": [\n      {\n        \"length\": 132320705,\n        \"path\": [\n          \"[Sakurato.sub] [New Game!] [13_OVA] [GB] [720P].mp4\"\n        ]\n      },\n      ...\n    ],\n    \"pieces\": [\n      \"a5641ed0f4be619742fd56bc3fe3f4454c5ebed6\",\n      \"37a1f42bf736ea12eb76b0ccb53bf505d3babb15\",\n      \"7b46a960cfd74c491a77a1335462f9311ff6d9ae\",\n      \"ef84bb9f06d96b9bf532134095b311c1ab3e7087\",\n      \"0be60c3fa15f8981186b4931ca6151ad4e39fd96\",\n      \"cba2ca15ed8b110c57f52f0d58767abf73eca3a4\",\n      \"cbfcb848de4ab11db8f375516371c24c2a739320\",\n      \"e22f05de6ec9b31e336bc409f591b8a9ee4fb725\",\n      ...\n    ]\n  }\n}\n```\n\n## Usage\n\nAn example:\n\n```dart\nimport 'package:torrent_parser/torrent_parser.dart';\n\nmain() async {\n  final parser = await TorrentParser.fromFile('test/multi.torrent');\n  // or final parser = TorrentParser.fromString('d8:announce27:http://example.com/announcee');\n\n  final torrent = parser.parse();\n  // or final torrent = parser.tryParse();\n  // which return null rather than throw an exception on failure\n\n  print(torrent);\n  // Output:\n  //\n  // {\n  //   \"encoding\": \"UTF-8\",\n  //   \"announce\": \"http://tr.bangumi.moe:6969/announce\",\n  //   \"info\": {\n  //     \"length\": null,\n  //     \"name\": \"[Sakurato.sub] [New Game!] [13_OVA] [GB] [720P]\",\n  //     \"files\": [\n  //       {\n  //         \"length\": 132320705,\n  //         \"path\": [\n  //           \"[Sakurato.sub] [New Game!] [13_OVA] [GB] [720P].mp4\"\n  //         ]\n  //       },\n  //       ...\n  //     ],\n  //     \"piece length\": 131072,\n  //     \"pieces\": [\n  //       \"a5641ed0f4be619742fd56bc3fe3f4454c5ebed6\",\n  //       \"37a1f42bf736ea12eb76b0ccb53bf505d3babb15\",\n  //       \"cba2ca15ed8b110c57f52f0d58767abf73eca3a4\",\n  //       \"cbfcb848de4ab11db8f375516371c24c2a739320\",\n  //       ...\n  //     ]\n  //   },\n  //   \"announce-list\": [\n  //     [\n  //       \"http://tr.bangumi.moe:6969/announce\"\n  //     ],\n  //     [\n  //       \"http://t.nyaatracker.com/announce\"\n  //     ],\n  //     ...\n  //   ],\n  //   \"created by\": \"rin-pr/0.5.1\",\n  //   \"creation date\": 1494251524\n  // }\n\n  print(torrent.announce);\n  // Output:\n  //\n  // http://tr.bangumi.moe:6969/announce\n\n  print(torrent.info.name);\n  // Output:\n  //\n  // [Sakurato.sub] [New Game!] [13_OVA] [GB] [720P]\n}\n\n```\n\n## Test\n\nRun tests with:\n```\npub run test\n```\n\n## References\n\n- http://bittorrent.org/beps/bep_0000.html\n- http://bittorrent.org/beps/bep_0003.html\n\n## Features and bugs\n\nPlease file feature requests and bugs at the [Github issues][tracker].\n\n[tracker]: https://github.com/xtyxtyx/torrent_parser\n[ci]: https://travis-ci.org/xtyxtyx/torrent_parser.svg?branch=master","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtyxtyx%2Ftorrent_parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxtyxtyx%2Ftorrent_parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtyxtyx%2Ftorrent_parser/lists"}