fix sub正则
This commit is contained in:
parent
99a06dcba0
commit
7a9ee954c5
@ -215,8 +215,7 @@ class TorrentsChain(ChainBase, metaclass=Singleton):
|
||||
if match:
|
||||
new_passkey = match.group(1)
|
||||
# 获取过期rss除去passkey部分
|
||||
old_rss = re.sub(r'&passkey=.*', '&passkey=', site.get("rss"))
|
||||
new_rss = old_rss + new_passkey
|
||||
new_rss = re.sub(r'&passkey=([a-zA-Z0-9]+)', f'&passkey={new_passkey}', site.get("rss"))
|
||||
logger.info(f"更新站点 {domain} RSS地址 ...")
|
||||
self.siteoper.update_rss(domain=domain, rss=new_rss)
|
||||
else:
|
||||
|
@ -1,5 +1,5 @@
|
||||
import xml.dom.minidom
|
||||
from typing import List, Tuple, Optional
|
||||
from typing import List, Tuple, Union
|
||||
from urllib.parse import urljoin
|
||||
|
||||
from lxml import etree
|
||||
@ -221,7 +221,7 @@ class RssHelper:
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
def parse(url, proxy: bool = False) -> Optional[List[dict], None]:
|
||||
def parse(url, proxy: bool = False) -> Union[List[dict], None]:
|
||||
"""
|
||||
解析RSS订阅URL,获取RSS中的种子信息
|
||||
:param url: RSS地址
|
||||
@ -291,7 +291,8 @@ class RssHelper:
|
||||
# RSS过期 观众RSS 链接已过期,您需要获得一个新的! pthome RSS Link has expired, You need to get a new one!
|
||||
_rss_expired_msg = [
|
||||
"RSS 链接已过期, 您需要获得一个新的!",
|
||||
"RSS Link has expired, You need to get a new one!"
|
||||
"RSS Link has expired, You need to get a new one!",
|
||||
"RSS Link has expired, You need to get new!"
|
||||
]
|
||||
if ret_xml in _rss_expired_msg:
|
||||
return None
|
||||
|
Loading…
x
Reference in New Issue
Block a user