idlesign / torrentool

The tool to work with torrent files.
https://github.com/idlesign/torrentool
BSD 3-Clause "New" or "Revised" License
148 stars 30 forks source link

source tag is not added to the torrent? #29

Closed brokedarius closed 11 months ago

brokedarius commented 11 months ago
        for t in args.tracker:
            out = os.path.join(output_path, ('[' + t + '] ' + name + ".torrent"))             

            if t == args.tracker[0] or len(t) == 1:
                new_torrent = Torrent.create_from(f)
                new_torrent.private = config["private"]
                new_torrent.created_by = 'torrentool'

            new_torrent.source = t
            new_torrent.announce_urls = config["tracker_abbreviations"][t]               
            new_torrent.to_file(out)

Hi there,

Maybe I got something wrong with this snippet here, my goal is to create a torrent for multiple trackers with different passkeys and sources but it seems everything goes well except for the source tag which I cannot see anywhere after opening the torrent with a bencode editor.

The condition is there just so I don't recompute the torrent twice. Thanks again for any info.

EDIT: Seems that adding these 2 functions in torrent.py (copied the logic from the ones for the comment field) makes the magic operate

    @property
    def source(self) -> Optional[str]:
        """Optional. Source Tag."""
        return self._struct.get('source')

    @source.setter
    def source(self, val: str):
        self._struct['info']['source'] = val

It works when I do it like this else, I don't see any other mention of any source tag in the code but my knowledge is average so you never know.

idlesign commented 11 months ago

Hi.

It seems to be related to #24 and worked upon in #27

Seems that adding these 2 functions in torrent.py (copied the logic from the ones for the comment field) makes the magic operate

Those methods are already in place in 1.2.0

brokedarius commented 11 months ago

my bad yeah I was on 1.1.1 thanks again

idlesign commented 11 months ago

Considered closed.