fix: bugs, add disable rss api.

This commit is contained in:
EstrellaXD
2023-08-29 19:28:44 +08:00
parent 4a509deb16
commit 7ccee98e2e
13 changed files with 105 additions and 55 deletions

View File

@@ -1,14 +1,15 @@
import re
import logging
import xml.etree.ElementTree
from bs4 import BeautifulSoup
from module.conf import settings
from module.models import Torrent
from .request_url import RequestURL
from .site import mikan_parser
logger = logging.getLogger(__name__)
class RequestContent(RequestURL):
def get_torrents(
@@ -58,5 +59,8 @@ class RequestContent(RequestURL):
return self.check_url(_url)
def get_rss_title(self, _url):
soup = self.get_xml(_url)
return soup.find("./channel/title").text
try:
soup = self.get_xml(_url)
return soup.find("./channel/title").text
except ConnectionError:
logger.warning(f"Failed to get RSS title: {_url}")