mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-04-24 02:20:38 +08:00
not sure if it's used
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import re
|
||||
import logging
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
import xml.etree.ElementTree
|
||||
from typing import Tuple
|
||||
|
||||
from module.conf import settings
|
||||
from module.utils import json_config
|
||||
@@ -13,9 +13,9 @@ class RSSFilter:
|
||||
def __init__(self):
|
||||
self.filter_rule = json_config.load(settings.filter_rule)
|
||||
|
||||
def filter(self, item: BeautifulSoup):
|
||||
title = item.title.string
|
||||
torrent = item.find("enclosure")
|
||||
def filter(self, item: xml.etree.ElementTree.Element) -> Tuple[bool, str]:
|
||||
title = item.find('title').text
|
||||
torrent = item.find("enclosure").attrib['url']
|
||||
download = False
|
||||
for rule in self.filter_rule:
|
||||
if re.search(rule["include"], title):
|
||||
@@ -23,4 +23,3 @@ class RSSFilter:
|
||||
download = True
|
||||
logger.debug(f"{title} added")
|
||||
return download, torrent
|
||||
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
import re
|
||||
|
||||
import xml.etree.ElementTree
|
||||
from dataclasses import dataclass
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
from .request_url import RequestURL
|
||||
|
||||
from module.conf import settings
|
||||
|
||||
import xml.etree.ElementTree
|
||||
|
||||
FILTER = "|".join(settings.rss_parser.filter)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user