adriengibrat / torrent-rw

php5 class to read and write .torrent files
GNU General Public License v3.0
324 stars 104 forks source link

hi,how to clean the torrent file? #31

Closed bain2018 closed 8 years ago

bain2018 commented 8 years ago

hi,how to clean the torrent file? if i have download a torrent file ,but in the torrent comment or the file name exist some forbidden word ,such as sexy,porn,so it's not for user to read it,i want to transfer the bad word to other format,that the user can't read it clear,for example,the bad word is " sex porn" after tranfer it by md5 function,it's md5('sex porn') = 276df15cc7611d1ec34914de60d24611,so nobody can read the bad word anymore.

but if i have transfer the bad word and save the torrent file again,the torrent client can't download the file anymore. do u know how to resulte this problem?

adriengibrat commented 8 years ago

not sure to understand what you want to achieve with md5 or what the "can't download" issue is... could you provide actual torrent file + code or pseudo code of you 'clean up' process?

FYI, changing torrent name (with the ->name('...') method) will change the torrent hash (the unique id of the torrent used to get the content), so changing this will make the torrent unusable if you don't seed the actual content via p2p or httpseeds / url_list.

Changing "comment" does not modify hash, so it's safe to 'clean' it.

adriengibrat commented 8 years ago

no news, good news...

bain2018 commented 8 years ago

thanks