Mika- / torrent-control

Firefox extension for adding torrents to remote clients.
https://addons.mozilla.org/addon/torrent-control/
179 stars 25 forks source link

[feature request] add option to use regular expressions to auto assign label #163

Open SleepyPrince opened 6 months ago

SleepyPrince commented 6 months ago

Similar to custom URL, it would be nice to have an option to auto assign the label according to specific urls/domains. The format can be something like: regexp||label (or anything that can be easy to processed without confusing the user)

I looked into the code and this can be done in webRequest.onBeforeRequest before addTorrent is called. One limitation is that originally I was planning to match the regular expressions with the origin url (instead of the torrent url). However when the extension accept the magnet address via https://torrent-control.invalid/, the origin url info is lost. So the regular expression can only be matched to the magnet address, though not ideal but may still be useful.

I have a working local copy but I don't think my amateur code is ready for pull request.

robertheadley commented 4 months ago

76