18 Commits

Author SHA1 Message Date
wenead99
6f684e67e2 Beta 0.15 更新 2019-06-22 00:34:36 +08:00
wenead99
18cf202b5b Update README.md 2019-06-21 23:59:15 +08:00
wenead99
54b2b71472 Update README.md 2019-06-21 23:58:12 +08:00
wenead99
44ba47bafc Update README.md 2019-06-21 23:55:23 +08:00
wenead99
7eb72634d8 Update README.md 2019-06-21 20:07:44 +08:00
wenead99
5787d3470a Update README.md 2019-06-21 20:05:53 +08:00
wenead99
1fce045ac2 Update README.md 2019-06-21 20:05:09 +08:00
wenead99
794aa74782 Update README.md 2019-06-21 20:03:07 +08:00
wenead99
b2e49a99a7 Update README.md 2019-06-21 20:01:58 +08:00
wenead99
d208d53375 Update README.md 2019-06-21 20:00:15 +08:00
wenead99
7158378eca Update README.md 2019-06-21 19:59:55 +08:00
wenead99
0961d8cbe4 Update README.md 2019-06-21 19:59:41 +08:00
wenead99
6ef5d11742 Update README.md 2019-06-21 19:57:03 +08:00
wenead99
45e1d8370c Beta 10.4 更新 2019-06-21 18:27:21 +08:00
wenead99
420f995977 Update README.md 2019-06-21 18:26:25 +08:00
wenead99
dbe1f91bd9 Update README.md 2019-06-21 18:23:59 +08:00
wenead99
770c5fcb1f Update update_check.json 2019-06-21 17:54:41 +08:00
wenead99
665d1ffe43 Beta 10.4 2019-06-21 15:40:02 +08:00
7 changed files with 87 additions and 54 deletions

View File

@@ -6,7 +6,7 @@ import sys
from ADC_function import * from ADC_function import *
import json import json
version='0.10.3' version='0.10.4'
def UpdateCheck(): def UpdateCheck():
html2 = get_html('https://raw.githubusercontent.com/wenead99/AV_Data_Capture/master/update_check.json') html2 = get_html('https://raw.githubusercontent.com/wenead99/AV_Data_Capture/master/update_check.json')

View File

