Update 3.0

This commit is contained in:
yoshiko2
2020-04-01 02:30:00 +08:00
parent 961f25bb9a
commit c110165373
42 changed files with 444 additions and 333 deletions

2
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,2 @@
# Default ignored files
/workspace.xml

10
.idea/av_data_capture.iml generated Normal file
View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="jdk" jdkName="Python 3.8 (av_data_capture)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

3
.idea/dictionaries/yohane.xml generated Normal file
View File

@@ -0,0 +1,3 @@
<component name="ProjectDictionaryState">
<dictionary name="yohane" />
</component>

View File

@@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

4
.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (av_data_capture)" project-jdk-type="Python SDK" />
</project>

8
.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/av_data_capture.iml" filepath="$PROJECT_DIR$/.idea/av_data_capture.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@@ -13,14 +13,14 @@ from configparser import ConfigParser
import argparse import argparse
def UpdateCheck(version): def UpdateCheck_Notice(htmlcode,version):
if UpdateCheckSwitch() == '1': if UpdateCheckSwitch() == '1':
html2 = get_html('https://raw.githubusercontent.com/yoshiko2/AV_Data_Capture/master/update_check.json') html = json.loads(str(htmlcode))
html = json.loads(str(html2))
if not version == html['version']: if not version == html['version']:
print('[*] * New update ' + html['version'] + ' *') line1 = '* New update ' + html['version'] + ' *'
print('[*] ↓ Download ↓') print('[*]' + line1.center(54))
print('[*]' + '↓ Download ↓'.center(54))
print('[*] ' + html['download']) print('[*] ' + html['download'])
print('[*]======================================================') print('[*]======================================================')
else: else:
@@ -91,7 +91,7 @@ def getNumber(filepath,absolute_path = False):
if __name__ == '__main__': if __name__ == '__main__':
version = '2.9' version = '3.0'
config_file = 'config.ini' config_file = 'config.ini'
config = ConfigParser() config = ConfigParser()
config.read(config_file, encoding='UTF-8') config.read(config_file, encoding='UTF-8')
@@ -99,11 +99,13 @@ if __name__ == '__main__':
failed_folder = config['common']['failed_output_folder'] # 失败输出目录 failed_folder = config['common']['failed_output_folder'] # 失败输出目录
escape_folder = config['escape']['folders'] # 多级目录刮削需要排除的目录 escape_folder = config['escape']['folders'] # 多级目录刮削需要排除的目录
escape_folder = re.split('[,]', escape_folder) escape_folder = re.split('[,]', escape_folder)
version_print = 'Version ' + version
htmlcode = get_html('https://raw.githubusercontent.com/yoshiko2/AV_Data_Capture/master/update_check.json')
print('[*]================== AV Data Capture ===================') print('[*]================== AV Data Capture ===================')
print('[*] Version ' + version) print('[*]' + version_print.center(54))
print('[*]======================================================') print('[*]======================================================')
UpdateCheck(version) UpdateCheck_Notice(htmlcode,version)
CreatFailedFolder(failed_folder) CreatFailedFolder(failed_folder)
os.chdir(os.getcwd()) os.chdir(os.getcwd())
movie_list = movie_lists('.', escape_folder) movie_list = movie_lists('.', escape_folder)
@@ -147,10 +149,8 @@ if __name__ == '__main__':
try: try:
print('[-]Move ' + i + ' to failed folder') print('[-]Move ' + i + ' to failed folder')
shutil.move(i, str(os.getcwd()) + '/' + failed_folder + '/') shutil.move(i, str(os.getcwd()) + '/' + failed_folder + '/')
except FileExistsError: except Exception as e2:
print('[!]File exists in failed!') print('[!]', e2)
except:
print('[+]skip')
continue continue
CEF(success_folder) CEF(success_folder)

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

