Skip to content

Commit

Permalink
Merge pull request #73 from kikiyou18/master
Browse files Browse the repository at this point in the history
  • Loading branch information
sqzw-x authored Feb 7, 2024
2 parents a046c69 + ba58501 commit 51dd142
Show file tree
Hide file tree
Showing 10 changed files with 728 additions and 238 deletions.
2 changes: 2 additions & 0 deletions src/controllers/main_window/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -2061,6 +2061,8 @@ def _netResult(self):
'mdtv': ['https://www.mdpjzip.xyz', ''],
'madouqu': ['https://madouqu.com', ''],
'cnmdb': ['https://cnmdb.net', ''],
'hscangku': ['https://hscangku.net', ''],
'cableav': ['https://cableav.tv', ''],
'lulubar': ['https://lulubar.co', ''],
'love6': ['https://love6.tv', ''],
'yesjav': ['http://www.yesjav.info', ''],
Expand Down
4 changes: 4 additions & 0 deletions src/models/config/config_manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ class ManualConfig:
'lulubar',
'madouqu',
'mdtv',
'hscangku',
'cableav',
'mgstage',
'mywife',
'prestige',
Expand Down Expand Up @@ -513,6 +515,8 @@ class ManualConfig:
'mdtv': 'mdtv',
'mdpjzip': 'mdtv',
'madouqu': 'madouqu',
'hsck': 'hscangku',
'cableav': 'cableav',
'mgstage': 'mgstage',
'7mmtv': '7mmtv',
'bb9711': '7mmtv',
Expand Down
10 changes: 8 additions & 2 deletions src/models/core/crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from models.core.flags import Flags
from models.crawlers import airav_cc_new, airav_new, avsex, avsox, cnmdb, dahlia, dmm, faleno, fantastica, fc2, fc2club, \
fc2hub, freejavbt, getchu, getchu_dmm, giga, hdouban, iqqtv_new, jav321, javbus, javdb, javlibrary_new, kin8, love6, \
lulubar, madouqu, mdtv, mgstage, mmtv, mywife, official, prestige, theporndb, xcity
lulubar, madouqu, mdtv, mgstage, mmtv, mywife, official, prestige, theporndb, xcity, hscangku, cableav
from models.entity.enums import FileMode


Expand Down Expand Up @@ -124,7 +124,7 @@ def _call_crawler(json_data, website, language, file_number, short_number, mosai
elif website == 'mgstage':
json_data = json.loads(mgstage.main(file_number, appoint_url, log_info, req_web, language, short_number))
elif website == '7mmtv':
json_data = json.loads(mmtv.main(file_number, appoint_url, log_info, req_web, language))
json_data = json.loads(mmtv.main(file_number, appoint_url, log_info, req_web, language, file_path))
elif website == 'fc2':
json_data = json.loads(fc2.main(file_number, appoint_url, log_info, req_web, language))
elif website == 'fc2hub':
Expand All @@ -137,6 +137,12 @@ def _call_crawler(json_data, website, language, file_number, short_number, mosai
elif website == 'madouqu':
json_data = json.loads(
madouqu.main(file_number, appoint_url, log_info, req_web, language, file_path, appoint_number))
elif website == 'hscangku':
json_data = json.loads(
hscangku.main(file_number, appoint_url, log_info, req_web, language, file_path, appoint_number))
elif website == 'cableav':
json_data = json.loads(
cableav.main(file_number, appoint_url, log_info, req_web, language, file_path, appoint_number))
elif website == 'getchu':
json_data = json.loads(getchu.main(file_number, appoint_url, log_info, req_web, language))
elif website == 'getchu_dmm':
Expand Down
43 changes: 28 additions & 15 deletions src/models/core/nfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ def write_nfo(json_data, nfo_new_path, folder_new_path, file_path, edit_mode=Fal
nfo_title = config.naming_media
if not number:
number = title
# 默认emby视频标题配置为 [number title],国产重复时需去掉一个,去重需注意空格也应一起去掉,否则国产的nfo标题中会多一个空格
# 读取nfo title信息会去掉前面的number和空格以保留title展示出来,同时number和标题一致时,去掉number的逻辑变成去掉整个标题导致读取失败,见426行
if number == title and 'number' in nfo_title and 'title' in nfo_title:
nfo_title = nfo_title.replace('originaltitle', '').replace('title', '')
nfo_title = nfo_title.replace('originaltitle', '').replace('title', '').strip()
first_letter = get_number_first_letter(number)

# 处理演员
Expand Down Expand Up @@ -204,20 +206,29 @@ def write_nfo(json_data, nfo_new_path, folder_new_path, file_path, edit_mode=Fal
# 输出国家
if 'country,' in nfo_include_new:
print(f" <countrycode>{country}</countrycode>", file=code)

# 输出演员

#初始化 actor_list
actor_list = []
# 输出男女演员
if 'actor_all,' in nfo_include_new:
actor = all_actor
if actor and actor != '未知演员' and actor != '未知演員' and 'actor,' in nfo_include_new:
# 有演员时输出演员
if 'actor,' in nfo_include_new and actor:
actor_list = actor.split(',') # 字符串转列表
actor_list = [actor.strip() for actor in actor_list if actor.strip()] # 去除空白
if actor_list:
for each in actor_list:
print(" <actor>", file=code)
print(" <name>" + each + "</name>", file=code)
print(" <type>Actor</type>", file=code)
print(" </actor>", file=code)

# 无演员时输出演员 以文件命名设置中未知演员设置项为演员名,默认设置和空值不写入NFO
elif 'actor,' in nfo_include_new and config.actor_no_name not in ["未知演员",'未知演員','']:
actor = config.actor_no_name
actor_list = actor.split(',') # 字符串转列表
actor_list = [actor.strip() for actor in actor_list if actor.strip()] # 去除空白
signal.add_log(f'⛑️ 无演员名, 使用手动命名 写入NFO {config.actor_no_name}')
if actor_list:
for each in actor_list:
print(" <actor>", file=code)
print(" <name>" + each + "</name>", file=code)
print(" <type>Actor</type>", file=code)
print(" </actor>", file=code)

# 输出导演
if director and 'director,' in nfo_include_new:
print(" <director>" + director + "</director>", file=code)
Expand Down Expand Up @@ -318,10 +329,12 @@ def write_nfo(json_data, nfo_new_path, folder_new_path, file_path, edit_mode=Fal
print(" <website>" + website + "</website>", file=code)

# javdb id 输出, 没有时使用番号搜索页
if 'javdbid' in json_data_nfo and json_data_nfo['javdbid']:
print(" <javdbid>" + json_data_nfo["javdbid"] + "</javdbid>", file=code)
else:
print(" <javdbsearchid>" + number + "</javdbsearchid>", file=code)
if 'javdbid' in json_data_nfo:
# 其他非javdb网站取消强制输出该字段
if json_data_nfo['javdbid']:
print(" <javdbid>" + json_data_nfo["javdbid"] + "</javdbid>", file=code)
else:
print(" <javdbsearchid>" + number + "</javdbsearchid>", file=code)
print("</movie>", file=code)
json_data['logs'] += "\n 🍀 Nfo done! (new)(%ss)" % get_used_time(start_time)
return True
Expand Down
Loading

0 comments on commit 51dd142

Please sign in to comment.