diff --git a/extractors/base/site.py b/extractors/base/site.py index 58eeacf..016ae5c 100644 --- a/extractors/base/site.py +++ b/extractors/base/site.py @@ -137,7 +137,7 @@ def post_data(self, url, params=None, **kwargs): """Encapsulation requests's method - POST""" return requests.post(url=url, params=params, cookies=self.cookies, **kwargs) - def enhance_descr(self, torrent, info_dict): + def enhance_descr(self, torrent, descr_text, clone_id): video_file = None for test_file in [v["name"] for k, v in torrent.files().items()]: # To get video file if (os.path.splitext(test_file)[1]).lower() in Video_Containers: @@ -151,10 +151,10 @@ def enhance_descr(self, torrent, info_dict): shot = descr.build_shot(file=video_file, encode=self.encode) if self._EXTEND_DESCR_THUMBNAILS else "" mediainfo = descr.build_mediainfo(file=video_file, encode=self.encode) if self._EXTEND_DESCR_MEDIAINFO else "" - clone_info = descr.build_clone_info(clone_id=info_dict["clone_id"], + clone_info = descr.build_clone_info(clone_id=clone_id, encode=self.encode) if self._EXTEND_DESCR_CLONEINFO else "" - return before + info_dict["descr"] + shot + mediainfo + clone_info + return before + descr_text + shot + mediainfo + clone_info # -*- The feeding function -*- def torrent_feed(self, torrent): diff --git a/extractors/byrbt.py b/extractors/byrbt.py index 273bc46..be5eb77 100644 --- a/extractors/byrbt.py +++ b/extractors/byrbt.py @@ -234,7 +234,7 @@ def torrent_clone(self, tid) -> dict: return return_dict def date_raw_update(self, torrent, torrent_name_search, raw_info: dict) -> dict: - raw_info["descr"] = self.enhance_descr(torrent=torrent, info_dict=raw_info) + raw_info["descr"] = self.enhance_descr(torrent, raw_info["descr"], raw_info["clone_id"]) filetype = torrent_name_search.group("filetype") if raw_info["type"] == 401: # Series raw_info["tv_ename"] = torrent_name_search.group("full_name") diff --git a/extractors/hudbt.py b/extractors/hudbt.py index 4f51e8d..ca25110 100644 --- a/extractors/hudbt.py +++ b/extractors/hudbt.py @@ -98,7 +98,7 @@ def torrent_clone(self, tid) -> dict: return return_dict def date_raw_update(self, torrent, torrent_name_search, raw_info: dict) -> dict: - raw_info["descr"] = self.enhance_descr(torrent=torrent, info_dict=raw_info) + raw_info["descr"] = self.enhance_descr(torrent, raw_info["descr"], raw_info["clone_id"]) type_ = int(raw_info["type"]) if type_ == 418: # 欧美剧集 torrent_raw_name = torrent_name_search.group("full_name") diff --git a/extractors/npubits.py b/extractors/npubits.py index 29519c6..63ff977 100644 --- a/extractors/npubits.py +++ b/extractors/npubits.py @@ -54,7 +54,7 @@ def torrent_clone(self, tid) -> dict: return res_dic def date_raw_update(self, torrent, torrent_name_search, raw_info: dict) -> dict: - raw_info["descr"] = self.enhance_descr(torrent=torrent, info_dict=raw_info) + raw_info["descr"] = self.enhance_descr(torrent, raw_info["descr"], raw_info["clone_id"]) if int(raw_info["category"]) == 402: # Series raw_info["name"] = torrent_name_search.group("full_name") season_episode_info = episode_eng2chs(torrent_name_search.group("episode")) diff --git a/extractors/nwsuaf6.py b/extractors/nwsuaf6.py index 45945ae..18e1d1d 100644 --- a/extractors/nwsuaf6.py +++ b/extractors/nwsuaf6.py @@ -171,7 +171,7 @@ def date_raw_update(self, torrent, torrent_name_search, raw_info: dict) -> dict: # Assign raw info raw_info["name"] = new_title - raw_info["descr"] = self.enhance_descr(torrent=torrent, info_dict=raw_info) + raw_info["descr"] = self.enhance_descr(torrent, raw_info["descr"], raw_info["clone_id"]) return raw_info diff --git a/extractors/tjupt.py b/extractors/tjupt.py index 93dbedb..e6c7de0 100644 --- a/extractors/tjupt.py +++ b/extractors/tjupt.py @@ -101,7 +101,7 @@ def torrent_clone(self, tid): return res_dic def date_raw_update(self, torrent, torrent_name_search, raw_info: dict) -> dict: - raw_info["descr"] = self.enhance_descr(torrent=torrent, info_dict=raw_info) + raw_info["descr"] = self.enhance_descr(torrent, raw_info["descr"], raw_info["clone_id"]) type_ = int(raw_info["type"]) if type_ == 401: # 电影 pass