@@ -1,3 +1,10 @@
# AV Data Capture 日本AV元数据刮削器
# 目录
* [前言](#前言)
* [捐助二维码](#捐助二维码)
* [免责声明](#免责声明)
* [如何使用](#如何使用)
* [简明教程](#简要教程)
# 前言 # 前言
&emsp;&emsp;目前我下的AV越来越多也意味着AV要集中地管理形成媒体库。现在有两款主流的AV元数据获取器"EverAver"和"Javhelper"。前者的优点是元数据获取比较全,缺点是不能批量处理;后者优点是可以批量处理,但是元数据不够全。<br> &emsp;&emsp;目前我下的AV越来越多也意味着AV要集中地管理形成媒体库。现在有两款主流的AV元数据获取器"EverAver"和"Javhelper"。前者的优点是元数据获取比较全,缺点是不能批量处理;后者优点是可以批量处理,但是元数据不够全。<br>
&emsp;&emsp;为此综合上述软件特点我写出了本软件为了方便的管理本地AV和更好的手冲体验。 &emsp;&emsp;为此综合上述软件特点我写出了本软件为了方便的管理本地AV和更好的手冲体验。
@@ -8,8 +15,8 @@
![](https://i.loli.net/2019/06/02/5cf2b5d0bbecf69019.png) ![](https://i.loli.net/2019/06/02/5cf2b5d0bbecf69019.png)
# 捐助二维码 # 捐助二维码
如果你觉得本软件好用,可以考虑捐助作者,你的支持就是我的动力,非常感谢您的捐助 如果你觉得本软件好用,可以考虑捐助作者,多少钱无所谓,不强求,你的支持就是我的动力,非常感谢您的捐助
![](https://i.loli.net/2019/06/21/5d0c3dcdc95c979755.png) ![](https://i.loli.net/2019/06/21/5d0cb02ca489d19393.png)
# 免责声明 # 免责声明
1.本软件仅供技术交流,学术交流使用<br> 1.本软件仅供技术交流,学术交流使用<br>
@@ -21,7 +28,7 @@
release的程序可脱离python环境运行可跳过第一步<br> release的程序可脱离python环境运行可跳过第一步<br>
下载地址(仅限Windows):https://github.com/wenead99/AV_Data_Capture/releases 下载地址(仅限Windows):https://github.com/wenead99/AV_Data_Capture/releases
### 简要教程:<br> ### 简要教程:<br>
**1.把软件拉到和电影的同一目录<br>2.设置ini文件的代理<br>3.运行软件等待完成<br>4.把JAV_output导入至KODI,EMBY中。<br>详细请看以下教程** **1.把软件拉到和电影的同一目录<br>2.设置ini文件的代理路由器拥有自动代理功能的可以把proxy=后面内容去掉)<br>3.运行软件等待完成<br>4.把JAV_output导入至KODI,EMBY中。<br>详细请看以下教程**
## 1.请安装模块,在CMD/终端逐条输入以下命令安装 ## 1.请安装模块,在CMD/终端逐条输入以下命令安装
```python ```python

33
core.py
View File

@@ -136,6 +136,10 @@ def getNumberFromFilename(filepath):
tag = str(json_data['tag']).strip("[ ]").replace("'",'').replace(" ",'').split(',') #字符串转列表 tag = str(json_data['tag']).strip("[ ]").replace("'",'').replace(" ",'').split(',') #字符串转列表
actor = str(actor_list).strip("[ ]").replace("'",'').replace(" ",'') actor = str(actor_list).strip("[ ]").replace("'",'').replace(" ",'')
#====================处理异常字符====================== #\/:*?"<>|
#if "\\" in title or "/" in title or ":" in title or "*" in title or "?" in title or '"' in title or '<' in title or ">" in title or "|" in title or len(title) > 200:
# title = title.
naming_rule = eval(config['Name_Rule']['naming_rule']) naming_rule = eval(config['Name_Rule']['naming_rule'])
location_rule =eval(config['Name_Rule']['location_rule']) location_rule =eval(config['Name_Rule']['location_rule'])
except IOError as e: except IOError as e:
@@ -204,13 +208,14 @@ def DownloadFileWithFilename(url,filename,path): #path = examle:photo , video.in
print("[-]Download Failed2!") print("[-]Download Failed2!")
time.sleep(3) time.sleep(3)
os._exit(0) os._exit(0)
def PrintFiles(path): def PrintFiles(path,naming_rule):
global title
try: try:
if not os.path.exists(path): if not os.path.exists(path):
os.makedirs(path) os.makedirs(path)
with open(path + "/" + naming_rule + ".nfo", "wt", encoding='UTF-8') as code: with open(path + "/" + number + ".nfo", "wt", encoding='UTF-8') as code:
print("<movie>", file=code) print("<movie>", file=code)
print(" <title>" + title + "</title>", file=code) print(" <title>" + naming_rule + "</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)
@@ -247,7 +252,7 @@ def PrintFiles(path):
print(" <cover>"+cover+"</cover>", file=code) print(" <cover>"+cover+"</cover>", file=code)
print(" <website>" + "https://www.javbus.com/"+number + "</website>", file=code) print(" <website>" + "https://www.javbus.com/"+number + "</website>", file=code)
print("</movie>", file=code) print("</movie>", file=code)
print("[+]Writeed! "+path + "/" + naming_rule + ".nfo") print("[+]Writeed! "+path + "/" + number + ".nfo")
except IOError as e: except IOError as e:
print("[-]Write Failed!") print("[-]Write Failed!")
print(e) print(e)
@@ -255,31 +260,31 @@ def PrintFiles(path):
print(e1) print(e1)
print("[-]Write Failed!") print("[-]Write Failed!")
def imageDownload(filepath): #封面是否下载成功否则移动到failed def imageDownload(filepath): #封面是否下载成功否则移动到failed
if DownloadFileWithFilename(cover,naming_rule+ '.jpg', path) == 'failed': if DownloadFileWithFilename(cover,'Backdrop.jpg', path) == 'failed':
shutil.move(filepath, 'failed/') shutil.move(filepath, 'failed/')
os._exit(0) os._exit(0)
DownloadFileWithFilename(cover, naming_rule + '.jpg', path) DownloadFileWithFilename(cover, 'Backdrop.jpg', path)
print('[+]Image Downloaded!', path +'/'+naming_rule+'.jpg') print('[+]Image Downloaded!', path +'/'+'Backdrop.jpg')
def cutImage(): def cutImage():
if imagecut == 1: if imagecut == 1:
try: try:
img = Image.open(path + '/' + naming_rule + '.jpg') img = Image.open(path + '/' + 'Backdrop' + '.jpg')
imgSize = img.size imgSize = img.size
w = img.width w = img.width
h = img.height h = img.height
img2 = img.crop((w / 1.9, 0, w, h)) img2 = img.crop((w / 1.9, 0, w, h))
img2.save(path + '/' + naming_rule + '.png') img2.save(path + '/' + number + '.png')
except: except:
print('[-]Cover cut failed!') print('[-]Cover cut failed!')
else: else:
img = Image.open(path + '/' + naming_rule + '.jpg') img = Image.open(path + '/' + 'Backdrop' + '.jpg')
w = img.width w = img.width
h = img.height h = img.height
img.save(path + '/' + naming_rule + '.png') img.save(path + '/' + number + '.png')
def pasteFileToFolder(filepath, path): #文件路径,番号,后缀,要移动至的位置 def pasteFileToFolder(filepath, path): #文件路径,番号,后缀,要移动至的位置
houzhui = str(re.search('[.](AVI|RMVB|WMV|MOV|MP4|MKV|FLV|TS|avi|rmvb|wmv|mov|mp4|mkv|flv|ts)$', filepath).group()) houzhui = str(re.search('[.](AVI|RMVB|WMV|MOV|MP4|MKV|FLV|TS|avi|rmvb|wmv|mov|mp4|mkv|flv|ts)$', filepath).group())
os.rename(filepath, naming_rule + houzhui) os.rename(filepath, number + houzhui)
shutil.move(naming_rule + houzhui, path) shutil.move(number + houzhui, path)
if __name__ == '__main__': if __name__ == '__main__':
filepath=argparse_get_file() #影片的路径 filepath=argparse_get_file() #影片的路径
@@ -287,6 +292,6 @@ if __name__ == '__main__':
getNumberFromFilename(filepath) #定义番号 getNumberFromFilename(filepath) #定义番号
creatFolder() #创建文件夹 creatFolder() #创建文件夹
imageDownload(filepath) #creatFoder会返回番号路径 imageDownload(filepath) #creatFoder会返回番号路径
PrintFiles(path)#打印文件 PrintFiles(path,naming_rule)#打印文件
cutImage() #裁剪图 cutImage() #裁剪图
pasteFileToFolder(filepath,path) #移动文件 pasteFileToFolder(filepath,path) #移动文件

View File

@@ -10,6 +10,14 @@ def getTitle(htmlcode): #获取厂商
result2 = str(re.sub('\D{2}2-\d+','',result)).replace(' ','',1) result2 = str(re.sub('\D{2}2-\d+','',result)).replace(' ','',1)
#print(result2) #print(result2)
return result2 return result2
def getActor(htmlcode):
try:
html = etree.fromstring(htmlcode, etree.HTMLParser())
result = str(html.xpath('/html/body/div[2]/div/div[1]/h5[5]/a/text()')).strip(" ['']")
return result
except:
return ''
def getStudio(htmlcode): #获取厂商 def getStudio(htmlcode): #获取厂商
html = etree.fromstring(htmlcode,etree.HTMLParser()) html = etree.fromstring(htmlcode,etree.HTMLParser())
result = str(html.xpath('/html/body/div[2]/div/div[1]/h5[3]/a[1]/text()')).strip(" ['']") result = str(html.xpath('/html/body/div[2]/div/div[1]/h5[3]/a[1]/text()')).strip(" ['']")
@@ -19,47 +27,58 @@ def getNum(htmlcode): #获取番号
result = str(html.xpath('/html/body/div[5]/div[1]/div[2]/p[1]/span[2]/text()')).strip(" ['']") result = str(html.xpath('/html/body/div[5]/div[1]/div[2]/p[1]/span[2]/text()')).strip(" ['']")
#print(result) #print(result)
return result return result
def getRelease(number): def getRelease(htmlcode2): #
a=ADC_function.get_html('http://adult.contents.fc2.com/article_search.php?id='+str(number).lstrip("FC2-").lstrip("fc2-").lstrip("fc2_").lstrip("fc2-")+'&utm_source=aff_php&utm_medium=source_code&utm_campaign=from_aff_php') #a=ADC_function.get_html('http://adult.contents.fc2.com/article_search.php?id='+str(number).lstrip("FC2-").lstrip("fc2-").lstrip("fc2_").lstrip("fc2-")+'&utm_source=aff_php&utm_medium=source_code&utm_campaign=from_aff_php')
html=etree.fromstring(a,etree.HTMLParser()) html=etree.fromstring(htmlcode2,etree.HTMLParser())
result = str(html.xpath('//*[@id="container"]/div[1]/div/article/section[1]/div/div[2]/dl/dd[4]/text()')).strip(" ['']") result = str(html.xpath('//*[@id="container"]/div[1]/div/article/section[1]/div/div[2]/dl/dd[4]/text()')).strip(" ['']")
return result return result
def getCover(htmlcode,number): #获取厂商 def getCover(htmlcode,number,htmlcode2): #获取厂商 #
a = ADC_function.get_html('http://adult.contents.fc2.com/article_search.php?id=' + str(number).lstrip("FC2-").lstrip("fc2-").lstrip("fc2_").lstrip("fc2-") + '&utm_source=aff_php&utm_medium=source_code&utm_campaign=from_aff_php') #a = ADC_function.get_html('http://adult.contents.fc2.com/article_search.php?id=' + str(number).lstrip("FC2-").lstrip("fc2-").lstrip("fc2_").lstrip("fc2-") + '&utm_source=aff_php&utm_medium=source_code&utm_campaign=from_aff_php')
html = etree.fromstring(a, etree.HTMLParser()) html = etree.fromstring(htmlcode2, etree.HTMLParser())
result = str(html.xpath('//*[@id="container"]/div[1]/div/article/section[1]/div/div[1]/a/img/@src')).strip(" ['']") result = str(html.xpath('//*[@id="container"]/div[1]/div/article/section[1]/div/div[1]/a/img/@src')).strip(" ['']")
if result == '':
html = etree.fromstring(htmlcode, etree.HTMLParser())
result2 = str(html.xpath('//*[@id="slider"]/ul[1]/li[1]/img/@src')).strip(" ['']")
return 'http://fc2fans.club' + result2
return 'http:' + result return 'http:' + result
def getOutline(htmlcode,number): #获取番号
a = ADC_function.get_html('http://adult.contents.fc2.com/article_search.php?id=' + str(number).lstrip("FC2-").lstrip("fc2-").lstrip("fc2_").lstrip("fc2-") + '&utm_source=aff_php&utm_medium=source_code&utm_campaign=from_aff_php') def getOutline(htmlcode2,number): #获取番号 #
html = etree.fromstring(a, etree.HTMLParser()) #a = ADC_function.get_html('http://adult.contents.fc2.com/article_search.php?id=' + str(number).lstrip("FC2-").lstrip("fc2-").lstrip("fc2_").lstrip("fc2-") + '&utm_source=aff_php&utm_medium=source_code&utm_campaign=from_aff_php')
html = etree.fromstring(htmlcode2, etree.HTMLParser())
result = str(html.xpath('//*[@id="container"]/div[1]/div/article/section[4]/p/text()')).replace("\\n",'',10000).strip(" ['']").replace("'",'',10000) result = str(html.xpath('//*[@id="container"]/div[1]/div/article/section[4]/p/text()')).replace("\\n",'',10000).strip(" ['']").replace("'",'',10000)
return result return result
# def getTag(htmlcode,number): #获取番号 def getTag(htmlcode): #获取番号
# a = ADC_function.get_html('http://adult.contents.fc2.com/article_search.php?id=' + str(number).lstrip("FC2-").lstrip("fc2-").lstrip("fc2_").lstrip("fc2-") + '&utm_source=aff_php&utm_medium=source_code&utm_campaign=from_aff_php') html = etree.fromstring(htmlcode, etree.HTMLParser())
# html = etree.fromstring(a, etree.HTMLParser()) result = str(html.xpath('/html/body/div[2]/div/div[1]/h5[4]/a/text()'))
# result = str(html.xpath('//*[@id="container"]/div[1]/div/article/section[4]/p/text()')).replace("\\n",'',10000).strip(" ['']").replace("'",'',10000) return result.strip(" ['']").replace("'",'').replace(' ','')
# return result def getYear(release):
try:
result = re.search('\d{4}',release).group()
return result
except:
return ''
def main(number2): def main(number2):
number=number2.replace('PPV','').replace('ppv','') number=number2.replace('PPV','').replace('ppv','')
htmlcode2 = ADC_function.get_html('http://adult.contents.fc2.com/article_search.php?id='+str(number).lstrip("FC2-").lstrip("fc2-").lstrip("fc2_").lstrip("fc2-")+'&utm_source=aff_php&utm_medium=source_code&utm_campaign=from_aff_php')
htmlcode = ADC_function.get_html('http://fc2fans.club/html/FC2-' + number + '.html') htmlcode = ADC_function.get_html('http://fc2fans.club/html/FC2-' + number + '.html')
dic = { dic = {
'title': getTitle(htmlcode), 'title': getTitle(htmlcode),
'studio': getStudio(htmlcode), 'studio': getStudio(htmlcode),
'year': str(re.search('\d{4}',getRelease(number)).group()), 'year': '',#str(re.search('\d{4}',getRelease(number)).group()),
'outline': getOutline(htmlcode,number), 'outline': getOutline(htmlcode,number),
'runtime': '', 'runtime': getYear(getRelease(htmlcode)),
'director': getStudio(htmlcode), 'director': getStudio(htmlcode),
'actor': '', 'actor': getActor(htmlcode),
'release': getRelease(number), 'release': getRelease(number),
'number': 'FC2-'+number, 'number': 'FC2-'+number,
'cover': getCover(htmlcode,number), 'cover': getCover(htmlcode,number,htmlcode2),
'imagecut': 0, 'imagecut': 0,
'tag':" ", 'tag':getTag(htmlcode),
} }
#print(getTitle(htmlcode)) #print(getTitle(htmlcode))
#print(getNum(htmlcode)) #print(getNum(htmlcode))
js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'),)#.encode('UTF-8') js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'),)#.encode('UTF-8')
return js return js
#print(main('1104989')) #print(main('1051725'))

View File

@@ -15,6 +15,10 @@ import siro
def getTitle(htmlcode): #获取标题 def getTitle(htmlcode): #获取标题
doc = pq(htmlcode) doc = pq(htmlcode)
title=str(doc('div.container h3').text()).replace(' ','-') title=str(doc('div.container h3').text()).replace(' ','-')
try:
title2 = re.sub('n\d+-','',title)
return title2
except:
return title return title
def getStudio(htmlcode): #获取厂商 def getStudio(htmlcode): #获取厂商
html = etree.fromstring(htmlcode,etree.HTMLParser()) html = etree.fromstring(htmlcode,etree.HTMLParser())
@@ -121,7 +125,7 @@ def main_uncensored(number):
htmlcode = get_html('https://www.javbus.com/' + number) htmlcode = get_html('https://www.javbus.com/' + number)
dww_htmlcode = get_html("https://www.dmm.co.jp/mono/dvd/-/detail/=/cid=" + number.replace("-", '')) dww_htmlcode = get_html("https://www.dmm.co.jp/mono/dvd/-/detail/=/cid=" + number.replace("-", ''))
dic = { dic = {
'title': str(re.sub('\w+-\d+-','',getTitle(htmlcode))), 'title': str(re.sub('\w+-\d+-','',getTitle(htmlcode))).replace(getNum(htmlcode)+'-',''),
'studio': getStudio(htmlcode), 'studio': getStudio(htmlcode),
'year': getYear(htmlcode), 'year': getYear(htmlcode),
'outline': getOutline(dww_htmlcode), 'outline': getOutline(dww_htmlcode),
@@ -141,7 +145,7 @@ def main_uncensored(number):
number2 = number.replace('-', '_') number2 = number.replace('-', '_')
htmlcode = get_html('https://www.javbus.com/' + number2) htmlcode = get_html('https://www.javbus.com/' + number2)
dic2 = { dic2 = {
'title': str(re.sub('\w+-\d+-','',getTitle(htmlcode))), 'title': str(re.sub('\w+-\d+-','',getTitle(htmlcode))).replace(getNum(htmlcode)+'-',''),
'studio': getStudio(htmlcode), 'studio': getStudio(htmlcode),
'year': getYear(htmlcode), 'year': getYear(htmlcode),
'outline': '', 'outline': '',
@@ -160,8 +164,6 @@ def main_uncensored(number):
return js return js
#print(main('SIRO-3821'))
# def return1(): # def return1():
# json_data=json.loads(main('ipx-292')) # json_data=json.loads(main('ipx-292'))

View File

@@ -2,5 +2,5 @@
proxy=127.0.0.1:1080 proxy=127.0.0.1:1080
[Name_Rule] [Name_Rule]
location_rule='JAV_output/'+actor+'/'+'['+number+']-'+title location_rule='JAV_output/'+actor+'/'+number+'-'+title
naming_rule=number naming_rule=number+'-'+title

View File

@@ -1,5 +1,5 @@
{ {
"version": "0.10.3", "version": "0.10.4",
"version_show":"Beta 10.3", "version_show":"Beta 10.4",
"download": "https://github.com/wenead99/AV_Data_Capture/releases" "download": "https://github.com/wenead99/AV_Data_Capture/releases"
} }