mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-07 00:16:57 +08:00
fix SiteParser close session
This commit is contained in:
@@ -156,6 +156,7 @@ class SiteParserBase(metaclass=ABCMeta):
|
|||||||
解析站点信息
|
解析站点信息
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
|
try:
|
||||||
# Cookie模式时,获取站点首页html
|
# Cookie模式时,获取站点首页html
|
||||||
if self.request_mode == "apikey":
|
if self.request_mode == "apikey":
|
||||||
if not self.apikey and not self.token:
|
if not self.apikey and not self.token:
|
||||||
@@ -203,6 +204,9 @@ class SiteParserBase(metaclass=ABCMeta):
|
|||||||
)
|
)
|
||||||
# 解析用户做种信息
|
# 解析用户做种信息
|
||||||
self._parse_seeding_pages()
|
self._parse_seeding_pages()
|
||||||
|
finally:
|
||||||
|
# 关闭连接
|
||||||
|
self.close()
|
||||||
|
|
||||||
def _pase_unread_msgs(self):
|
def _pase_unread_msgs(self):
|
||||||
"""
|
"""
|
||||||
@@ -430,6 +434,14 @@ class SiteParserBase(metaclass=ABCMeta):
|
|||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def close(self):
|
||||||
|
"""
|
||||||
|
关闭会话
|
||||||
|
"""
|
||||||
|
if self._session:
|
||||||
|
self._session.close()
|
||||||
|
self._session = None
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""
|
"""
|
||||||
转化为字典
|
转化为字典
|
||||||
|
|||||||
Reference in New Issue
Block a user