View File

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8" ?>
<movie>
<title>SSNI-229-無抵抗言いなり痴漢電車-絶頂を教え込まれた巨乳女子大生-三上悠亜</title>
<set>
</set>
<studio>エスワンナンバーワンスタイル+</studio>
<year>2018</year>
<outline>国民的アイドル三上悠亜の初‘痴●’作品。『いやぁ!ナンの薬?そんな所に塗らないで…熱い‥お願いヤメテぇぇぇ!!!』恐怖と狂気に満ちた満員痴●車両。可憐で清楚な‘巨乳女子大生’を汚す非道な痴●魔の罠。暴力的な魔の手で巨乳を貪られ、望まぬ絶頂潮で車内を濡らす!乳首とクリを変態愛撫で執拗に辱められ濡れまくる高嶺の花。途中下車無効…通学途中に擦り込まれた逃れられない快楽!
★アダルトブック「三上悠亜写真集」の商品ご購入はこちらから★</outline>
<plot>国民的アイドル三上悠亜の初‘痴●’作品。『いやぁ!ナンの薬?そんな所に塗らないで…熱い‥お願いヤメテぇぇぇ!!!』恐怖と狂気に満ちた満員痴●車両。可憐で清楚な‘巨乳女子大生’を汚す非道な痴●魔の罠。暴力的な魔の手で巨乳を貪られ、望まぬ絶頂潮で車内を濡らす!乳首とクリを変態愛撫で執拗に辱められ濡れまくる高嶺の花。途中下車無効…通学途中に擦り込まれた逃れられない快楽!
★アダルトブック「三上悠亜写真集」の商品ご購入はこちらから★</plot>
<runtime>160分鐘</runtime>
<director>JoStyle</director>
<poster>SSNI-229-poster.jpg</poster>
<thumb>SSNI-229-thumb.jpg</thumb>
<fanart>SSNI-229-fanart.jpg</fanart>
<actor>
<name>三上悠亜</name>
</actor>
<maker>エスワンナンバーワンスタイル</maker>
<label>
</label>
<tag>巨乳</tag>
<tag>單體作品</tag>
<tag>DMM獨家</tag>
<tag>偶像藝人</tag>
<tag>女大學生</tag>
<tag>性騷擾</tag>
<tag>薄馬賽克</tag>
<tag>高畫質</tag>
<genre>巨乳</genre>
<genre>單體作品</genre>
<genre>DMM獨家</genre>
<genre>偶像藝人</genre>
<genre>女大學生</genre>
<genre>性騷擾</genre>
<genre>薄馬賽克</genre>
<genre>高畫質</genre>
<num>SSNI-229</num>
<premiered>2018-06-14</premiered>
<cover>https://pics.javbus.com/cover/6lig_b.jpg</cover>
<website>https://www.javbus.com/SSNI-229</website>
</movie>

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8" ?>
<movie>
<title>IPX-292-巨乳若妻は元彼ダメ男に嫌なほどイカされて…-桜空もも</title>
<set>
</set>
<studio>アイデアポケット+</studio>
<year>2019</year>
<outline>桜空もも初NTR作品僕とももが結婚したのは2年前。僕の一目惚れだった。プロポーズを受けてくれた時には泣きそうになった。こんな素敵な人が、本当に僕のものになってくれるなんて…。そんな僕の妻は今、恐らく元カレに抱かれている。しかも僕とのHでは今までないほど何度も絶頂して、首を絞められたり、尻を叩かれたりして喜んでいる。見たことのない妻の淫らな姿に僕は知らず知らず勃起していた…。
★アダルトブック「桜空もも写真集」の商品ご購入はこちらから★</outline>
<plot>桜空もも初NTR作品僕とももが結婚したのは2年前。僕の一目惚れだった。プロポーズを受けてくれた時には泣きそうになった。こんな素敵な人が、本当に僕のものになってくれるなんて…。そんな僕の妻は今、恐らく元カレに抱かれている。しかも僕とのHでは今までないほど何度も絶頂して、首を絞められたり、尻を叩かれたりして喜んでいる。見たことのない妻の淫らな姿に僕は知らず知らず勃起していた…。
★アダルトブック「桜空もも写真集」の商品ご購入はこちらから★</plot>
<runtime>120分鐘</runtime>
<director>朝霧浄</director>
<poster>IPX-292-poster.jpg</poster>
<thumb>IPX-292-thumb.jpg</thumb>
<fanart>IPX-292-fanart.jpg</fanart>
<actor>
<name>桜空もも</name>
</actor>
<maker>アイデアポケット</maker>
<label>
</label>
<tag>巨乳</tag>
<tag>單體作品</tag>
<tag>DMM獨家</tag>
<tag>苗條</tag>
<tag>乳交</tag>
<tag>新娘、年輕妻子</tag>
<tag>數位馬賽克</tag>
<tag>高畫質</tag>
<tag>出軌</tag>
<genre>巨乳</genre>
<genre>單體作品</genre>
<genre>DMM獨家</genre>
<genre>苗條</genre>
<genre>乳交</genre>
<genre>新娘、年輕妻子</genre>
<genre>數位馬賽克</genre>
<genre>高畫質</genre>
<genre>出軌</genre>
<num>IPX-292</num>
<premiered>2019-04-07</premiered>
<cover>https://pics.javbus.com/cover/71iz_b.jpg</cover>
<website>https://www.javbus.com/IPX-292</website>
</movie>

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8" ?>
<movie>
<title>IPX-144-アイドル美少女と交わすヨダレだらだらツバだくだく濃厚な接吻とセックス-西宮ゆめ</title>
<set>
</set>
<studio>アイデアポケット+</studio>
<year>2018</year>
<outline>アイドル美少女と思う存分じっくりねっとりイヤラシイ接吻を…。ゆめとおじさんのべちょべちょレロレロいやらし接吻ハーモニー。顔面に唇に乳首にチンポにだら~り絡みつく粘度の高い唾液。中年の乾いたペニスにネバネバ唾液をたっぷり絡ませ金玉から亀頭までベロベロ舐め回す。唾液と本気汁でグチョグチョになったオマンコを激ピストン。美少女とおじさんのねっとり糸引く濃密な接吻唾液交換セックス!</outline>
<plot>アイドル美少女と思う存分じっくりねっとりイヤラシイ接吻を…。ゆめとおじさんのべちょべちょレロレロいやらし接吻ハーモニー。顔面に唇に乳首にチンポにだら~り絡みつく粘度の高い唾液。中年の乾いたペニスにネバネバ唾液をたっぷり絡ませ金玉から亀頭までベロベロ舐め回す。唾液と本気汁でグチョグチョになったオマンコを激ピストン。美少女とおじさんのねっとり糸引く濃密な接吻唾液交換セックス!</plot>
<runtime>160分鐘</runtime>
<director>うさぴょん。</director>
<poster>IPX-144-poster.jpg</poster>
<thumb>IPX-144-thumb.jpg</thumb>
<fanart>IPX-144-fanart.jpg</fanart>
<actor>
<name>西宮ゆめ</name>
</actor>
<maker>アイデアポケット</maker>
<label>
</label>
<tag>單體作品</tag>
<tag>DMM獨家</tag>
<tag>蕩婦</tag>
<tag>美少女</tag>
<tag>數位馬賽克</tag>
<tag>高畫質</tag>
<tag>キス・接吻</tag>
<genre>單體作品</genre>
<genre>DMM獨家</genre>
<genre>蕩婦</genre>
<genre>美少女</genre>
<genre>數位馬賽克</genre>
<genre>高畫質</genre>
<genre>キス・接吻</genre>
<num>IPX-144</num>
<premiered>2018-05-17</premiered>
<cover>https://pics.javbus.com/cover/6k2d_b.jpg</cover>
<website>https://www.javbus.com/IPX-144</website>
</movie>

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" ?>
<movie>
<title>STAR-438-癒されたい男達が最後に辿り着く究極の超高級性感エステサロン-麻生希</title>
<set>
</set>
<studio>SODクリエイト+</studio>
<year>2013</year>
<outline></outline>
<plot></plot>
<runtime>204分鐘</runtime>
<director>柏倉弘</director>
<poster>STAR-438-poster.jpg</poster>
<thumb>STAR-438-thumb.jpg</thumb>
<fanart>STAR-438-fanart.jpg</fanart>
<actor>
<name>麻生希</name>
</actor>
<maker>SODクリエイト</maker>
<label>
</label>
<tag>高畫質</tag>
<tag>按摩</tag>
<tag>美容院</tag>
<tag>乳液</tag>
<tag>和服・喪服</tag>
<tag>單體作品</tag>
<genre>高畫質</genre>
<genre>按摩</genre>
<genre>美容院</genre>
<genre>乳液</genre>
<genre>和服・喪服</genre>
<genre>單體作品</genre>
<num>STAR-438</num>
<premiered>2013-06-23</premiered>
<cover>https://pics.javbus.com/cover/2h2e_b.jpg</cover>
<website>https://www.javbus.com/STAR-438</website>
</movie>

