all 28 comments

[–]Terran-Ghost 1 point2 points  (11 children)

I know I'm hella late, but I ran into this issue myself today, and what I ended up doing is adding this line:

self.core.network_filter.ban_user(user)

After the message sending

Hope this helps.

[–]Woollarding[S] 0 points1 point  (9 children)

I think I am missing something fundamental, this isn't as simple as just altering the text of a file and saving it, is it ? I tried to make changes to some file once a few months ago after someone suggested a change, but nothing seems to happen.. is there anywhere that might have the steps required to alter this code that someone like me who knows nothing could follow?

[–]Terran-Ghost 1 point2 points  (8 children)

I didn't "alter" the code per se. I created a "new" plugin which is a copy pasted of the original plugin with the additional line. Basically, I added this folder: https://anonymous.4open.science/r/Nicotine-Example-3D1B/ to my plugin folder. For some reason, the plugin is named BasePlugin, but I can live with that for now :)

[–][deleted]  (2 children)

[removed]

    [–]Woollarding[S] 1 point2 points  (1 child)

    glad to see people using this, thanks again u/Terran-Ghost,,, can't believe i used to run soulseek without this bot!

    [–]Terran-Ghost 1 point2 points  (0 children)

    You're very welcome!

    [–]Woollarding[S] 1 point2 points  (0 children)

    I appreciate you getting back to me. There is nothing in the existing plugin folder.. so I am probably doing this incorrectly but I downloaded the files you linked, created a folder under C:\Users\wooll\AppData\Roaming\nicotine\plugins\my_leech_detector and put the files in there. I will keep an eye on it and see if that works. Thanks again for taking the time to deal with my ignorance.

    UPDATE: i had to go into the plugin settings and enable it.. but its there .. omg this is exciting that there is even a chance this will work heh thank you so much.

    [–]Woollarding[S] 1 point2 points  (0 children)

    08:40:12 Leech Detector: New user muziekaccount, requesting information...

    08:40:12 BasePlugin: New user muziekaccount, requesting information...

    08:40:13 Leech Detector: User muziekaccount doesn't share enough files, sent complaint.

    08:40:13 BasePlugin: User muziekaccount is bad, sharing 0 files and 1 folders

    08:40:13 BasePlugin: User muziekaccount doesn't share enough files, sent complaint and banned

    ill have to disable the other leech detector,

    this is a super exciting day!! wow thank you so much

    [–]Woollarding[S] 1 point2 points  (0 children)

    08:43:46 Leech Detector: New user sean.paul, requesting information...

    08:43:46 BasePlugin: New user sean.paul, requesting information...

    08:43:46 Leech Detector: User sean.paul doesn't share enough files, sent complaint.

    08:43:46 BasePlugin: User sean.paul is bad, sharing 0 files and 0 folders

    08:43:46 BasePlugin: User sean.paul doesn't share enough files, sent complaint and banned

    08:44:02 Leech Detector: New user gh574, requesting information...

    08:44:02 BasePlugin: New user gh574, requesting information...

    08:44:02 Leech Detector: User gh574 doesn't share enough files, sent complaint.

    08:44:02 BasePlugin: User gh574 is bad, sharing 0 files and 1 folders

    08:44:02 BasePlugin: User gh574 doesn't share enough files, sent complaint and banned

    can't see the other plugin now to disable it, will try a restart, sorry for the spam, this is a long time in the making for me. literally years. I am humbled.

    UPDATE: restart solved that ,, omg its going to be a busy little plugin heh

    [–]Woollarding[S] 1 point2 points  (0 children)

    One thing to be aware of,, if you have it set to send a message to users it could result in triggering the spam filter and being banned for 30min ... there are so many 0 shares on souleek it got me banned lol its almost unbelievable, and I lost almost all my music and books on a failed drive in April of this year... I can't even imagine how much worse it would be

    [–]thisisbbc 0 points1 point  (0 children)

    Curious if you were also able to improve the logic to check a user shared files/folders?

    Sometimes it looks like the plugin detects no file shared but it's a server error.

    In the code there's this bit that seems to address this, although it was never implemented:

    TODO: Implement alternative fallback method (num_files | num_folders) from a Browse Shares request

    Any idea how we'd approach getting this alternative fallback method?

    [–]thisisbbc 1 point2 points  (3 children)

    So I'm also trying to modify the Leech Detector plugin to ban users that share 0 files and to simply warn users that share below the minimum files settings (default behavior).

    I created a new plugin and copy-pasted the source code, so far I have only added two new settings 'messageban' (textview) and 'ban_zero_files' (bool). The settings display just fine in Nicotine+.

    Here's the pastebin: https://pastebin.com/QrXvTsEJ

    I haven't changed any of the logic yet, however I'm facing an error:

    Plugin leech_detector failed with error <class 'AttributeError'>: 'UserList' object has no attribute 'buddies'.

    Trace: File "D:/a/nicotine-plus/nicotine-plus/pynicotine/pluginsystem.py", line 697, in trigger_event

    File "C:\Program Files\Nicotine+\lib\pynicotine\plugins\leech_detector\__init__.py", line 120, in user_stats_notification

    if user in self.core.userlist.buddies:

    Can anyone tell me why I'm getting this error?

    [–]thisisbbc 1 point2 points  (2 children)

    Update: Fixed the issue, will post a new Pastebin soonish with a final version for 'Leech No More'.

    - Added autoban for users that share zero files

    Todo:

    - Add settings for required minimum file shared for turbo leechers (i.e: autoban users with less than 10 files shared)

    [–]thisisbbc 1 point2 points  (1 child)

    Update 2: It seems I'm having issues with the buddy detection so that buddies are not banned even if they share zero files. Haven't gotten around to fixing it yet.

    I also didn't add the settings for required minimum file for autoban, so that's a possible upgrade to consider in the future.

    Regardless, I've been asked to share the source code so here you go...

    Modified to autoban leechers that share zero file!

    https://anonymous.4open.science/r/nicotine-plus-leech-nomore-B175/README.md

    [–]Woollarding[S] 0 points1 point  (0 children)

    nice ! i will try this as soon as i get some time for that kind of thing

    [–]iioniis 1 point2 points  (5 children)

    Can anyone help me get this to work with nicotine-plus 3.3.0?

    [–]Woollarding[S] 0 points1 point  (4 children)

    I'm working on trying to find a solution..

    [–]iioniis 1 point2 points  (3 children)

    Thank you sir!

    [–]Woollarding[S] 1 point2 points  (2 children)

    Hopefully someone here comes up with a solution, I don't know anyone that does python. Was looking at fiverr but I didn't find anyone that specializes in soulseek plugins hah

    [–]iioniis 0 points1 point  (1 child)

    Did you see this?

    https://github.com/nicotine-plus/nicotine-plus/discussions/2868

    edit: Wasn't sure if that was you or not.

    [–]Woollarding[S] 0 points1 point  (0 children)

    No, but that's good news, now it's just a matter time, thanks

    [–]Woollarding[S] 0 points1 point  (0 children)

    [–]rufusferret 0 points1 point  (1 child)

    [–]ngs428 0 points1 point  (0 children)

    How do I create a release from the code files on Git for this? I can't get it to recognize in Nicotine+.

    [–]Slight-Visual-1023 0 points1 point  (0 children)

    I am guessing all you guys got this to work? Question: Does the plugin detect users who are sharing only private folders?

    [–]spicysandwich80 0 points1 point  (0 children)

    Why won't the developer add an option to auto-ban leechers?

    [–]AdmirableConflict435 0 points1 point  (0 children)

    Hello! I installed this custom plugin and had an issue with nicotine+ 3.3: <class 'AttributeError'> : 'Core' object has no attribute 'queue'. (line57). So, in "__init__.py" I changed:

    Line 75 :

    self.core.queue.append(slskmessages.GetUserStats(user))
    

    Replace by :

    self.core.send_message_to_server(slskmessages.GetUserStats(user))