Skip to content

Commit

Permalink
rollback #3584
Browse files Browse the repository at this point in the history
  • Loading branch information
jxxghp committed Dec 29, 2024
1 parent a3b5e51 commit c49e79d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions app/modules/indexer/spider/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ class TorrentSpider:
torrents_info_array: list = []
# 搜索超时, 默认: 15秒
_timeout = 15
# 站点解析时是否需要编码
encoding: bool = False

def __init__(self,
indexer: CommentedMap,
Expand Down Expand Up @@ -97,7 +95,6 @@ def __init__(self,
self.domain = indexer.get('domain')
self.result_num = int(indexer.get('result_num') or 100)
self._timeout = int(indexer.get('timeout') or 15)
self.encoding = indexer.get('encoding', False)
self.page = page
if self.domain and not str(self.domain).endswith("/"):
self.domain = self.domain + "/"
Expand Down Expand Up @@ -731,10 +728,7 @@ def parse(self, html_text: str) -> List[dict]:
self.torrents_info_array = []
try:
# 解析站点文本对象
if self.encoding:
html_doc = PyQuery(html_text.encode(self.encoding))
else:
html_doc = PyQuery(html_text)
html_doc = PyQuery(html_text)
# 种子筛选器
torrents_selector = self.list.get('selector', '')
# 遍历种子html列表
Expand Down

0 comments on commit c49e79d

Please sign in to comment.