Commit Graph

46 Commits

Author SHA1 Message Date
Aranjedeath 8d27c02962 Update metainfo.go
delete "yoloham" so that is no longer the default comment string on torrents made without a comment specified. Should resolve https://github.com/anacrolix/torrent/issues/342
2020-12-10 10:12:33 +11:00
Matt Joiner 587f28d2fa Add comment to metainfo.MetaInfo.CreationDate 2020-05-13 14:33:26 +10:00
Yaroslav Kolomiiets b4e10e00a9 add BEP references to documentation of the metadata fields 2020-05-03 14:06:24 +10:00
Matt Joiner dfcb852487 gofmt simplify 2019-08-19 12:15:54 +10:00
Matt Joiner 1f3eace72f bencode: Add ignore_unmarshal_type_error tag 2018-01-27 14:31:46 +11:00
Matt Joiner da9cbc7cf0 metainfo: Omit empty Metainfo.InfoBytes 2017-11-08 19:57:05 +11:00
Matt Joiner cc17c8a54c metainfo URL list can be a string or list 2017-06-16 17:07:30 +10:00
Matt Joiner 6ca3275752 metainfo: Improve MetaInfo.AnnounceList handling 2017-02-15 20:05:28 +11:00
Matt Joiner a959bdd0f8 Revert "Quick fix for missing MetaInfo.Announce everywhere with trackers"
This reverts commit b7a8d08bbf.
2017-02-15 18:40:30 +11:00
Matt Joiner b7a8d08bbf Quick fix for missing MetaInfo.Announce everywhere with trackers 2017-02-13 22:28:42 +11:00
Matt Joiner c66c4d1744 Change type of metainfo.Info.URLList 2017-01-18 12:10:13 +11:00
Matt Joiner 51bae0a3c8 metainfo: Add helper methods to FileInfo 2017-01-04 17:15:11 +11:00
Matt Joiner b304baad1b Add error return value to metainfo.MetaInfo.UnmarshalInfo
Too many problems caused by bad info bytes in downstream projects.
2016-09-20 12:32:15 +10:00
Matt Joiner 2a1cef7c9e Remove the InfoEx type, and don't generate its infohash on the fly
Fixes #106.
2016-08-26 20:29:05 +10:00
Ye Yin 6a2137f2b6 Add Announce when AnnounceList is nil 2016-07-22 15:16:11 +08:00
Matt Joiner a4e140b939 New slices package 2016-07-12 16:40:14 +10:00
Matt Joiner 5475555252 metainfo: Move method in wrong file 2016-07-09 00:12:32 +10:00
Matt Joiner 2490c96f2f metainfo.Info.BuildFromFilePath: Ensure stable file ordering
Spotted by @axet, with precedent in Transmission.
2016-07-07 19:40:26 +10:00
Matt Joiner 2d160b0419 metainfo.InfoEx.Hash becomes a function, UpdateBytes is added, and Bytes used in marshalling
Fixes #80.
2016-05-05 22:40:38 +10:00
Matt Joiner e0451b0728 metainfo: Improve doc 2016-05-03 21:34:11 +10:00
Matt Joiner bed302faa8 metainfo.Info.BuildFromFilePath contained unnecessary log, and didn't handle error correctly 2016-05-03 20:25:16 +10:00
Matt Joiner bdf36c09cf Doc metainfo.Info.BuildFromFilePath 2016-05-03 12:51:03 +10:00
Matt Joiner 0cd8b4fd3b Allow encoding private=0 in metainfo, which fixes test for not using InfoEx.Bytes when marshalling as a shortcut 2016-04-30 11:59:10 +10:00
Matt Joiner 28c9ec2bd1 Some changes to metainfo.InfoEx and testutil 2016-04-30 11:07:29 +10:00
Seth Hoenig 9f4bf70e17 refactor struct identifiers to follow conventional go names 2016-04-18 23:11:11 -05:00
Matt Joiner fa511154e4 Move Magnet and friends into metainfo package 2016-04-04 13:48:39 +10:00
Matt Joiner b80bb6393a Use metainfo.Hash for piece and info hashes 2016-04-04 13:01:31 +10:00
Matt Joiner 0a3a5d6ae0 Finish fixing tests 2016-03-29 00:24:00 +11:00
Matt Joiner 775cf53809 Get mmap storage working 2016-03-28 21:57:04 +11:00
Matt Joiner b97b50aca9 New storage interface 2016-03-28 20:38:30 +11:00
Matt Joiner 752e884155 metainfo: Support nodes as []string or [](string, int64)
Fixes #65.
2016-02-23 22:28:23 +11:00
Matt Joiner b3a5591d14 metainfo: It looks like the "nodes" field of metainfo was never handled correctly, support []string instead of [][]string, fix tests 2016-02-23 22:04:06 +11:00
Matt Joiner 0e85ff190d go vet 2016-02-02 00:44:29 +11:00
Matt Joiner f9c600b264 metainfo: Add alternative "builder" API
The existing builder API is gross and heavy-handed. I won't rip it out just yet.
2015-10-30 01:21:09 +11:00
Matt Joiner 1a4fbed1ac Make Piece a concrete type
There was a lot of allocations occuring because it was an interface.
2015-10-19 01:31:34 +11:00
Milos Gajdos f6d1652360 Added support for trackerless metainfo files
Based on the official spec
(http://www.bittorrent.org/beps/bep_0005.html) trackerless metainfo
files do not contain announce key. Instead nodes key has to be
specified. This PR adds support for nodes key into metainfo package. It
also contains a test metainfo file.
2015-05-03 11:30:27 +01:00
Matt Joiner 526d9d738e Rewrite imports to local bencode and metainfo 2015-04-27 14:55:01 +10:00
Matt Joiner ceabaaaeb2 Add Piece.Offset 2015-03-04 13:03:47 +11:00
Matt Joiner b4d3b0d11a Add Piece.Hash() 2015-02-27 13:00:05 +11:00
Matt Joiner daf93c8232 Add various helpers to Info 2015-02-27 01:41:35 +11:00
Matt Joiner a5d60fd76f Fixes for single/multi-file torrent Infos 2015-02-26 22:12:02 +11:00
Matt Joiner 5a3a110e99 Add UpvertedFiles() to Info to make single-file torrents usable like
multi-file torrents.
2015-01-28 01:26:18 +11:00
Matt Joiner 543d0e72a9 Use the same info bytes from a decode, for a recode
This handles strange uses of optional info fields, like private=0
2014-12-01 23:28:22 -06:00
Matt Joiner e68810f29c Need to break from the parent soon... 2014-11-28 10:34:19 -06:00
Matt Joiner 9d72fd024e Expose MetaData directly so it can be bencoded from external packages 2014-07-13 17:36:06 +10:00
Matt Joiner a44d2d88c3 Rename torrent package to metainfo; expose MetaInfo["info"] so it can be used on its own
--HG--
rename : torrent/README => metainfo/README
rename : torrent/_testdata/archlinux-2011.08.19-netinstall-i686.iso.torrent => metainfo/_testdata/archlinux-2011.08.19-netinstall-i686.iso.torrent
rename : torrent/_testdata/continuum.torrent => metainfo/_testdata/continuum.torrent
rename : torrent/builder.go => metainfo/builder.go
rename : torrent/metainfo.go => metainfo/metainfo.go
rename : torrent/metainfo_test.go => metainfo/metainfo_test.go
2014-06-28 19:40:39 +10:00