Skip to content

Commit c49e79d

Browse files
committed
rollback #3584
1 parent a3b5e51 commit c49e79d

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

app/modules/indexer/spider/__init__.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ class TorrentSpider:
6464
torrents_info_array: list = []
6565
# 搜索超时, 默认: 15秒
6666
_timeout = 15
67-
# 站点解析时是否需要编码
68-
encoding: bool = False
6967

7068
def __init__(self,
7169
indexer: CommentedMap,
@@ -97,7 +95,6 @@ def __init__(self,
9795
self.domain = indexer.get('domain')
9896
self.result_num = int(indexer.get('result_num') or 100)
9997
self._timeout = int(indexer.get('timeout') or 15)
100-
self.encoding = indexer.get('encoding', False)
10198
self.page = page
10299
if self.domain and not str(self.domain).endswith("/"):
103100
self.domain = self.domain + "/"
@@ -731,10 +728,7 @@ def parse(self, html_text: str) -> List[dict]:
731728
self.torrents_info_array = []
732729
try:
733730
# 解析站点文本对象
734-
if self.encoding:
735-
html_doc = PyQuery(html_text.encode(self.encoding))
736-
else:
737-
html_doc = PyQuery(html_text)
731+
html_doc = PyQuery(html_text)
738732
# 种子筛选器
739733
torrents_selector = self.list.get('selector', '')
740734
# 遍历种子html列表

0 commit comments

Comments
 (0)