1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-09-15 18:57:04 +00:00

Add feed filters (Keeplist and Blocklist)

This commit is contained in:
Manuel Garrido 2020-10-16 22:40:56 +01:00 committed by GitHub
parent 3afdf25012
commit 84b83fc3c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 359 additions and 89 deletions

View file

@ -19,6 +19,8 @@ type FeedForm struct {
Title string
ScraperRules string
RewriteRules string
BlocklistRules string
KeeplistRules string
Crawler bool
UserAgent string
CategoryID int64
@ -45,6 +47,8 @@ func (f FeedForm) Merge(feed *model.Feed) *model.Feed {
feed.FeedURL = f.FeedURL
feed.ScraperRules = f.ScraperRules
feed.RewriteRules = f.RewriteRules
feed.BlocklistRules = f.BlocklistRules
feed.KeeplistRules = f.KeeplistRules
feed.Crawler = f.Crawler
feed.UserAgent = f.UserAgent
feed.ParsingErrorCount = 0
@ -63,7 +67,6 @@ func NewFeedForm(r *http.Request) *FeedForm {
if err != nil {
categoryID = 0
}
return &FeedForm{
FeedURL: r.FormValue("feed_url"),
SiteURL: r.FormValue("site_url"),
@ -71,6 +74,8 @@ func NewFeedForm(r *http.Request) *FeedForm {
ScraperRules: r.FormValue("scraper_rules"),
UserAgent: r.FormValue("user_agent"),
RewriteRules: r.FormValue("rewrite_rules"),
BlocklistRules: r.FormValue("blocklist_rules"),
KeeplistRules: r.FormValue("keeplist_rules"),
Crawler: r.FormValue("crawler") == "1",
CategoryID: int64(categoryID),
Username: r.FormValue("feed_username"),