diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..e7e9d11 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,2 @@ +# Default ignored files +/workspace.xml diff --git a/.idea/av_data_capture.iml b/.idea/av_data_capture.iml new file mode 100644 index 0000000..f52f522 --- /dev/null +++ b/.idea/av_data_capture.iml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/dictionaries/yohane.xml b/.idea/dictionaries/yohane.xml new file mode 100644 index 0000000..bd3c5e6 --- /dev/null +++ b/.idea/dictionaries/yohane.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..e3139fb --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..bbbbf2f --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/AV_Data_Capture.py b/AV_Data_Capture.py index c32f35b..caba00b 100755 --- a/AV_Data_Capture.py +++ b/AV_Data_Capture.py @@ -13,14 +13,14 @@ from configparser import ConfigParser import argparse -def UpdateCheck(version): +def UpdateCheck_Notice(htmlcode,version): if UpdateCheckSwitch() == '1': - html2 = get_html('https://raw.githubusercontent.com/yoshiko2/AV_Data_Capture/master/update_check.json') - html = json.loads(str(html2)) + html = json.loads(str(htmlcode)) if not version == html['version']: - print('[*] * New update ' + html['version'] + ' *') - print('[*] ↓ Download ↓') + line1 = '* New update ' + html['version'] + ' *' + print('[*]' + line1.center(54)) + print('[*]' + '↓ Download ↓'.center(54)) print('[*] ' + html['download']) print('[*]======================================================') else: @@ -91,7 +91,7 @@ def getNumber(filepath,absolute_path = False): if __name__ == '__main__': - version = '2.9' + version = '3.0' config_file = 'config.ini' config = ConfigParser() config.read(config_file, encoding='UTF-8') @@ -99,11 +99,13 @@ if __name__ == '__main__': failed_folder = config['common']['failed_output_folder'] # 失败输出目录 escape_folder = config['escape']['folders'] # 多级目录刮削需要排除的目录 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('[*] Version ' + version) + print('[*]' + version_print.center(54)) print('[*]======================================================') - UpdateCheck(version) + UpdateCheck_Notice(htmlcode,version) CreatFailedFolder(failed_folder) os.chdir(os.getcwd()) movie_list = movie_lists('.', escape_folder) @@ -147,10 +149,8 @@ if __name__ == '__main__': try: print('[-]Move ' + i + ' to failed folder') shutil.move(i, str(os.getcwd()) + '/' + failed_folder + '/') - except FileExistsError: - print('[!]File exists in failed!') - except: - print('[+]skip') + except Exception as e2: + print('[!]', e2) continue CEF(success_folder) diff --git a/JAV_output/三上悠亜/SSNI-229/SSNI-229-fanart.jpg b/JAV_output/三上悠亜/SSNI-229/SSNI-229-fanart.jpg new file mode 100644 index 0000000..4ba63e3 Binary files /dev/null and b/JAV_output/三上悠亜/SSNI-229/SSNI-229-fanart.jpg differ diff --git a/JAV_output/三上悠亜/SSNI-229/SSNI-229-poster.jpg b/JAV_output/三上悠亜/SSNI-229/SSNI-229-poster.jpg new file mode 100644 index 0000000..75affdf Binary files /dev/null and b/JAV_output/三上悠亜/SSNI-229/SSNI-229-poster.jpg differ diff --git a/JAV_output/三上悠亜/SSNI-229/SSNI-229-thumb.jpg b/JAV_output/三上悠亜/SSNI-229/SSNI-229-thumb.jpg new file mode 100644 index 0000000..4ba63e3 Binary files /dev/null and b/JAV_output/三上悠亜/SSNI-229/SSNI-229-thumb.jpg differ diff --git a/JAV_output/三上悠亜/SSNI-229/SSNI-229.nfo b/JAV_output/三上悠亜/SSNI-229/SSNI-229.nfo new file mode 100644 index 0000000..07acdeb --- /dev/null +++ b/JAV_output/三上悠亜/SSNI-229/SSNI-229.nfo @@ -0,0 +1,45 @@ + + + SSNI-229-無抵抗言いなり痴漢電車-絶頂を教え込まれた巨乳女子大生-三上悠亜 + + + エスワンナンバーワンスタイル+ + 2018 + 国民的アイドル三上悠亜の初‘痴●’作品。『いやぁ!ナンの薬?そんな所に塗らないで…熱い‥お願いヤメテぇぇぇ!!!』恐怖と狂気に満ちた満員痴●車両。可憐で清楚な‘巨乳女子大生’を汚す非道な痴●魔の罠。暴力的な魔の手で巨乳を貪られ、望まぬ絶頂潮で車内を濡らす!乳首とクリを変態愛撫で執拗に辱められ濡れまくる高嶺の花。途中下車無効…通学途中に擦り込まれた逃れられない快楽! + +★アダルトブック「三上悠亜写真集」の商品ご購入はこちらから★ + 国民的アイドル三上悠亜の初‘痴●’作品。『いやぁ!ナンの薬?そんな所に塗らないで…熱い‥お願いヤメテぇぇぇ!!!』恐怖と狂気に満ちた満員痴●車両。可憐で清楚な‘巨乳女子大生’を汚す非道な痴●魔の罠。暴力的な魔の手で巨乳を貪られ、望まぬ絶頂潮で車内を濡らす!乳首とクリを変態愛撫で執拗に辱められ濡れまくる高嶺の花。途中下車無効…通学途中に擦り込まれた逃れられない快楽! + +★アダルトブック「三上悠亜写真集」の商品ご購入はこちらから★ + 160分鐘 + [Jo]Style + SSNI-229-poster.jpg + SSNI-229-thumb.jpg + SSNI-229-fanart.jpg + + 三上悠亜 + + エスワンナンバーワンスタイル + + 巨乳 + 單體作品 + DMM獨家 + 偶像藝人 + 女大學生 + 性騷擾 + 薄馬賽克 + 高畫質 + 巨乳 + 單體作品 + DMM獨家 + 偶像藝人 + 女大學生 + 性騷擾 + 薄馬賽克 + 高畫質 + SSNI-229 + 2018-06-14 + https://pics.javbus.com/cover/6lig_b.jpg + https://www.javbus.com/SSNI-229 + diff --git a/JAV_output/桜空もも/IPX-292/Backdrop.jpg b/JAV_output/桜空もも/IPX-292/Backdrop.jpg new file mode 100644 index 0000000..a458470 Binary files /dev/null and b/JAV_output/桜空もも/IPX-292/Backdrop.jpg differ diff --git a/JAV_output/桜空もも/IPX-292/IPX-292-fanart.jpg b/JAV_output/桜空もも/IPX-292/IPX-292-fanart.jpg new file mode 100644 index 0000000..a458470 Binary files /dev/null and b/JAV_output/桜空もも/IPX-292/IPX-292-fanart.jpg differ diff --git a/JAV_output/桜空もも/IPX-292/IPX-292-poster.jpg b/JAV_output/桜空もも/IPX-292/IPX-292-poster.jpg new file mode 100644 index 0000000..39dd781 Binary files /dev/null and b/JAV_output/桜空もも/IPX-292/IPX-292-poster.jpg differ diff --git a/JAV_output/桜空もも/IPX-292/IPX-292-thumb.jpg b/JAV_output/桜空もも/IPX-292/IPX-292-thumb.jpg new file mode 100644 index 0000000..a458470 Binary files /dev/null and b/JAV_output/桜空もも/IPX-292/IPX-292-thumb.jpg differ diff --git a/JAV_output/桜空もも/IPX-292/IPX-292.jpg b/JAV_output/桜空もも/IPX-292/IPX-292.jpg new file mode 100644 index 0000000..a458470 Binary files /dev/null and b/JAV_output/桜空もも/IPX-292/IPX-292.jpg differ diff --git a/JAV_output/桜空もも/IPX-292/IPX-292.nfo b/JAV_output/桜空もも/IPX-292/IPX-292.nfo new file mode 100644 index 0000000..b92ae38 --- /dev/null +++ b/JAV_output/桜空もも/IPX-292/IPX-292.nfo @@ -0,0 +1,47 @@ + + + IPX-292-巨乳若妻は元彼ダメ男に嫌なほどイカされて…-桜空もも + + + アイデアポケット+ + 2019 + 桜空もも初NTR作品!僕とももが結婚したのは2年前。僕の一目惚れだった。プロポーズを受けてくれた時には泣きそうになった。こんな素敵な人が、本当に僕のものになってくれるなんて…。そんな僕の妻は今、恐らく元カレに抱かれている。しかも僕とのHでは今までないほど何度も絶頂して、首を絞められたり、尻を叩かれたりして喜んでいる。見たことのない妻の淫らな姿に僕は知らず知らず勃起していた…。 + +★アダルトブック「桜空もも写真集」の商品ご購入はこちらから★ + 桜空もも初NTR作品!僕とももが結婚したのは2年前。僕の一目惚れだった。プロポーズを受けてくれた時には泣きそうになった。こんな素敵な人が、本当に僕のものになってくれるなんて…。そんな僕の妻は今、恐らく元カレに抱かれている。しかも僕とのHでは今までないほど何度も絶頂して、首を絞められたり、尻を叩かれたりして喜んでいる。見たことのない妻の淫らな姿に僕は知らず知らず勃起していた…。 + +★アダルトブック「桜空もも写真集」の商品ご購入はこちらから★ + 120分鐘 + 朝霧浄 + IPX-292-poster.jpg + IPX-292-thumb.jpg + IPX-292-fanart.jpg + + 桜空もも + + アイデアポケット + + 巨乳 + 單體作品 + DMM獨家 + 苗條 + 乳交 + 新娘、年輕妻子 + 數位馬賽克 + 高畫質 + 出軌 + 巨乳 + 單體作品 + DMM獨家 + 苗條 + 乳交 + 新娘、年輕妻子 + 數位馬賽克 + 高畫質 + 出軌 + IPX-292 + 2019-04-07 + https://pics.javbus.com/cover/71iz_b.jpg + https://www.javbus.com/IPX-292 + diff --git a/JAV_output/桜空もも/IPX-292/IPX-292.png b/JAV_output/桜空もも/IPX-292/IPX-292.png new file mode 100644 index 0000000..c628101 Binary files /dev/null and b/JAV_output/桜空もも/IPX-292/IPX-292.png differ diff --git a/JAV_output/西宮ゆめ/IPX-144/Backdrop.jpg b/JAV_output/西宮ゆめ/IPX-144/Backdrop.jpg new file mode 100644 index 0000000..067bd9d Binary files /dev/null and b/JAV_output/西宮ゆめ/IPX-144/Backdrop.jpg differ diff --git a/JAV_output/西宮ゆめ/IPX-144/IPX-144-fanart.jpg b/JAV_output/西宮ゆめ/IPX-144/IPX-144-fanart.jpg new file mode 100644 index 0000000..067bd9d Binary files /dev/null and b/JAV_output/西宮ゆめ/IPX-144/IPX-144-fanart.jpg differ diff --git a/JAV_output/西宮ゆめ/IPX-144/IPX-144-poster.jpg b/JAV_output/西宮ゆめ/IPX-144/IPX-144-poster.jpg new file mode 100644 index 0000000..6bdd720 Binary files /dev/null and b/JAV_output/西宮ゆめ/IPX-144/IPX-144-poster.jpg differ diff --git a/JAV_output/西宮ゆめ/IPX-144/IPX-144-thumb.jpg b/JAV_output/西宮ゆめ/IPX-144/IPX-144-thumb.jpg new file mode 100644 index 0000000..067bd9d Binary files /dev/null and b/JAV_output/西宮ゆめ/IPX-144/IPX-144-thumb.jpg differ diff --git a/JAV_output/西宮ゆめ/IPX-144/IPX-144.jpg b/JAV_output/西宮ゆめ/IPX-144/IPX-144.jpg new file mode 100644 index 0000000..067bd9d Binary files /dev/null and b/JAV_output/西宮ゆめ/IPX-144/IPX-144.jpg differ diff --git a/JAV_output/西宮ゆめ/IPX-144/IPX-144.nfo b/JAV_output/西宮ゆめ/IPX-144/IPX-144.nfo new file mode 100644 index 0000000..fae2e3c --- /dev/null +++ b/JAV_output/西宮ゆめ/IPX-144/IPX-144.nfo @@ -0,0 +1,39 @@ + + + IPX-144-アイドル美少女と交わすヨダレだらだらツバだくだく濃厚な接吻とセックス-西宮ゆめ + + + アイデアポケット+ + 2018 + アイドル美少女と思う存分じっくりねっとりイヤラシイ接吻を…。ゆめとおじさんのべちょべちょレロレロいやらし接吻ハーモニー。顔面に唇に乳首にチンポにだら~り絡みつく粘度の高い唾液。中年の乾いたペニスにネバネバ唾液をたっぷり絡ませ金玉から亀頭までベロベロ舐め回す。唾液と本気汁でグチョグチョになったオマンコを激ピストン。美少女とおじさんのねっとり糸引く濃密な接吻唾液交換セックス! + アイドル美少女と思う存分じっくりねっとりイヤラシイ接吻を…。ゆめとおじさんのべちょべちょレロレロいやらし接吻ハーモニー。顔面に唇に乳首にチンポにだら~り絡みつく粘度の高い唾液。中年の乾いたペニスにネバネバ唾液をたっぷり絡ませ金玉から亀頭までベロベロ舐め回す。唾液と本気汁でグチョグチョになったオマンコを激ピストン。美少女とおじさんのねっとり糸引く濃密な接吻唾液交換セックス! + 160分鐘 + うさぴょん。 + IPX-144-poster.jpg + IPX-144-thumb.jpg + IPX-144-fanart.jpg + + 西宮ゆめ + + アイデアポケット + + 單體作品 + DMM獨家 + 蕩婦 + 美少女 + 數位馬賽克 + 高畫質 + キス・接吻 + 單體作品 + DMM獨家 + 蕩婦 + 美少女 + 數位馬賽克 + 高畫質 + キス・接吻 + IPX-144 + 2018-05-17 + https://pics.javbus.com/cover/6k2d_b.jpg + https://www.javbus.com/IPX-144 + diff --git a/JAV_output/西宮ゆめ/IPX-144/IPX-144.png b/JAV_output/西宮ゆめ/IPX-144/IPX-144.png new file mode 100644 index 0000000..ebb9cb5 Binary files /dev/null and b/JAV_output/西宮ゆめ/IPX-144/IPX-144.png differ diff --git a/JAV_output/麻生希/STAR-438/STAR-438-fanart.jpg b/JAV_output/麻生希/STAR-438/STAR-438-fanart.jpg new file mode 100644 index 0000000..530f079 Binary files /dev/null and b/JAV_output/麻生希/STAR-438/STAR-438-fanart.jpg differ diff --git a/JAV_output/麻生希/STAR-438/STAR-438-poster.jpg b/JAV_output/麻生希/STAR-438/STAR-438-poster.jpg new file mode 100644 index 0000000..5dafbd6 Binary files /dev/null and b/JAV_output/麻生希/STAR-438/STAR-438-poster.jpg differ diff --git a/JAV_output/麻生希/STAR-438/STAR-438-thumb.jpg b/JAV_output/麻生希/STAR-438/STAR-438-thumb.jpg new file mode 100644 index 0000000..530f079 Binary files /dev/null and b/JAV_output/麻生希/STAR-438/STAR-438-thumb.jpg differ diff --git a/JAV_output/麻生希/STAR-438/STAR-438.nfo b/JAV_output/麻生希/STAR-438/STAR-438.nfo new file mode 100644 index 0000000..c1b6f1d --- /dev/null +++ b/JAV_output/麻生希/STAR-438/STAR-438.nfo @@ -0,0 +1,37 @@ + + + STAR-438-癒されたい男達が最後に辿り着く究極の超高級性感エステサロン-麻生希 + + + SODクリエイト+ + 2013 + + + 204分鐘 + 柏倉弘 + STAR-438-poster.jpg + STAR-438-thumb.jpg + STAR-438-fanart.jpg + + 麻生希 + + SODクリエイト + + 高畫質 + 按摩 + 美容院 + 乳液 + 和服・喪服 + 單體作品 + 高畫質 + 按摩 + 美容院 + 乳液 + 和服・喪服 + 單體作品 + STAR-438 + 2013-06-23 + https://pics.javbus.com/cover/2h2e_b.jpg + https://www.javbus.com/STAR-438 + diff --git a/actor.py b/actor.py new file mode 100644 index 0000000..382ff51 --- /dev/null +++ b/actor.py @@ -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 lost!Please 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('Mode:Overwrite existed images') + else: + print('Mode:Skip 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') + + diff --git a/clone.sh b/clone.sh new file mode 100755 index 0000000..76481ab --- /dev/null +++ b/clone.sh @@ -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='' diff --git a/config.ini b/config.ini index 87dca55..9e943de 100644 --- a/config.ini +++ b/config.ini @@ -16,13 +16,9 @@ naming_rule=number+'-'+title [update] update_check=1 -[media] -media_warehouse=emby -#emby or plex or kodi ,emby=jellyfin - [escape] literals=\()/ folders=failed,JAV_output [debug_mode] -switch=0 \ No newline at end of file +switch=0 diff --git a/core.py b/core.py index c9db8b5..4a989bc 100755 --- a/core.py +++ b/core.py @@ -165,51 +165,18 @@ def get_info(json_data): # 返回json里的数据 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 option == 'emby': - 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 + '.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') + DownloadFileWithFilename(cover_small, path + '/' + number + c_word + '-poster.jpg', path, Config, filepath, failed_folder) + print('[+]Image Downloaded! '+ path + '/' + number + c_word + '-poster.jpg') 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) if len(location_rule) > 240: # 新建成功输出文件夹 - path = success_folder + '/' + location_rule.replace("'actor'", "'manypeople'", 3).replace("actor", - "'manypeople'", - 3) # path为影片+元数据所在目录 + path = success_folder + '/' + location_rule.replace("'actor'", "'manypeople'", 3).replace("actor","'manypeople'",3) # path为影片+元数据所在目录 else: path = success_folder + '/' + location_rule - # print(path) if not os.path.exists(path): path = escapePath(path, Config) try: @@ -271,214 +238,77 @@ def DownloadFileWithFilename(url, filename, path, Config, filepath, failed_folde return -def imageDownload(option, cover, number, c_word, path, multi_part, Config, filepath, failed_folder): # 封面是否下载成功,否则移动到failed - if option == 'emby': - if DownloadFileWithFilename(cover, number + c_word + '.jpg', path, Config, filepath, failed_folder) == 'failed': - moveFailedFolder(filepath, failed_folder) - return - DownloadFileWithFilename(cover, number + c_word + '.jpg', path, Config, filepath, failed_folder) - if not os.path.getsize(path + '/' + number + c_word + '.jpg') == 0: - print('[+]Image Downloaded!', path + '/' + number + c_word + '.jpg') - return - i = 1 - while i <= int(config['proxy']['retry']): - 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') +def imageDownload(cover, number, c_word, path, multi_part, Config, filepath, failed_folder): # 封面是否下载成功,否则移动到failed + if DownloadFileWithFilename(cover, number + c_word + '-fanart.jpg', path, Config, filepath,failed_folder) == 'failed': + moveFailedFolder(filepath, failed_folder) + 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: - print('[+]Image Downloaded!', path + '/' + number + c_word + '.jpg') - elif option == 'plex': - if DownloadFileWithFilename(cover, 'fanart.jpg', path, Config, filepath, failed_folder) == 'failed': - moveFailedFolder(filepath, failed_folder) - return - 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') + break + if os.path.getsize(path + '/' + number + c_word + '-fanart.jpg') == 0: + return + print('[+]Image Downloaded!', path + '/' + number + c_word + '-fanart.jpg') + shutil.copyfile(path + '/' + number + c_word + '-fanart.jpg',path + '/' + number + c_word + '-thumb.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) try: if not os.path.exists(path): os.makedirs(path) - if option == 'plex': - with open(path + "/" + number + c_word + ".nfo", "wt", encoding='UTF-8') as code: - print('', file=code) - print("", file=code) - print(" " + naming_rule + part + "", file=code) - print(" ", file=code) - print(" ", file=code) - print(" " + studio + "+", file=code) - print(" " + year + "", file=code) - print(" " + outline + "", file=code) - print(" " + outline + "", file=code) - print(" " + str(runtime).replace(" ", "") + "", file=code) - print(" " + director + "", file=code) - print(" poster.jpg", file=code) - print(" thumb.png", file=code) - print(" fanart.jpg", file=code) - try: - for key in actor_list: - print(" ", file=code) - print(" " + key + "", file=code) - print(" ", file=code) - except: - aaaa = '' - print(" " + studio + "", file=code) - print(" ", file=code) - if cn_sub == '1': - print(" 中文字幕", file=code) - try: - for i in str(json_data['tag']).strip("[ ]").replace("'", '').replace(" ", '').split(','): - print(" " + i + "", file=code) - except: - aaaaa = '' - try: - for i in str(json_data['tag']).strip("[ ]").replace("'", '').replace(" ", '').split(','): - print(" " + i + "", file=code) - except: - aaaaaaaa = '' - if cn_sub == '1': - print(" 中文字幕", file=code) - print(" " + number + "", file=code) - print(" " + release + "", file=code) - print(" " + cover + "", file=code) - print(" " + website + "", file=code) - print("", file=code) - print("[+]Writeed! " + path + "/" + number + ".nfo") - elif option == 'emby': - with open(path + "/" + number + c_word + ".nfo", "wt", encoding='UTF-8') as code: - print('', file=code) - print("", file=code) - print(" " + naming_rule + part + "", file=code) - print(" ", file=code) - print(" ", file=code) - print(" " + studio + "+", file=code) - print(" " + year + "", file=code) - print(" " + outline + "", file=code) - print(" " + outline + "", file=code) - print(" " + str(runtime).replace(" ", "") + "", file=code) - print(" " + director + "", file=code) - print(" " + number + c_word + ".png", file=code) - print(" " + number + c_word + ".png", file=code) - print(" " + number + c_word + '.jpg' + "", file=code) - try: - for key in actor_list: - print(" ", file=code) - print(" " + key + "", file=code) - print(" ", file=code) - except: - aaaa = '' - print(" " + studio + "", file=code) - print(" ", file=code) - if cn_sub == '1': - print(" 中文字幕", file=code) - try: - for i in tag: - print(" " + i + "", file=code) - except: - aaaaa = '' - try: - for i in tag: - print(" " + i + "", file=code) - except: - aaaaaaaa = '' - if cn_sub == '1': - print(" 中文字幕", file=code) - print(" " + number + "", file=code) - print(" " + release + "", file=code) - print(" " + cover + "", file=code) - print(" " + website + "", file=code) - print("", 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('', file=code) - print("", file=code) - print(" " + naming_rule + part + "", file=code) - print(" ", file=code) - print(" ", file=code) - print(" " + studio + "+", file=code) - print(" " + year + "", file=code) - print(" " + outline + "", file=code) - print(" " + outline + "", file=code) - print(" " + str(runtime).replace(" ", "") + "", file=code) - print(" " + director + "", file=code) - print(" " + number + c_word + "-poster.jpg", file=code) - print(" " + number + c_word + '-fanart.jpg' + "", file=code) - try: - for key in actor_list: - print(" ", file=code) - print(" " + key + "", file=code) - print(" ", file=code) - except: - aaaa = '' - print(" " + studio + "", file=code) - print(" ", file=code) - if cn_sub == '1': - print(" 中文字幕", file=code) - try: - for i in tag: - print(" " + i + "", file=code) - except: - aaaaa = '' - try: - for i in tag: - print(" " + i + "", file=code) - except: - aaaaaaaa = '' - if cn_sub == '1': - print(" 中文字幕", file=code) - print(" " + number + "", file=code) - print(" " + release + "", file=code) - print(" " + cover + "", file=code) - print(" " + website + "", file=code) - print("", file=code) - print("[+]Writeed! " + path + "/" + number + c_word + ".nfo") + with open(path + "/" + number + c_word + ".nfo", "wt", encoding='UTF-8') as code: + print('', file=code) + print("", file=code) + print(" " + naming_rule + part + "", file=code) + print(" ", file=code) + print(" ", file=code) + print(" " + studio + "+", file=code) + print(" " + year + "", file=code) + print(" " + outline + "", file=code) + print(" " + outline + "", file=code) + print(" " + str(runtime).replace(" ", "") + "", file=code) + print(" " + director + "", file=code) + print(" " + number + c_word + "-poster.jpg", file=code) + print(" " + number + c_word + "-thumb.jpg", file=code) + print(" " + number + c_word + '-fanart.jpg' + "", file=code) + try: + for key in actor_list: + print(" ", file=code) + print(" " + key + "", file=code) + print(" ", file=code) + except: + aaaa = '' + print(" " + studio + "", file=code) + print(" ", file=code) + if cn_sub == '1': + print(" 中文字幕", file=code) + if liuchu == '流出': + print(" 流出", file=code) + try: + for i in tag: + print(" " + i + "", file=code) + except: + aaaaa = '' + try: + for i in tag: + print(" " + i + "", file=code) + except: + aaaaaaaa = '' + if cn_sub == '1': + print(" 中文字幕", file=code) + print(" " + number + "", file=code) + print(" " + release + "", file=code) + print(" " + cover + "", file=code) + print(" " + website + "", file=code) + print("", file=code) + print("[+]Writeed! " + path + "/" + number + c_word + ".nfo") except IOError as e: print("[-]Write Failed!") print(e) @@ -491,60 +321,21 @@ def PrintFiles(option, path, c_word, naming_rule, part, cn_sub, json_data, filep return -def cutImage(option, imagecut, path, number, c_word): - if option == 'plex': - if imagecut == 1: - 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: +def cutImage(imagecut, path, number, c_word): + if imagecut == 1: + try: img = Image.open(path + '/' + number + c_word + '-fanart.jpg') + imgSize = img.size w = img.width h = img.height - try: - img = img.convert('RGB') - img.save(path + '/' + number + c_word + '-poster.jpg') - except: - img = img.convert('RGB') - img.save(path + '/' + number + c_word + '-poster.jpg') + img2 = img.crop((w / 1.9, 0, w, h)) + img2.save(path + '/' + number + c_word + '-poster.jpg') + print('[+]Image Cutted! ' + path + '/' + number + c_word + '-poster.jpg') + except: + print('[-]Cover cut failed!') + 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): # 文件路径,番号,后缀,要移动至的位置 @@ -597,18 +388,7 @@ def pasteFileToFolder_mode2(filepath, path, multi_part, number, part, c_word): return except PermissionError: print('[-]Error! Please run as administrator!') - 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') - + return def get_part(filepath, failed_folder): try: @@ -643,15 +423,11 @@ def core_main(file_path, number_th): multi_part = 0 part = '' c_word = '' - option = '' cn_sub = '' + liuchu = '' config_file = 'config.ini' Config = ConfigParser() Config.read(config_file, encoding='UTF-8') - try: - option = ReadMediaWarehouse() - except: - print('[-]Config media_warehouse read failed!') program_mode = Config['common']['main_mode'] # 运行模式 failed_folder = Config['common']['failed_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: cn_sub = '1' c_word = '-C' # 中文字幕影片后缀 + if '流出' in filepath: + liuchu = '流出' CreatFailedFolder(failed_folder) # 创建输出失败目录 debug_mode(json_data) # 调试模式检测 @@ -682,11 +460,10 @@ def core_main(file_path, number_th): if program_mode == '1': if multi_part == 1: number += part # 这时number会被附加上CD1后缀 - smallCoverCheck(path, number, imagecut, json_data['cover_small'], c_word, option, Config, filepath, failed_folder) # 检查小封面 - imageDownload(option, json_data['cover'], number, c_word, path, multi_part, Config, filepath, failed_folder) # creatFoder会返回番号路径 - cutImage(option, imagecut, path, number, c_word) # 裁剪图 - copyRenameJpgToBackdrop(option, path, number, c_word) - PrintFiles(option, path, c_word, json_data['naming_rule'], part, cn_sub, json_data, filepath, failed_folder, tag, json_data['actor_list']) # 打印文件 + smallCoverCheck(path, number, imagecut, json_data['cover_small'], c_word, Config, filepath, failed_folder) # 检查小封面 + imageDownload(json_data['cover'], number, c_word, path, multi_part, Config, filepath, failed_folder) # creatFoder会返回番号路径 + cutImage(imagecut, 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) # 打印文件 pasteFileToFolder(filepath, path, number, c_word) # 移动文件 # =======================================================================整理模式 elif program_mode == '2': diff --git a/failed/ipx-177.mp4 b/failed/ipx-177.mp4 new file mode 100644 index 0000000..e69de29 diff --git a/failed/ipx-229.mp4 b/failed/ipx-229.mp4 new file mode 100644 index 0000000..e69de29 diff --git a/failed/ipx-292.mp4 b/failed/ipx-292.mp4 new file mode 100644 index 0000000..e69de29 diff --git a/fanza.py b/fanza.py index 72632dc..4caed6d 100644 --- a/fanza.py +++ b/fanza.py @@ -177,6 +177,8 @@ def main(number): "https://www.dmm.co.jp/mono/dvd/-/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/digital/videoc/-/detail/=/cid=", + "https://www.dmm.co.jp/digital/nikkatsu/-/detail/=/cid=", ] chosen_url = "" for url in fanza_urls: diff --git a/pull_movie_from_output b/pull_movie_from_output new file mode 100755 index 0000000..c0eea4b --- /dev/null +++ b/pull_movie_from_output @@ -0,0 +1,2 @@ +import os +os.system('mv JAV_output/*/*/*.mp4 ./') diff --git a/py_to_exe.bat b/py_to_exe.bat new file mode 100644 index 0000000..8704b6a --- /dev/null +++ b/py_to_exe.bat @@ -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 \ No newline at end of file diff --git a/ssni-229.mmp4 b/ssni-229.mmp4 new file mode 100644 index 0000000..e69de29 diff --git a/update_check.json b/update_check.json index 6cda6f7..fabfa4f 100644 --- a/update_check.json +++ b/update_check.json @@ -1,8 +1,5 @@ { - "version": "2.9", - "version_show":"2.9", + "version": "3.0", + "version_show": "3.0", "download": "https://github.com/yoshiko2/AV_Data_Capture/releases", - - "notice_title": "test", - "notice": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\naaaaaaa" }