Root Fields ########### Fields of the torrent file that are not parts of the info dictionary. By changing these fields you're not creating a separate torrent file (not changing infohash). All fields can be unset by passing ``null``. Announce ======== The URL of the tracker. ``string``. .. code-block:: php setAnnounce('udp://example.com/announce'); $announce = $torrent->getAnnounce(); Announce List ============= .. note:: BEP-12_ Multitracker Metadata Extension .. _BEP-12: https://www.bittorrent.org/beps/bep_0012.html A list of lists of tracker URLs. See :ref:`the type section ` for acceptable formats. .. code-block:: php setAnnounceList([['udp://example.com/announce']]); // get Announce List as AnnounceList object $torrent->getAnnounceList(); // get Announce List as array $torrent->getAnnounceList()->toArray(); Comment ======= Optional description. ``string``. .. code-block:: php setComment('My Torrent'); $comment = $torrent->getComment(); Created By ========== Optional info about the creator. ``string``. .. code-block:: php setCreatedBy('Me'); $createdBy = $torrent->getCreatedBy(); Creation Date ============= Optional info about the creation date. ``DateTimeImmutable``. .. code-block:: php setCreationDate(new DateTime('now')); // set by int timestamp $torrent->setCreationDate(time()); // get DateTimeImmutable object $creationDate = $torrent->getCreationDate(); // get int timestamp $creationDate = $torrent->getCreationDate()->getTimestamp(); HTTP Seeds ========== .. note:: BEP-17_ HTTP Seeding .. _BEP-17: https://www.bittorrent.org/beps/bep_0017.html A list of HTTP seeding URLs. See :ref:`the type section ` for acceptable formats. .. code-block:: php setHttpSeeds(['https://www.whatever.com/seed.php']); // get Http Seeds as UriList object $torrent->getHttpSeeds(); // get Http Seeds as array $torrent->getHttpSeeds()->toArray(); Nodes ===== .. note:: BEP-5_ DHT Protocol .. _BEP-5: https://www.bittorrent.org/beps/bep_0005.html A list of DHT nodes. See :ref:`the type section ` for acceptable formats. .. code-block:: php setNodes([ ['127.0.0.1', 6881], ['your.router.node', 4804], ['2001:db8:100:0:d5c8:db3f:995e:c0f7', 1941], ]); // get Url List as UriList object $torrent->getNodes(); // get Url List as array $torrent->getNodes()->toArray(); URL List ======== .. note:: BEP-19_ WebSeed - HTTP/FTP Seeding .. _BEP-19: https://www.bittorrent.org/beps/bep_0019.html A list of webseed URLs. See :ref:`the type section ` for acceptable formats. .. code-block:: php setUrlList(['https://mirror.com/pub/']); // get Url List as UriList object $torrent->setUrlList(); // get Url List as array $torrent->setUrlList()->toArray();