119
actor.py Normal file
View File

@@ -0,0 +1,119 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import requests, os
from configparser import RawConfigParser
from base64 import b64encode
from traceback import format_exc
from json import loads
from os.path import exists
# 检查“actor_photos”文件夹是否就绪
if not exists('actor_photos'):
print('\n“actor_photos” folder lostPlease put it to the same location with program\n')
os.system('pause')
# 读取配置文件这个ini文件用来给用户设置emby网址和api id
print('Reading ini Setting...')
config_settings = RawConfigParser()
try:
config_settings.read('ap_config.ini', encoding='utf-8-sig')
url_emby = config_settings.get("emby/jellyfin", "website")
api_key = config_settings.get("emby/jellyfin", "api id")
bool_replace = True if config_settings.get("emby/jellyfin", "是否覆盖以前上传的头像?") == '' else False
except:
print(format_exc())
print('Cannot read ini files!')
os.system('pause')
print('Read Success!\n')
# 修正用户输入的emby网址无论是不是带“/”
if not url_emby.endswith('/'):
url_emby += '/'
# 成功的个数
num_suc = 0
num_fail = 0
num_exist = 0
sep = os.sep
try:
print('Getting emby/jellyfin Person`s form...')
# curl -X GET "http://localhost:8096/emby/Persons?api_key=3291434710e342089565ad05b6b2f499" -H "accept: application/json"
# 得到所有“人员” emby api没有细分“演员”还是“导演”“编剧”等等 下面得到的是所有“有关人员”
url_emby_persons = url_emby + 'emby/Persons?api_key=' + api_key # &PersonTypes=Actor
try:
rqs_emby = requests.get(url=url_emby_persons)
except requests.exceptions.ConnectionError:
print('Cannot connect to emby/jellyfin server ,Please check', url_emby, '\n')
os.system('pause')
except:
print(format_exc())
print('Unkown Error ,Please submit screenshot to issues', url_emby, '\n')
os.system('pause')
# 401无权访问
if rqs_emby.status_code == 401:
print('Please check API KEY\n')
os.system('pause')
# print(rqs_emby.text)
try:
list_persons = loads(rqs_emby.text)['Items']
except:
print(rqs_emby.text)
print('Error! emby response')
print('Please submit screenshot to issues')
os.system('pause')
num_persons = len(list_persons)
print('There are currently' + str(num_persons) + ' People\n')
# os.system('pause')
# 用户emby中的persons在“actor_photos”文件夹中已有头像的记录下来
f_txt = open("included.txt", 'w', encoding="utf-8")
f_txt.close()
f_txt = open("no_included.txt", 'w', encoding="utf-8")
f_txt.close()
for dic_each_actor in list_persons:
actor_name = dic_each_actor['Name']
# 头像jpg/png在“actor_photos”中的路径
actor_pic_path = 'actor_photos' + sep + actor_name[0] + sep + actor_name
if exists(actor_pic_path + '.jpg'):
actor_pic_path = actor_pic_path + '.jpg'
header = {"Content-Type": 'image/jpeg', }
elif exists(actor_pic_path + '.png'):
actor_pic_path = actor_pic_path + '.png'
header = {"Content-Type": 'image/png', }
else:
print('>>No image', actor_name)
f_txt = open("no_included.txt", 'a', encoding="utf-8")
f_txt.write(actor_name + '\n')
f_txt.close()
num_fail += 1
continue
# emby有某个演员“actor_photos”文件夹也有这个演员的头像记录一下
f_txt = open("included.txt", 'a', encoding="utf-8")
f_txt.write(actor_name + '\n')
f_txt.close()
# emby有某个演员已经有他的头像不再进行下面“上传头像”的操作
if dic_each_actor['ImageTags']: # emby已经收录头像
num_exist += 1
if not bool_replace: # 不需要覆盖已有头像
continue # 那么不进行下面的上传操作
f_pic = open(actor_pic_path, 'rb') # 二进制方式打开图文件
b6_pic = b64encode(f_pic.read()) # 读取文件内容转换为base64编码
f_pic.close()
url_post_img = url_emby + 'emby/Items/' + dic_each_actor['Id'] + '/Images/Primary?api_key=' + api_key
requests.post(url=url_post_img, data=b6_pic, headers=header)
print('>>Success', actor_name)
num_suc += 1
print('\nemby/jellyfin people: ', num_persons, '')
print('include photos: ', num_exist, '')
if bool_replace:
print('ModeOverwrite existed images')
else:
print('ModeSkip existed images')
print('Success Upload', num_suc, '个!')
print('No images', num_fail, '个!')
print('Saved to “no_included.txt”\n')
os.system('pause')
except:
print(format_exc())
os.system('pause')

