rdt-client
rdt-client copied to clipboard
[Feature Request] Reject Download Of Certain File Extension Types
What version are you using? v2.0.86
Wat OS are you running? Mac OS
Are you using Docker or as a service? Docker
Which debrid provider are you using? Real Debrid
Which downloader are you using? Internal Downloader
This is more of an enhancement request, as opposed to a bug (I'm relatively new to github, and wasn't able to work out if I can add a label to this issue, or whether I don't have sufficient permissions to do so?)
There's been an increase in malicious releases of content lately, and i'm currently manually deleting all the failed downloads that sonarr/radarr are catching as a result of it. The suggested solution is to add a filter to whatever QBT (or whatver download client is being used); Is there any way to implement this into RDT-Client, so that it can reject downloads of certain file extension types?
[https://old.reddit.com/r/radarr/comments/1fqpcfp/ive_noticed_an_uptick_in_malicious_releases_of/]
Yes, I agree. Adding extensions to "Exclude files" in the settings does not appear to have any effect.
*.7z,*.bdjo,*.bdmv,*.bin,*.bmp,*.cci,*.clpi,*.crt,*.dll,*.exe,*.html,*.idx,*.inf,*.jar,*.jpeg,*.jpg,*.m4a,*.mpls,*.msi,*.nfo,*.pdf,*.png,*.rar,*sample.mkv,*sample.mp4,*.sfv,*.srt,*.sub,*.tbl,*.txt,*.url,*.xig,*.xml,*.xrt,*.zip,*.zipx,*.lnk
Yeah I tried using the include regex but then the logs just kept saying it was rejecting the files anyway so I just went with the file size requirement which at least makes sure it only downloads the movies. Sometimes samples get through if they are big enough. I've seen it try to download .lnk files though which obviously don't work. I don't even know why they are on RealDebrid. The files will have the normal torrent names with .mkv but then .lnk as the actual extension.
File size does mitigate a bunch of the smaller file types, but .zipx is one which constantly manages to get through as they're a compressed file which shows as the full size of a piece of media, which is then picked up by the arr program.
This invariably fails to be moved/relocated as there's no valid file to be imported, so all these .zipx files just sit in the download location, taking up GB's of space, and needing to be manually removed.
I really hope there's some way to integrate exclusions into rdt-client, so that it can send a rejection back to the arr apps. It's not the worst thing to have to periodically go and clean up the download locations, but because they're legitimately picked up for download, it means tonnes of them are ending up cached on RD; also, no one really wants malicious files sitting on their system. Added to which, the whole Servarr setup kind of works on a set and forget vibe which these damn files are messing with!
I have tried getting rid of lnk files as well using regex but without any luck. this is becoming a real pain now as well and would be a welcome feature for sure.
Anyone find a solution? Still getting frequent .lnk files sneaking in. Regex settings for exluding files in the GUI hasnt seemed to work for me.
I have tried both (?i)\.lnk$ and a simple *.lnk in the Exclude files field for all tabs in the config. The Include files field is empty in all cases.
This has no effect. I'm getting multiple .lnk files daily, but only in rdt-client (qbittorrent, sabnzbd are handling the exceptions correctly). I am on version 2.0.86, running in docker.
Example file names:
Arcane.S02E04.1080p.WEB.H264-SuccessfulCrab.mkv.lnk
The.Simpsons.S36E07.1080p.WEB.H264.mkv.lnk
I'm unsure if I/we are making errors in our configuration or if there is a problem with the fields.
In my experience, these are popping up on public trackers (rarbg etc) and for episodes that are not actually release yet. Doesn't seem to be a way to stop *arr from grabbing stuff that is still pending release later that day/week, so I'll likely be disabling public trackers until we can figure this out.
following for update/fix/workaround.
tried all sorts of regex in the "exclude" box but nothings working.
Fun fact, actually nuked my main system due to opening the "movie". Wondered why Radarr wouldn't import the 4gb movie. Double clicked it over SMB, saw command prompt and immediately panicked. Task manager, closed the program and traced the link file to the exe it created, deleted that and ran the system for a few hours, no issues and no ransom but decided to just backup and nuke the drive. Disappointed to see more ".lnk" being downloaded
I don't know if this is still the case, but Alldebrid users like myself may be out of luck: https://github.com/rogerfar/rdt-client/issues/44#issuecomment-955615719
[When using Alldebrid] you can't select files when adding a torrent manually. This is because AllDebrid always downloads the full torrent. Only when the torrent is added the file list becomes visible. Even then, I found that some files will be grouped in 1 download link, so even then it's hard to figure it out.
It will use the "Only download files over X size" setting, but it will only check the actual download link.
I assume such limitations also affect filtering file names.
An alternative temporary fix for me thats been working for over a week now - Sonarr's Delay Profiles and Release Profiles. Credit to this reddit post and comments.
For delay profile I set my default delay profile to wait 60 minutes after release. I think this has prevented sonarr from trying to grab a release earlier than the air/release date which kept happening to me with these .lnk files.
For release profile I created a must not contain "SuccessfulCrab" and left the tags empty so it applies to all series. I noticed all of the .lnk files I was getting was from SuccessfulCrab.
Not sure how successful this will be long term, but instead of getting these fake .lnk releases multiple times a week, I have gone over a week without a single one.
I don't know if this is still the case, but Alldebrid users like myself may be out of luck: #44 (comment)
[When using Alldebrid] you can't select files when adding a torrent manually. This is because AllDebrid always downloads the full torrent. Only when the torrent is added the file list becomes visible. Even then, I found that some files will be grouped in 1 download link, so even then it's hard to figure it out. It will use the "Only download files over X size" setting, but it will only check the actual download link.
I assume such limitations also affect filtering file names.
I'm just noticing this as well, after having no clue why none of the regexes work, ~~nor the minimum download size~~. I do wonder though why the include/exclude regex doesn't work on AllDebrid...
There's no way around not being able to select files when downloading a torrent, but I think that's fine since it only "affects" AD, not the user of rdt-client (in the sense that, AD is downloading a file to their servers you won't ever download anyway).
The API returns the names and sizes of the file. ~~So that should at least fix the minimum download size (but the fact it's not working might also just be a bug for me right now?).~~
As for the grouping of multiple files in a single link, that might've been something of the past? Looking at a torrent of almost 1000 files in AD, I'm not seeing any duplicate links. They're all unique per file. So maybe this is fine now?
Anyhow, I'll download the source locally and experiment with it to see if I can get it working.
EDIT: Never mind the minimum download size part. It was still waiting for download links when I checked and saw it was downloading all of the files. While typing this, it switched over to downloading and correctly updated to only download the files according to the minimum download size. Still going to experiment with the include/exclude filters though!
An alternative temporary fix for me thats been working for over a week now - Sonarr's Delay Profiles and Release Profiles. Credit to this reddit post and comments.
For delay profile I set my default delay profile to wait 60 minutes after release. I think this has prevented sonarr from trying to grab a release earlier than the air/release date which kept happening to me with these .lnk files.
For release profile I created a must not contain "SuccessfulCrab" and left the tags empty so it applies to all series. I noticed all of the .lnk files I was getting was from SuccessfulCrab.
Not sure how successful this will be long term, but instead of getting these fake .lnk releases multiple times a week, I have gone over a week without a single one.
Unfortunately successfulcrab is a genuine uploader, granted there's plenty others but that name isn't a bad uploader I have had issues with these lnk files having other uploaders names too
If it's helpful for anyone else who ended up here. My specific issue is that "some" downloads from AD where downloading the full file but ending up with .lnk on the end. To solve I put below in settings... "Run external program on torrent completion" = "/bin/bash" "External program arguments" = "/data/downloads/rdt_lnk_cleaner.sh "%D""
then make a file called rdt_lnk_cleaner.sh ( and "chmod +x rdt_lnk_cleaner.sh" ) to /data/downloads ( or wherever your downloads folder or wherever convenient ).
#!/bin/bash
# Log file location
LOG_FILE="/data/db/rdt_lnk_cleaner.log"
# Torrent save path passed as the first argument
SAVE_PATH="$1"
# Log the command execution
echo "Running on: $SAVE_PATH" >> "$LOG_FILE"
# Find and rename .lnk files
find "$SAVE_PATH" -type f -name "*.lnk" -exec sh -c 'mv "$1" "${1%.lnk}"' _ {} \;
# Log completion
echo "Completed for: $SAVE_PATH" >> "$LOG_FILE"
If it's helpful for anyone else who ended up here. My specific issue is that "some" downloads from AD where downloading the full file but ending up with .lnk on the end. To solve I put below in settings... "Run external program on torrent completion" = "/bin/bash" "External program arguments" = "/data/downloads/rdt_lnk_cleaner.sh "%D""
then make a file called rdt_lnk_cleaner.sh ( and "chmod +x rdt_lnk_cleaner.sh" ) to /data/downloads ( or wherever your downloads folder or wherever convenient ).
#!/bin/bash
Log file location
LOG_FILE="/data/db/rdt_lnk_cleaner.log"
Torrent save path passed as the first argument
SAVE_PATH="$1"
Log the command execution
echo "Running on: $SAVE_PATH" >> "$LOG_FILE"
Find and rename .lnk files
find "$SAVE_PATH" -type f -name "*.lnk" -exec sh -c 'mv "$1" "${1%.lnk}"' _ {} ;
Log completion
echo "Completed for: $SAVE_PATH" >> "$LOG_FILE"
I tried this setup but I don't think it does anything? I don't see any logs showing up. I made sure to set the permissions like instructed.
@jwmann you shouldn't need to use those scripts if you're on the latest version.
Beforehand, if everything was excluded, rdt-client would just download all the files anyway. That's been changed as of a few versions ago.
Just setting the exclude files to a regex that matches any files you don't want to download should be enough.
If that doesn't work, feel free to open a new bug report issue
@Cucumberrbob Thank you for the info, I updated my instance to the latest and removed the script in favor of using exclude regex
Could you give an example of the format of the RegEx should be?
Should it be s/foo/ or /foo/ or just foo.
I assume it uses C# RegEx? or maybe it something else?
Updating the helper texts to point to some docs would go a long way I think. Maybe an example of what exactly it's running the regex on i.e. Full file path or just filename?
Just foo. So to exclude .lnk files, .*\.lnk$ would match any string ending with .lnk (as would \.lnk$, the regex just has to match a substring, it doesn’t have to match the entire string)
And yes, we just use csharp’s built in regex library.
The logic for filtering out downloads is in this file. Each ITorrentClient (debrid provider) will use this class to filter either which files it selects to download (RD), or which files it gives download links for (everyone else).
Regarding linking to docs in setting descriptions, that’s a fantastic idea!
Any PRs are welcome, and all you really need for this is HTML and markdown. The Description attribute in DbSettings.cs controls what gets shown in the UI.
I know this is an old thread, but it popped right up for me so i hope this helps someone. This is what I use in the Excluded Files field and it works great .*\.(iso|scr|lnk)$ If you want to add more file types just add it after the "lnk" like this .*\.(iso|scr|lnk|XXX|YYY|ZZZ)$