{"id":13792985,"url":"https://github.com/adriengibrat/torrent-rw","last_synced_at":"2026-03-14T01:09:22.323Z","repository":{"id":520175,"uuid":"148431","full_name":"adriengibrat/torrent-rw","owner":"adriengibrat","description":"php5  class to read and write .torrent files","archived":false,"fork":false,"pushed_at":"2022-12-11T09:47:01.000Z","size":96,"stargazers_count":317,"open_issues_count":5,"forks_count":104,"subscribers_count":40,"default_branch":"master","last_synced_at":"2024-08-04T22:19:14.005Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adriengibrat.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2009-03-11T15:03:43.000Z","updated_at":"2024-07-26T18:04:59.000Z","dependencies_parsed_at":"2023-01-11T15:28:40.824Z","dependency_job_id":null,"html_url":"https://github.com/adriengibrat/torrent-rw","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/adriengibrat%2Ftorrent-rw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adriengibrat%2Ftorrent-rw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adriengibrat%2Ftorrent-rw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adriengibrat%2Ftorrent-rw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adriengibrat","download_url":"https://codeload.github.com/adriengibrat/torrent-rw/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225144934,"owners_count":17427894,"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-08-03T22:01:19.497Z","updated_at":"2025-12-17T21:39:10.350Z","avatar_url":"https://github.com/adriengibrat.png","language":"PHP","funding_links":[],"categories":["PHP","类库"],"sub_categories":["URL/Domain"],"readme":"Torrent RW\n\nPHP version 5.2+\n\n1) Features:\n- Decode torrent file or data\n- Build torrent from source folder/file(s)\n- Silent Exception error system\n\n2) Usage example\n```php\nrequire_once 'Torrent.php';\n\n// get torrent infos\n$torrent = new Torrent( './test.torrent' );\necho '\u003cbr\u003eprivate: ', $torrent-\u003eis_private() ? 'yes' : 'no', \n\t '\u003cbr\u003eannonce: ', $torrent-\u003eannounce(), \n\t '\u003cbr\u003ename: ', $torrent-\u003ename(), \n\t '\u003cbr\u003ecomment: ', $torrent-\u003ecomment(), \n\t '\u003cbr\u003epiece_length: ', $torrent-\u003epiece_length(), \n\t '\u003cbr\u003esize: ', $torrent-\u003esize( 2 ),\n\t '\u003cbr\u003ehash info: ', $torrent-\u003ehash_info(),\n\t '\u003cbr\u003estats: ';\nvar_dump( $torrent-\u003escrape() );\necho '\u003cbr\u003econtent: ';\nvar_dump( $torrent-\u003econtent() );\necho '\u003cbr\u003esource: ',\n\t $torrent;\n\n// get magnet link\n$torrent-\u003emagnet(); // use $torrent-\u003emagnet( false ); to get non html encoded ampersand\n\n// create torrent\n$torrent = new Torrent( array( 'test.mp3', 'test.jpg' ), 'http://torrent.tracker/annonce' );\n$torrent-\u003esave('test.torrent'); // save to disk\n\n// modify torrent\n$torrent-\u003eannounce('http://alternate-torrent.tracker/annonce'); // add a tracker\n$torrent-\u003eannounce(false); // reset announce trackers\n$torrent-\u003eannounce(array('http://torrent.tracker/annonce', 'http://alternate-torrent.tracker/annonce')); // set tracker(s), it also works with a 'one tracker' array...\n$torrent-\u003eannounce(array(array('http://torrent.tracker/annonce', 'http://alternate-torrent.tracker/annonce'), 'http://another-torrent.tracker/annonce')); // set tiered trackers\n$torrent-\u003ecomment('hello world');\n$torrent-\u003ename('test torrent');\n$torrent-\u003eis_private(true);\n$torrent-\u003ehttpseeds('http://file-hosting.domain/path/'); // Bittornado implementation\n$torrent-\u003eurl_list(array('http://file-hosting.domain/path/','http://another-file-hosting.domain/path/')); // GetRight implementation\n\n// print errors\nif ( $errors = $torrent-\u003eerrors() )\n\tvar_dump( $errors );\n\n// send to user\n$torrent-\u003esend();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadriengibrat%2Ftorrent-rw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadriengibrat%2Ftorrent-rw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadriengibrat%2Ftorrent-rw/lists"}