|
#1
|
|||
|
|||
Poor duplicate torrent detection in takeupload.php
With TBDev.2009(Final).rev.295 I've noticed a lot of duplicate torrents being posted, which seemed like something which would be coded against so I checked takeupload.php and it has a basic mysql check to try and prevent it.
Code:
$ret = mysql_query("INSERT INTO torrents (search_text, filename, owner, visible, info_hash, name, size, numfiles, type, descr, ori_descr, category, save_as, added, last_action, nfo, client_created_by) VALUES (" . implode(",", array_map("sqlesc", array(searchfield("$shortfname $dname $torrent"), $fname, $CURUSER["id"], "no", $infohash, $torrent, $totallen, count($filelist), $type, $descr, $descr, 0 + $_POST["type"], $dname))) . ", " . time() . ", " . time() . ", $nfo, $tmaker)"); if (!$ret) { if (mysql_errno() == 1062) stderr($lang['takeupload_failed'], $lang['takeupload_already']); stderr($lang['takeupload_failed'], "mysql puked: ".mysql_error()); } $id = mysql_insert_id(); I couldn't find anything on google suggesting a better way to do it, it's been an issue across versions, surely someone's done it better by now? |
#2
|
|||
|
|||
well of course it uploads duplicate torrents if the name is changed even with a character.. let's say you have MyTorrent.h264, then someone uploads Mytorrent-h264/MyTorrent-H264.
if the name isn't the same as previous torrent uploaded it will be a duplicate i have changed in takeupload the punctuation and spaces. basically I inversed the code. where is space to be a punctuation so every torrent will get MyTorrent.h264.xxx.aac |
#3
|
||||
|
||||
Just do a check info_hash.
they may change the name but that well stay the same.
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent Do not ask me to make a mod for any other source Do not Ask me to setup your site. I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum My Current Demo is here http://demo.btmanager.org/ |
#4
|
|||
|
|||
Quote:
Quote:
I'm wondering if there is a easy way to cross reference multiple values and form a better detection routine? 1. Don't allow duplicate hashes, this will reduce some dupes 2. Don't allow duplicate torrent names, maybe unless the new file size is larger? 3. Don't allow a file with the same size which loosely matches the same file name? No one method seems effective on its own. I wonder if creating an unique index on the size column would be too drastic? There's already one on info_hash and the torrent name, any idea what the odds of the file size being exactly the same is? Last edited by shadowfox; 5th November 2013 at 20:25. |
Tags |
detection , duplicate , poor , takeuploadphp , torrent |
Thread Tools | |
|
|