Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f684e67e2 | ||
|
|
18cf202b5b | ||
|
|
54b2b71472 | ||
|
|
44ba47bafc | ||
|
|
7eb72634d8 | ||
|
|
5787d3470a | ||
|
|
1fce045ac2 | ||
|
|
794aa74782 | ||
|
|
b2e49a99a7 | ||
|
|
d208d53375 | ||
|
|
7158378eca | ||
|
|
0961d8cbe4 | ||
|
|
6ef5d11742 | ||
|
|
45e1d8370c | ||
|
|
420f995977 | ||
|
|
dbe1f91bd9 | ||
|
|
770c5fcb1f | ||
|
|
665d1ffe43 |
@@ -6,7 +6,7 @@ import sys
|
||||
from ADC_function import *
|
||||
import json
|
||||
|
||||
version='0.10.3'
|
||||
version='0.10.4'
|
||||
|
||||
def UpdateCheck():
|
||||
html2 = get_html('https://raw.githubusercontent.com/wenead99/AV_Data_Capture/master/update_check.json')
|
||||
|
||||
25
README.md
25
README.md
@@ -1,3 +1,10 @@
|
||||
# AV Data Capture 日本AV元数据刮削器
|
||||
# 目录
|
||||
* [前言](#前言)
|
||||
* [捐助二维码](#捐助二维码)
|
||||
* [免责声明](#免责声明)
|
||||
* [如何使用](#如何使用)
|
||||
* [简明教程](#简要教程)
|
||||
# 前言
|
||||
  目前,我下的AV越来越多,也意味着AV要集中地管理,形成媒体库。现在有两款主流的AV元数据获取器,"EverAver"和"Javhelper"。前者的优点是元数据获取比较全,缺点是不能批量处理;后者优点是可以批量处理,但是元数据不够全。<br>
|
||||
  为此,综合上述软件特点,我写出了本软件,为了方便的管理本地AV,和更好的手冲体验。
|
||||
@@ -8,8 +15,8 @@
|
||||

|
||||
|
||||
# 捐助二维码
|
||||
如果你觉得本软件好用,可以考虑捐助作者,你的支持就是我的动力,非常感谢您的捐助
|
||||

|
||||
如果你觉得本软件好用,可以考虑捐助作者,多少钱无所谓,不强求,你的支持就是我的动力,非常感谢您的捐助
|
||||

|
||||
|
||||
# 免责声明
|
||||
1.本软件仅供技术交流,学术交流使用<br>
|
||||
@@ -21,7 +28,7 @@
|
||||
release的程序可脱离python环境运行,可跳过第一步<br>
|
||||
下载地址(仅限Windows):https://github.com/wenead99/AV_Data_Capture/releases
|
||||
### 简要教程:<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/终端逐条输入以下命令安装
|
||||
```python
|
||||
@@ -45,7 +52,7 @@ pip install pillow
|
||||
```
|
||||
###
|
||||
|
||||
## 2. 配置
|
||||
## 2.配置
|
||||
#### 1.针对网络审查国家或地区
|
||||
|
||||
打开```proxy.ini```,在```[proxy]```下的```proxy```行设置本地代理地址和端口,支持Shadowsocks/R,V2RAY本地代理端口:<br>
|
||||
@@ -70,7 +77,7 @@ pip install pillow
|
||||
>目录结构:'JAV_output/'+actor+'/'+actor+' '+' ['+year+']'+title+' ['+number+']'<br>
|
||||
>影片命名(上面目录之下的文件):'['+number+']-'+title
|
||||
|
||||
## 3. 关于番号提取失败或者异常
|
||||
## 3.关于番号提取失败或者异常
|
||||
**目前可以提取元素的影片:JAVBUS上有元数据的电影,素人系列(需要日本代理):300Maan,259luxu,siro等,FC2系列**<br>
|
||||
>下一张图片来自Pockies的blog:https://pockies.github.io/2019/03/25/everaver-emby-kodi/ 原作者已授权<br>
|
||||
|
||||
@@ -85,13 +92,13 @@ COSQ-004.mp4
|
||||
文件名中间要有下划线或者减号"_","-",没有多余的内容只有番号为最佳,可以让软件更好获取元数据
|
||||
对于多影片重命名,可以用[ReNamer](http://www.den4b.com/products/renamer)来批量重命名
|
||||
|
||||
## 4. 把软件拷贝和AV的统一目录下
|
||||
## 5. 运行 ```AV_Data_capture.py/.exe```
|
||||
## 4.把软件拷贝和AV的统一目录下
|
||||
## 5.运行 ```AV_Data_capture.py/.exe```
|
||||
你也可以把单个影片拖动到core程序<br>
|
||||

|
||||
|
||||
## 6. 软件会自动把元数据获取成功的电影移动到JAV_output文件夹中,根据女优分类,失败的电影移动到failed文件夹中。
|
||||
## 7. 把JAV_output文件夹导入到EMBY,KODI中,根据封面选片子,享受手冲乐趣
|
||||
## 6.软件会自动把元数据获取成功的电影移动到JAV_output文件夹中,根据女优分类,失败的电影移动到failed文件夹中。
|
||||
## 7.把JAV_output文件夹导入到EMBY,KODI中,根据封面选片子,享受手冲乐趣
|
||||
## 8.输出的文件如下
|
||||

|
||||

|
||||
|
||||
33
core.py
33
core.py
@@ -136,6 +136,10 @@ def getNumberFromFilename(filepath):
|
||||
tag = str(json_data['tag']).strip("[ ]").replace("'",'').replace(" ",'').split(',') #字符串转列表
|
||||
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'])
|
||||
location_rule =eval(config['Name_Rule']['location_rule'])
|
||||
except IOError as e:
|
||||
@@ -204,13 +208,14 @@ def DownloadFileWithFilename(url,filename,path): #path = examle:photo , video.in
|
||||
print("[-]Download Failed2!")
|
||||
time.sleep(3)
|
||||
os._exit(0)
|
||||
def PrintFiles(path):
|
||||
def PrintFiles(path,naming_rule):
|
||||
global title
|
||||
try:
|
||||
if not os.path.exists(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(" <title>" + title + "</title>", file=code)
|
||||
print(" <title>" + naming_rule + "</title>", file=code)
|
||||
print(" <set>", file=code)
|
||||
print(" </set>", file=code)
|
||||
print(" <studio>" + studio + "+</studio>", file=code)
|
||||
@@ -247,7 +252,7 @@ def PrintFiles(path):
|
||||
print(" <cover>"+cover+"</cover>", file=code)
|
||||
print(" <website>" + "https://www.javbus.com/"+number + "</website>", file=code)
|
||||
print("</movie>", file=code)
|
||||
print("[+]Writeed! "+path + "/" + naming_rule + ".nfo")
|
||||
print("[+]Writeed! "+path + "/" + number + ".nfo")
|
||||
except IOError as e:
|
||||
print("[-]Write Failed!")
|
||||
print(e)
|
||||
@@ -255,31 +260,31 @@ def PrintFiles(path):
|
||||
print(e1)
|
||||
print("[-]Write Failed!")
|
||||
def imageDownload(filepath): #封面是否下载成功,否则移动到failed
|
||||
if DownloadFileWithFilename(cover,naming_rule+ '.jpg', path) == 'failed':
|
||||
if DownloadFileWithFilename(cover,'Backdrop.jpg', path) == 'failed':
|
||||
shutil.move(filepath, 'failed/')
|
||||
os._exit(0)
|
||||
DownloadFileWithFilename(cover, naming_rule + '.jpg', path)
|
||||
print('[+]Image Downloaded!', path +'/'+naming_rule+'.jpg')
|
||||
DownloadFileWithFilename(cover, 'Backdrop.jpg', path)
|
||||
print('[+]Image Downloaded!', path +'/'+'Backdrop.jpg')
|
||||
def cutImage():
|
||||
if imagecut == 1:
|
||||
try:
|
||||
img = Image.open(path + '/' + naming_rule + '.jpg')
|
||||
img = Image.open(path + '/' + 'Backdrop' + '.jpg')
|
||||
imgSize = img.size
|
||||
w = img.width
|
||||
h = img.height
|
||||
img2 = img.crop((w / 1.9, 0, w, h))
|
||||
img2.save(path + '/' + naming_rule + '.png')
|
||||
img2.save(path + '/' + number + '.png')
|
||||
except:
|
||||
print('[-]Cover cut failed!')
|
||||
else:
|
||||
img = Image.open(path + '/' + naming_rule + '.jpg')
|
||||
img = Image.open(path + '/' + 'Backdrop' + '.jpg')
|
||||
w = img.width
|
||||
h = img.height
|
||||
img.save(path + '/' + naming_rule + '.png')
|
||||
img.save(path + '/' + number + '.png')
|
||||
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())
|
||||
os.rename(filepath, naming_rule + houzhui)
|
||||
shutil.move(naming_rule + houzhui, path)
|
||||
os.rename(filepath, number + houzhui)
|
||||
shutil.move(number + houzhui, path)
|
||||
|
||||
if __name__ == '__main__':
|
||||
filepath=argparse_get_file() #影片的路径
|
||||
@@ -287,6 +292,6 @@ if __name__ == '__main__':
|
||||
getNumberFromFilename(filepath) #定义番号
|
||||
creatFolder() #创建文件夹
|
||||
imageDownload(filepath) #creatFoder会返回番号路径
|
||||
PrintFiles(path)#打印文件
|
||||
PrintFiles(path,naming_rule)#打印文件
|
||||
cutImage() #裁剪图
|
||||
pasteFileToFolder(filepath,path) #移动文件
|
||||
|
||||
@@ -10,6 +10,14 @@ def getTitle(htmlcode): #获取厂商
|
||||
result2 = str(re.sub('\D{2}2-\d+','',result)).replace(' ','',1)
|
||||
#print(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): #获取厂商
|
||||
html = etree.fromstring(htmlcode,etree.HTMLParser())
|
||||
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(" ['']")
|
||||
#print(result)
|
||||
return result
|
||||
def getRelease(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')
|
||||
html=etree.fromstring(a,etree.HTMLParser())
|
||||
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')
|
||||
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(" ['']")
|
||||
return result
|
||||
def getCover(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')
|
||||
html = etree.fromstring(a, etree.HTMLParser())
|
||||
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')
|
||||
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(" ['']")
|
||||
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')
|
||||
html = etree.fromstring(a, etree.HTMLParser())
|
||||
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
|
||||
|
||||
def getOutline(htmlcode2,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')
|
||||
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)
|
||||
return result
|
||||
# def getTag(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')
|
||||
# html = etree.fromstring(a, etree.HTMLParser())
|
||||
# result = str(html.xpath('//*[@id="container"]/div[1]/div/article/section[4]/p/text()')).replace("\\n",'',10000).strip(" ['']").replace("'",'',10000)
|
||||
# return result
|
||||
def getTag(htmlcode): #获取番号
|
||||
html = etree.fromstring(htmlcode, etree.HTMLParser())
|
||||
result = str(html.xpath('/html/body/div[2]/div/div[1]/h5[4]/a/text()'))
|
||||
return result.strip(" ['']").replace("'",'').replace(' ','')
|
||||
def getYear(release):
|
||||
try:
|
||||
result = re.search('\d{4}',release).group()
|
||||
return result
|
||||
except:
|
||||
return ''
|
||||
|
||||
def main(number2):
|
||||
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')
|
||||
dic = {
|
||||
'title': getTitle(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),
|
||||
'runtime': '',
|
||||
'runtime': getYear(getRelease(htmlcode)),
|
||||
'director': getStudio(htmlcode),
|
||||
'actor': '',
|
||||
'actor': getActor(htmlcode),
|
||||
'release': getRelease(number),
|
||||
'number': 'FC2-'+number,
|
||||
'cover': getCover(htmlcode,number),
|
||||
'cover': getCover(htmlcode,number,htmlcode2),
|
||||
'imagecut': 0,
|
||||
'tag':" ",
|
||||
'tag':getTag(htmlcode),
|
||||
}
|
||||
#print(getTitle(htmlcode))
|
||||
#print(getNum(htmlcode))
|
||||
js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'),)#.encode('UTF-8')
|
||||
return js
|
||||
|
||||
#print(main('1104989'))
|
||||
#print(main('1051725'))
|
||||
12
javbus.py
12
javbus.py
@@ -15,7 +15,11 @@ import siro
|
||||
def getTitle(htmlcode): #获取标题
|
||||
doc = pq(htmlcode)
|
||||
title=str(doc('div.container h3').text()).replace(' ','-')
|
||||
return title
|
||||
try:
|
||||
title2 = re.sub('n\d+-','',title)
|
||||
return title2
|
||||
except:
|
||||
return title
|
||||
def getStudio(htmlcode): #获取厂商
|
||||
html = etree.fromstring(htmlcode,etree.HTMLParser())
|
||||
result = str(html.xpath('/html/body/div[5]/div[1]/div[2]/p[5]/a/text()')).strip(" ['']")
|
||||
@@ -121,7 +125,7 @@ def main_uncensored(number):
|
||||
htmlcode = get_html('https://www.javbus.com/' + number)
|
||||
dww_htmlcode = get_html("https://www.dmm.co.jp/mono/dvd/-/detail/=/cid=" + number.replace("-", ''))
|
||||
dic = {
|
||||
'title': str(re.sub('\w+-\d+-','',getTitle(htmlcode))),
|
||||
'title': str(re.sub('\w+-\d+-','',getTitle(htmlcode))).replace(getNum(htmlcode)+'-',''),
|
||||
'studio': getStudio(htmlcode),
|
||||
'year': getYear(htmlcode),
|
||||
'outline': getOutline(dww_htmlcode),
|
||||
@@ -141,7 +145,7 @@ def main_uncensored(number):
|
||||
number2 = number.replace('-', '_')
|
||||
htmlcode = get_html('https://www.javbus.com/' + number2)
|
||||
dic2 = {
|
||||
'title': str(re.sub('\w+-\d+-','',getTitle(htmlcode))),
|
||||
'title': str(re.sub('\w+-\d+-','',getTitle(htmlcode))).replace(getNum(htmlcode)+'-',''),
|
||||
'studio': getStudio(htmlcode),
|
||||
'year': getYear(htmlcode),
|
||||
'outline': '',
|
||||
@@ -160,8 +164,6 @@ def main_uncensored(number):
|
||||
|
||||
return js
|
||||
|
||||
#print(main('SIRO-3821'))
|
||||
|
||||
|
||||
# def return1():
|
||||
# json_data=json.loads(main('ipx-292'))
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
proxy=127.0.0.1:1080
|
||||
|
||||
[Name_Rule]
|
||||
location_rule='JAV_output/'+actor+'/'+'['+number+']-'+title
|
||||
naming_rule=number
|
||||
location_rule='JAV_output/'+actor+'/'+number+'-'+title
|
||||
naming_rule=number+'-'+title
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "0.10.3",
|
||||
"version_show":"Beta 10.3",
|
||||
"version": "0.10.4",
|
||||
"version_show":"Beta 10.4",
|
||||
"download": "https://github.com/wenead99/AV_Data_Capture/releases"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user