7
clone.sh Executable file
View File

@@ -0,0 +1,7 @@
export http_proxy='http://192.168.2.2:1080'
export https_proxy='http://192.168.2.2:1080'
git fetch --all
git reset --hard origin/master
git pull
export http_proxy=''
export https_proxy=''

View File

@@ -16,13 +16,9 @@ naming_rule=number+'-'+title
[update] [update]
update_check=1 update_check=1
[media]
media_warehouse=emby
#emby or plex or kodi ,emby=jellyfin
[escape] [escape]
literals=\()/ literals=\()/
folders=failed,JAV_output folders=failed,JAV_output
[debug_mode] [debug_mode]
switch=0 switch=0

399
core.py
View File

@@ -165,51 +165,18 @@ def get_info(json_data): # 返回json里的数据
return title, studio, year, outline, runtime, director, actor_photo, release, number, cover, website return title, studio, year, outline, runtime, director, actor_photo, release, number, cover, website
def smallCoverCheck(path, number, imagecut, cover_small, c_word, option, Config, filepath, failed_folder): def smallCoverCheck(path, number, imagecut, cover_small, c_word, Config, filepath, failed_folder):
if imagecut == 3: if imagecut == 3:
if option == 'emby': DownloadFileWithFilename(cover_small, path + '/' + number + c_word + '-poster.jpg', path, Config, filepath, failed_folder)
DownloadFileWithFilename(cover_small, '1.jpg', path, Config, filepath, failed_folder) print('[+]Image Downloaded! '+ path + '/' + number + c_word + '-poster.jpg')
try:
img = Image.open(path + '/1.jpg')
except Exception:
img = Image.open('1.jpg')
w = img.width
h = img.height
img.save(path + '/' + number + c_word + '.png')
time.sleep(1)
os.remove(path + '/1.jpg')
if option == 'kodi':
DownloadFileWithFilename(cover_small, '1.jpg', path, Config, filepath, failed_folder)
try:
img = Image.open(path + '/1.jpg')
except Exception:
img = Image.open('1.jpg')
w = img.width
h = img.height
img.save(path + '/' + number + c_word + '-poster.jpg')
time.sleep(1)
os.remove(path + '/1.jpg')
if option == 'plex':
DownloadFileWithFilename(cover_small, '1.jpg', path, Config, filepath, failed_folder)
try:
img = Image.open(path + '/1.jpg')
except Exception:
img = Image.open('1.jpg')
w = img.width
h = img.height
img.save(path + '/poster.jpg')
os.remove(path + '/1.jpg')
def creatFolder(success_folder, location_rule, json_data, Config): # 创建文件夹 def creatFolder(success_folder, location_rule, json_data, Config): # 创建文件夹
title, studio, year, outline, runtime, director, actor_photo, release, number, cover, website= get_info(json_data) title, studio, year, outline, runtime, director, actor_photo, release, number, cover, website= get_info(json_data)
if len(location_rule) > 240: # 新建成功输出文件夹 if len(location_rule) > 240: # 新建成功输出文件夹
path = success_folder + '/' + location_rule.replace("'actor'", "'manypeople'", 3).replace("actor", path = success_folder + '/' + location_rule.replace("'actor'", "'manypeople'", 3).replace("actor","'manypeople'",3) # path为影片+元数据所在目录
"'manypeople'",
3) # path为影片+元数据所在目录
else: else:
path = success_folder + '/' + location_rule path = success_folder + '/' + location_rule
# print(path)
if not os.path.exists(path): if not os.path.exists(path):
path = escapePath(path, Config) path = escapePath(path, Config)
try: try:
@@ -271,214 +238,77 @@ def DownloadFileWithFilename(url, filename, path, Config, filepath, failed_folde
return return
def imageDownload(option, cover, number, c_word, path, multi_part, Config, filepath, failed_folder): # 封面是否下载成功否则移动到failed def imageDownload(cover, number, c_word, path, multi_part, Config, filepath, failed_folder): # 封面是否下载成功否则移动到failed
if option == 'emby': if DownloadFileWithFilename(cover, number + c_word + '-fanart.jpg', path, Config, filepath,failed_folder) == 'failed':
if DownloadFileWithFilename(cover, number + c_word + '.jpg', path, Config, filepath, failed_folder) == 'failed': moveFailedFolder(filepath, failed_folder)
moveFailedFolder(filepath, failed_folder) return
return i = 1
DownloadFileWithFilename(cover, number + c_word + '.jpg', path, Config, filepath, failed_folder) while i <= int(config['proxy']['retry']):
if not os.path.getsize(path + '/' + number + c_word + '.jpg') == 0: if os.path.getsize(path + '/' + number + c_word + '-fanart.jpg') == 0:
print('[+]Image Downloaded!', path + '/' + number + c_word + '.jpg') print('[!]Image Download Failed! Trying again. [' + config['proxy']['retry'] + '/3]')
return DownloadFileWithFilename(cover, number + c_word + '-fanart.jpg', path, Config, filepath, failed_folder)
i = 1 i = i + 1
while i <= int(config['proxy']['retry']): continue
if os.path.getsize(path + '/' + number + c_word + '.jpg') == 0:
print('[!]Image Download Failed! Trying again. [' + config['proxy']['retry'] + '/3]')
DownloadFileWithFilename(cover, number + c_word + '.jpg', path, Config, filepath, failed_folder)
i = i + 1
continue
else:
break
if multi_part == 1:
old_name = os.path.join(path, number + c_word + '.jpg')
new_name = os.path.join(path, number + c_word + '.jpg')
os.rename(old_name, new_name)
print('[+]Image Downloaded!', path + '/' + number + c_word + '.jpg')
else: else:
print('[+]Image Downloaded!', path + '/' + number + c_word + '.jpg') break
elif option == 'plex': if os.path.getsize(path + '/' + number + c_word + '-fanart.jpg') == 0:
if DownloadFileWithFilename(cover, 'fanart.jpg', path, Config, filepath, failed_folder) == 'failed': return
moveFailedFolder(filepath, failed_folder) print('[+]Image Downloaded!', path + '/' + number + c_word + '-fanart.jpg')
return shutil.copyfile(path + '/' + number + c_word + '-fanart.jpg',path + '/' + number + c_word + '-thumb.jpg')
DownloadFileWithFilename(cover, 'fanart.jpg', path, Config, filepath, failed_folder)
if not os.path.getsize(path + '/fanart.jpg') == 0:
print('[+]Image Downloaded!', path + '/fanart.jpg')
return
i = 1
while i <= int(config['proxy']['retry']):
if os.path.getsize(path + '/fanart.jpg') == 0:
print('[!]Image Download Failed! Trying again. [' + config['proxy']['retry'] + '/3]')
DownloadFileWithFilename(cover, 'fanart.jpg', path, Config, filepath, failed_folder)
i = i + 1
continue
else:
break
if not os.path.getsize(path + '/' + number + c_word + '.jpg') == 0:
print('[!]Image Download Failed! Trying again.')
DownloadFileWithFilename(cover, number + c_word + '.jpg', path, Config, filepath, failed_folder)
print('[+]Image Downloaded!', path + '/fanart.jpg')
elif option == 'kodi':
if DownloadFileWithFilename(cover, number + c_word + '-fanart.jpg', path, Config, filepath, failed_folder) == 'failed':
moveFailedFolder(filepath, failed_folder)
return
DownloadFileWithFilename(cover, number + c_word + '-fanart.jpg', path, Config, filepath, failed_folder)
if not os.path.getsize(path + '/' + number + c_word + '-fanart.jpg') == 0:
print('[+]Image Downloaded!', path + '/' + number + c_word + '-fanart.jpg')
return
i = 1
while i <= int(config['proxy']['retry']):
if os.path.getsize(path + '/' + number + c_word + '-fanart.jpg') == 0:
print('[!]Image Download Failed! Trying again. [' + config['proxy']['retry'] + '/3]')
DownloadFileWithFilename(cover, number + c_word + '-fanart.jpg', path, Config, filepath, failed_folder)
i = i + 1
continue
else:
break
print('[+]Image Downloaded!', path + '/' + number + c_word + '-fanart.jpg')
def PrintFiles(option, path, c_word, naming_rule, part, cn_sub, json_data, filepath, failed_folder, tag, actor_list): def PrintFiles(path, c_word, naming_rule, part, cn_sub, json_data, filepath, failed_folder, tag, actor_list, liuchu):
title, studio, year, outline, runtime, director, actor_photo, release, number, cover, website = get_info(json_data) title, studio, year, outline, runtime, director, actor_photo, release, number, cover, website = get_info(json_data)
try: try:
if not os.path.exists(path): if not os.path.exists(path):
os.makedirs(path) os.makedirs(path)
if option == 'plex': with open(path + "/" + number + c_word + ".nfo", "wt", encoding='UTF-8') as code:
with open(path + "/" + number + c_word + ".nfo", "wt", encoding='UTF-8') as code: print('<?xml version="1.0" encoding="UTF-8" ?>', file=code)
print('<?xml version="1.0" encoding="UTF-8" ?>', file=code) print("<movie>", file=code)
print("<movie>", file=code) print(" <title>" + naming_rule + part + "</title>", file=code)
print(" <title>" + naming_rule + part + "</title>", file=code) print(" <set>", file=code)
print(" <set>", file=code) print(" </set>", file=code)
print(" </set>", file=code) print(" <studio>" + studio + "+</studio>", file=code)
print(" <studio>" + studio + "+</studio>", file=code) print(" <year>" + year + "</year>", file=code)
print(" <year>" + year + "</year>", file=code) print(" <outline>" + outline + "</outline>", file=code)
print(" <outline>" + outline + "</outline>", file=code) print(" <plot>" + outline + "</plot>", file=code)
print(" <plot>" + outline + "</plot>", file=code) print(" <runtime>" + str(runtime).replace(" ", "") + "</runtime>", file=code)
print(" <runtime>" + str(runtime).replace(" ", "") + "</runtime>", file=code) print(" <director>" + director + "</director>", file=code)
print(" <director>" + director + "</director>", file=code) print(" <poster>" + number + c_word + "-poster.jpg</poster>", file=code)
print(" <poster>poster.jpg</poster>", file=code) print(" <thumb>" + number + c_word + "-thumb.jpg</thumb>", file=code)
print(" <thumb>thumb.png</thumb>", file=code) print(" <fanart>" + number + c_word + '-fanart.jpg' + "</fanart>", file=code)
print(" <fanart>fanart.jpg</fanart>", file=code) try:
try: for key in actor_list:
for key in actor_list: print(" <actor>", file=code)
print(" <actor>", file=code) print(" <name>" + key + "</name>", file=code)
print(" <name>" + key + "</name>", file=code) print(" </actor>", file=code)
print(" </actor>", file=code) except:
except: aaaa = ''
aaaa = '' print(" <maker>" + studio + "</maker>", file=code)
print(" <maker>" + studio + "</maker>", file=code) print(" <label>", file=code)
print(" <label>", file=code) print(" </label>", file=code)
print(" </label>", file=code) if cn_sub == '1':
if cn_sub == '1': print(" <tag>中文字幕</tag>", file=code)
print(" <tag>中文字幕</tag>", file=code) if liuchu == '流出':
try: print(" <tag>流出</tag>", file=code)
for i in str(json_data['tag']).strip("[ ]").replace("'", '').replace(" ", '').split(','): try:
print(" <tag>" + i + "</tag>", file=code) for i in tag:
except: print(" <tag>" + i + "</tag>", file=code)
aaaaa = '' except:
try: aaaaa = ''
for i in str(json_data['tag']).strip("[ ]").replace("'", '').replace(" ", '').split(','): try:
print(" <genre>" + i + "</genre>", file=code) for i in tag:
except: print(" <genre>" + i + "</genre>", file=code)
aaaaaaaa = '' except:
if cn_sub == '1': aaaaaaaa = ''
print(" <genre>中文字幕</genre>", file=code) if cn_sub == '1':
print(" <num>" + number + "</num>", file=code) print(" <genre>中文字幕</genre>", file=code)
print(" <release>" + release + "</release>", file=code) print(" <num>" + number + "</num>", file=code)
print(" <cover>" + cover + "</cover>", file=code) print(" <premiered>" + release + "</premiered>", file=code)
print(" <website>" + website + "</website>", file=code) print(" <cover>" + cover + "</cover>", file=code)
print("</movie>", file=code) print(" <website>" + website + "</website>", file=code)
print("[+]Writeed! " + path + "/" + number + ".nfo") print("</movie>", file=code)
elif option == 'emby': print("[+]Writeed! " + path + "/" + number + c_word + ".nfo")
with open(path + "/" + number + c_word + ".nfo", "wt", encoding='UTF-8') as code:
print('<?xml version="1.0" encoding="UTF-8" ?>', file=code)
print("<movie>", file=code)
print(" <title>" + naming_rule + part + "</title>", file=code)
print(" <set>", file=code)
print(" </set>", file=code)
print(" <studio>" + studio + "+</studio>", file=code)
print(" <year>" + year + "</year>", file=code)
print(" <outline>" + outline + "</outline>", file=code)
print(" <plot>" + outline + "</plot>", file=code)
print(" <runtime>" + str(runtime).replace(" ", "") + "</runtime>", file=code)
print(" <director>" + director + "</director>", file=code)
print(" <poster>" + number + c_word + ".png</poster>", file=code)
print(" <thumb>" + number + c_word + ".png</thumb>", file=code)
print(" <fanart>" + number + c_word + '.jpg' + "</fanart>", file=code)
try:
for key in actor_list:
print(" <actor>", file=code)
print(" <name>" + key + "</name>", file=code)
print(" </actor>", file=code)
except:
aaaa = ''
print(" <maker>" + studio + "</maker>", file=code)
print(" <label>", file=code)
print(" </label>", file=code)
if cn_sub == '1':
print(" <tag>中文字幕</tag>", file=code)
try:
for i in tag:
print(" <tag>" + i + "</tag>", file=code)
except:
aaaaa = ''
try:
for i in tag:
print(" <genre>" + i + "</genre>", file=code)
except:
aaaaaaaa = ''
if cn_sub == '1':
print(" <genre>中文字幕</genre>", file=code)
print(" <num>" + number + "</num>", file=code)
print(" <premiered>" + release + "</premiered>", file=code)
print(" <cover>" + cover + "</cover>", file=code)
print(" <website>" + website + "</website>", file=code)
print("</movie>", file=code)
print("[+]Writeed! " + path + "/" + number + c_word + ".nfo")
elif option == 'kodi':
with open(path + "/" + number + c_word + ".nfo", "wt", encoding='UTF-8') as code:
print('<?xml version="1.0" encoding="UTF-8" ?>', file=code)
print("<movie>", file=code)
print(" <title>" + naming_rule + part + "</title>", file=code)
print(" <set>", file=code)
print(" </set>", file=code)
print(" <studio>" + studio + "+</studio>", file=code)
print(" <year>" + year + "</year>", file=code)
print(" <outline>" + outline + "</outline>", file=code)
print(" <plot>" + outline + "</plot>", file=code)
print(" <runtime>" + str(runtime).replace(" ", "") + "</runtime>", file=code)
print(" <director>" + director + "</director>", file=code)
print(" <poster>" + number + c_word + "-poster.jpg</poster>", file=code)
print(" <fanart>" + number + c_word + '-fanart.jpg' + "</fanart>", file=code)
try:
for key in actor_list:
print(" <actor>", file=code)
print(" <name>" + key + "</name>", file=code)
print(" </actor>", file=code)
except:
aaaa = ''
print(" <maker>" + studio + "</maker>", file=code)
print(" <label>", file=code)
print(" </label>", file=code)
if cn_sub == '1':
print(" <tag>中文字幕</tag>", file=code)
try:
for i in tag:
print(" <tag>" + i + "</tag>", file=code)
except:
aaaaa = ''
try:
for i in tag:
print(" <genre>" + i + "</genre>", file=code)
except:
aaaaaaaa = ''
if cn_sub == '1':
print(" <genre>中文字幕</genre>", file=code)
print(" <num>" + number + "</num>", file=code)
print(" <release>" + release + "</release>", file=code)
print(" <cover>" + cover + "</cover>", file=code)
print(" <website>" + website + "</website>", file=code)
print("</movie>", file=code)
print("[+]Writeed! " + path + "/" + number + c_word + ".nfo")
except IOError as e: except IOError as e:
print("[-]Write Failed!") print("[-]Write Failed!")
print(e) print(e)
@@ -491,60 +321,21 @@ def PrintFiles(option, path, c_word, naming_rule, part, cn_sub, json_data, filep
return return
def cutImage(option, imagecut, path, number, c_word): def cutImage(imagecut, path, number, c_word):
if option == 'plex': if imagecut == 1:
if imagecut == 1: try:
try:
img = Image.open(path + '/fanart.jpg')
imgSize = img.size
w = img.width
h = img.height
img2 = img.crop((w / 1.9, 0, w, h))
img2.save(path + '/poster.jpg')
except:
print('[-]Cover cut failed!')
elif imagecut == 0:
img = Image.open(path + '/fanart.jpg')
w = img.width
h = img.height
img.save(path + '/poster.jpg')
elif option == 'emby':
if imagecut == 1:
try:
img = Image.open(path + '/' + number + c_word + '.jpg')
imgSize = img.size
w = img.width
h = img.height
img2 = img.crop((w / 1.9, 0, w, h))
img2.save(path + '/' + number + c_word + '.png')
except:
print('[-]Cover cut failed!')
elif imagecut == 0:
img = Image.open(path + '/' + number + c_word + '.jpg')
w = img.width
h = img.height
img.save(path + '/' + number + c_word + '.png')
elif option == 'kodi':
if imagecut == 1:
try:
img = Image.open(path + '/' + number + c_word + '-fanart.jpg')
imgSize = img.size
w = img.width
h = img.height
img2 = img.crop((w / 1.9, 0, w, h))
img2.save(path + '/' + number + c_word + '-poster.jpg')
except:
print('[-]Cover cut failed!')
elif imagecut == 0:
img = Image.open(path + '/' + number + c_word + '-fanart.jpg') img = Image.open(path + '/' + number + c_word + '-fanart.jpg')
imgSize = img.size
w = img.width w = img.width
h = img.height h = img.height
try: img2 = img.crop((w / 1.9, 0, w, h))
img = img.convert('RGB') img2.save(path + '/' + number + c_word + '-poster.jpg')
img.save(path + '/' + number + c_word + '-poster.jpg') print('[+]Image Cutted! ' + path + '/' + number + c_word + '-poster.jpg')
except: except:
img = img.convert('RGB') print('[-]Cover cut failed!')
img.save(path + '/' + number + c_word + '-poster.jpg') elif imagecut == 0:
shutil.copyfile(path + '/' + number + c_word + '-fanart.jpg',path + '/' + number + c_word + '-poster.jpg')
print('[+]Image Copyed! ' + path + '/' + number + c_word + '-poster.jpg')
def pasteFileToFolder(filepath, path, number, c_word): # 文件路径,番号,后缀,要移动至的位置 def pasteFileToFolder(filepath, path, number, c_word): # 文件路径,番号,后缀,要移动至的位置
@@ -597,18 +388,7 @@ def pasteFileToFolder_mode2(filepath, path, multi_part, number, part, c_word):
return return
except PermissionError: except PermissionError:
print('[-]Error! Please run as administrator!') print('[-]Error! Please run as administrator!')
return return
def copyRenameJpgToBackdrop(option, path, number, c_word):
if option == 'plex':
shutil.copy(path + '/fanart.jpg', path + '/Backdrop.jpg')
shutil.copy(path + '/poster.jpg', path + '/thumb.png')
if option == 'emby':
shutil.copy(path + '/' + number + c_word + '.jpg', path + '/Backdrop.jpg')
if option == 'kodi':
shutil.copy(path + '/' + number + c_word + '-fanart.jpg', path + '/Backdrop.jpg')
def get_part(filepath, failed_folder): def get_part(filepath, failed_folder):
try: try:
@@ -643,15 +423,11 @@ def core_main(file_path, number_th):
multi_part = 0 multi_part = 0
part = '' part = ''
c_word = '' c_word = ''
option = ''
cn_sub = '' cn_sub = ''
liuchu = ''
config_file = 'config.ini' config_file = 'config.ini'
Config = ConfigParser() Config = ConfigParser()
Config.read(config_file, encoding='UTF-8') Config.read(config_file, encoding='UTF-8')
try:
option = ReadMediaWarehouse()
except:
print('[-]Config media_warehouse read failed!')
program_mode = Config['common']['main_mode'] # 运行模式 program_mode = Config['common']['main_mode'] # 运行模式
failed_folder = Config['common']['failed_output_folder'] # 失败输出目录 failed_folder = Config['common']['failed_output_folder'] # 失败输出目录
success_folder = Config['common']['success_output_folder'] # 成功输出目录 success_folder = Config['common']['success_output_folder'] # 成功输出目录
@@ -674,6 +450,8 @@ def core_main(file_path, number_th):
if '-c.' in filepath or '-C.' in filepath or '中文' in filepath or '字幕' in filepath: if '-c.' in filepath or '-C.' in filepath or '中文' in filepath or '字幕' in filepath:
cn_sub = '1' cn_sub = '1'
c_word = '-C' # 中文字幕影片后缀 c_word = '-C' # 中文字幕影片后缀
if '流出' in filepath:
liuchu = '流出'
CreatFailedFolder(failed_folder) # 创建输出失败目录 CreatFailedFolder(failed_folder) # 创建输出失败目录
debug_mode(json_data) # 调试模式检测 debug_mode(json_data) # 调试模式检测
@@ -682,11 +460,10 @@ def core_main(file_path, number_th):
if program_mode == '1': if program_mode == '1':
if multi_part == 1: if multi_part == 1:
number += part # 这时number会被附加上CD1后缀 number += part # 这时number会被附加上CD1后缀
smallCoverCheck(path, number, imagecut, json_data['cover_small'], c_word, option, Config, filepath, failed_folder) # 检查小封面 smallCoverCheck(path, number, imagecut, json_data['cover_small'], c_word, Config, filepath, failed_folder) # 检查小封面
imageDownload(option, json_data['cover'], number, c_word, path, multi_part, Config, filepath, failed_folder) # creatFoder会返回番号路径 imageDownload(json_data['cover'], number, c_word, path, multi_part, Config, filepath, failed_folder) # creatFoder会返回番号路径
cutImage(option, imagecut, path, number, c_word) # 裁剪图 cutImage(imagecut, path, number, c_word) # 裁剪图
copyRenameJpgToBackdrop(option, path, number, c_word) PrintFiles(path, c_word, json_data['naming_rule'], part, cn_sub, json_data, filepath, failed_folder, tag, json_data['actor_list'],liuchu) # 打印文件
PrintFiles(option, path, c_word, json_data['naming_rule'], part, cn_sub, json_data, filepath, failed_folder, tag, json_data['actor_list']) # 打印文件
pasteFileToFolder(filepath, path, number, c_word) # 移动文件 pasteFileToFolder(filepath, path, number, c_word) # 移动文件
# =======================================================================整理模式 # =======================================================================整理模式
elif program_mode == '2': elif program_mode == '2':

0
failed/ipx-177.mp4 Normal file
View File

0
failed/ipx-229.mp4 Normal file
View File

0
failed/ipx-292.mp4 Normal file
View File

View File

@@ -177,6 +177,8 @@ def main(number):
"https://www.dmm.co.jp/mono/dvd/-/detail/=/cid=", "https://www.dmm.co.jp/mono/dvd/-/detail/=/cid=",
"https://www.dmm.co.jp/digital/anime/-/detail/=/cid=", "https://www.dmm.co.jp/digital/anime/-/detail/=/cid=",
"https://www.dmm.co.jp/mono/anime/-/detail/=/cid=", "https://www.dmm.co.jp/mono/anime/-/detail/=/cid=",
"https://www.dmm.co.jp/digital/videoc/-/detail/=/cid=",
"https://www.dmm.co.jp/digital/nikkatsu/-/detail/=/cid=",
] ]
chosen_url = "" chosen_url = ""
for url in fanza_urls: for url in fanza_urls:

2
pull_movie_from_output Executable file
View File

@@ -0,0 +1,2 @@
import os
os.system('mv JAV_output/*/*/*.mp4 ./')

4
py_to_exe.bat Normal file
View File

@@ -0,0 +1,4 @@
pyinstaller --onefile AV_Data_Capture.py --hidden-import ADC_function.py --hidden-import core.py
rmdir /s/q build
rmdir /s/q __pycache__
pause

0
ssni-229.mmp4 Normal file
View File

View File

@@ -1,8 +1,5 @@
{ {
"version": "2.9", "version": "3.0",
"version_show":"2.9", "version_show": "3.0",
"download": "https://github.com/yoshiko2/AV_Data_Capture/releases", "download": "https://github.com/yoshiko2/AV_Data_Capture/releases",
"notice_title": "test",
"notice": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\naaaaaaa"
} }