Compare commits
29
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
566a5658b9 | ||
|
|
5fe2874892 | ||
|
|
460c6ee868 | ||
|
|
9663f7b473 | ||
|
|
fb666feec5 | ||
|
|
b980538946 | ||
|
|
3323400937 | ||
|
|
2f29fde426 | ||
|
|
bc5c08a54c | ||
|
|
a5b0931bce | ||
|
|
5a6361897a | ||
|
|
e7090682c8 | ||
|
|
724f3a0d32 | ||
|
|
3c6741ec82 | ||
|
|
a0260d96cb | ||
|
|
bab350e8dd | ||
|
|
72fafef059 | ||
|
|
021830b31b | ||
|
|
e082cf336e | ||
|
|
3b9ab41dcc | ||
|
|
f285a1ab6b | ||
|
|
9fb813ae97 | ||
|
|
29259b7e5a | ||
|
|
952f759e90 | ||
|
|
e8f823f34c | ||
|
|
52e9d407be | ||
|
|
62bb672a83 | ||
|
|
1eef0fa48d | ||
|
|
63bc397599 |
@@ -9,12 +9,12 @@
|
||||
<br>
|
||||
|
||||
|
||||
**日本电影元数据 抓取工具 | 刮削器**,配合本地影片管理软件EMBY,KODI管理本地影片,该软件起到分类与元数据抓取作用,利用元数据信息来分类,供本地影片分类整理使用。
|
||||
**日本电影元数据 抓取工具 | 刮削器**,配合本地影片管理软件EMBY,KODI等管理本地影片,该软件起到分类与元数据抓取作用,利用元数据信息来分类,供本地影片分类整理使用。
|
||||
|
||||
# 目录
|
||||
* [免责声明](#免责声明)
|
||||
* [注意](#注意)
|
||||
* [声明](#声明)
|
||||
* [你问我答 FAQ](#你问我答-faq)
|
||||
* [故事](#故事)
|
||||
* [效果图](#效果图)
|
||||
* [如何使用](#如何使用)
|
||||
* [下载](#下载)
|
||||
@@ -29,26 +29,29 @@
|
||||
* [关于群晖NAS](#8关于群晖NAS)
|
||||
* [写在后面](#9写在后面)
|
||||
|
||||
# 免责声明
|
||||
* 本软件仅供**技术交流,学术交流**使用,本项目旨在学习 Python3<br>
|
||||
* 本软件禁止用于任何非法用途<br>
|
||||
* 使用者使用该软件产生的一切法律后果由使用者承担<br>
|
||||
* 不可使用于商业和个人其他意图<br>
|
||||
* 使用该软件前,请自觉遵守当地法律法规
|
||||
# 声明
|
||||
* 本软件仅供**技术交流,学术交流**使用<br>
|
||||
* 本软件作者编写出该软件旨在学习Python3,提高编程水平<br>
|
||||
* 用户在使用该软件前,请用户自觉遵守当地法律法规,如果该软件使用过程中存在违反当地法律法规的行为,请勿使用该软件<br>
|
||||
* 用户使用该软件时,若产生一切违法行为由用户承担<br>
|
||||
* 严禁用户使用于商业和个人其他意图<br>
|
||||
* 本软件作者保留最终决定权和最终解释权<br>
|
||||
|
||||
**若用户不同意上述条款任意一条,请勿使用该软件**<br>
|
||||
|
||||
# 注意
|
||||
**推荐用法: 使用该软件后,对于不能正常获取元数据的电影可以用 Everaver 来补救**<br>
|
||||
暂不支持多P电影<br>
|
||||
|
||||
# 你问我答 FAQ
|
||||
### F:这软件能下片吗?
|
||||
**Q**:该软件不提供任何影片下载地址,仅供本地影片分类整理使用。
|
||||
### F:什么是元数据?
|
||||
**Q**:元数据包括了影片的:封面,导演,演员,简介,类型......
|
||||
### F:软件收费吗?
|
||||
**Q**:软件永久免费。除了 **作者** 钦点以外,给那些 **利用本软件牟利** 的人送上 **骨灰盒-全家族 | 崭新出厂**
|
||||
### F:软件运行异常怎么办?
|
||||
**Q**:认真看 [异常处理(重要)](#5异常处理重要)
|
||||
### 这软件能下片吗?
|
||||
* 该软件不提供任何影片下载地址,仅供本地影片分类整理使用。
|
||||
### 什么是元数据?
|
||||
* 元数据包括了影片的:封面,导演,演员,简介,类型......
|
||||
### 软件收费吗?
|
||||
* 软件永久免费。**除了作者钦点以外**
|
||||
### 软件运行异常怎么办?
|
||||
* 认真看 [异常处理(重要)](#5异常处理重要)
|
||||
|
||||
# 故事
|
||||
[点击跳转至作者博客文章](https://yoshiko2.github.io/2019/10/18/AVDC/)
|
||||
|
||||
# 效果图
|
||||
**图片来自网络**,由于相关法律法规,具体效果请自行联想
|
||||
@@ -89,7 +92,6 @@ pip install pillow
|
||||
###
|
||||
|
||||
## 2.配置config.ini
|
||||
config.ini
|
||||
>[common]<br>
|
||||
>main_mode=1<br>
|
||||
>failed_output_folder=failed<br>
|
||||
@@ -114,13 +116,13 @@ config.ini
|
||||
>[directory_capture]<br>
|
||||
>directory=<br>
|
||||
|
||||
### 全局设置
|
||||
---
|
||||
#### 软件模式
|
||||
#### 运行模式
|
||||
>[common]<br>
|
||||
>main_mode=1<br>
|
||||
|
||||
1为普通模式,2为整理模式:仅根据女优把电影命名为番号并分类到女优名称的文件夹下
|
||||
1为普通模式<br>
|
||||
2为整理模式:仅根据女优把电影命名为番号并分类到女优名称的文件夹下
|
||||
|
||||
>failed_output_folder=failed<br>
|
||||
>success_output_folder=JAV_outputd<br>
|
||||
@@ -164,17 +166,20 @@ config.ini
|
||||
可选择emby, plex<br>
|
||||
如果是PLEX,请安装插件:```XBMCnfoMoviesImporter```
|
||||
|
||||
---
|
||||
#### 抓取目录选择
|
||||
>[directory_capture]<br>
|
||||
>directory=<br>
|
||||
如果directory后面为空,则抓取和程序同一目录下的影片,设置为``` * ```可抓取软件所在目录下的所有子目录中的影片<br>如果出错请不要加*
|
||||
|
||||
|
||||
---
|
||||
#### 调试模式
|
||||
>[debug_mode]<br>switch=1<br>
|
||||
|
||||
如要开启调试模式,请手动输入以上代码到```config.ini```中,开启后可在抓取中显示影片元数据
|
||||
|
||||
---
|
||||
#### 抓取目录选择
|
||||
>[directory_capture]<br>
|
||||
>directory=<br>
|
||||
如果directory后面为空,则抓取和程序同一目录下的影片,设置为``` * ```可抓取软件所在目录下的所有子目录中的影片
|
||||
|
||||
### 3.(可选)设置自定义目录和影片重命名规则
|
||||
>[Name_Rule]<br>
|
||||
>location_rule=actor+'/'+number<br>
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ update_check=1
|
||||
|
||||
[media]
|
||||
media_warehouse=emby
|
||||
#emby or plex
|
||||
#emby or plex or kodi
|
||||
|
||||
[directory_capture]
|
||||
directory=
|
||||
|
||||
@@ -172,6 +172,9 @@ def getDataFromJSON(file_number): #从JSON返回元数据
|
||||
title = title.replace('<', '')
|
||||
title = title.replace('>', '')
|
||||
title = title.replace('|', '')
|
||||
tmpArr = cover_small.split(',')
|
||||
if len(tmpArr) > 0:
|
||||
cover_small = tmpArr[0].strip('\"').strip('\'')
|
||||
# ====================处理异常字符 END================== #\/:*?"<>|
|
||||
|
||||
naming_rule = eval(config['Name_Rule']['naming_rule'])
|
||||
@@ -186,6 +189,14 @@ def smallCoverCheck():
|
||||
img.save(path + '/' + number + '.png')
|
||||
time.sleep(1)
|
||||
os.remove(path + '/1.jpg')
|
||||
if option == 'kodi':
|
||||
DownloadFileWithFilename(cover_small, '1.jpg', path)
|
||||
img = Image.open(path + '/1.jpg')
|
||||
w = img.width
|
||||
h = img.height
|
||||
img.save(path + '/' + number + '-poster.jpg')
|
||||
time.sleep(1)
|
||||
os.remove(path + '/1.jpg')
|
||||
if option == 'plex':
|
||||
DownloadFileWithFilename(cover_small, '1.jpg', path)
|
||||
img = Image.open(path + '/1.jpg')
|
||||
@@ -270,6 +281,11 @@ def imageDownload(filepath): #封面是否下载成功,否则移动到failed
|
||||
print('[+]Image Downloaded!', path + '/' + number + part + '.jpg')
|
||||
else:
|
||||
print('[+]Image Downloaded!', path + '/' + number + '.jpg')
|
||||
elif option == 'kodi':
|
||||
if DownloadFileWithFilename(cover, number + '-fanart.jpg', path) == 'failed':
|
||||
moveFailedFolder()
|
||||
DownloadFileWithFilename(cover, number + '-fanart.jpg', path)
|
||||
print('[+]Image Downloaded!', path + '/' + number + '-fanart.jpg')
|
||||
elif option == 'plex':
|
||||
if DownloadFileWithFilename(cover, 'fanart.jpg', path) == 'failed':
|
||||
moveFailedFolder()
|
||||
@@ -373,6 +389,52 @@ def PrintFiles(filepath):
|
||||
print(" <website>" + "https://www.javbus.com/" + number + "</website>", file=code)
|
||||
print("</movie>", file=code)
|
||||
print("[+]Writeed! " + path + "/" + number + ".nfo")
|
||||
elif option == 'kodi':
|
||||
with open(path + "/" + number + ".nfo", "wt", encoding='UTF-8') as code:
|
||||
print("<movie>", file=code)
|
||||
print(" <title>" + naming_rule + "</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 + "-poster.jpg</poster>", file=code)
|
||||
print(" <fanart>" + number + '-fanart.jpg' + "</fanart>", file=code)
|
||||
try:
|
||||
for key, value in actor_photo.items():
|
||||
print(" <actor>", file=code)
|
||||
print(" <name>" + key + "</name>", file=code)
|
||||
if not actor_photo == '': # or actor_photo == []:
|
||||
print(" <thumb>" + value + "</thumb>", 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>" + "https://www.javbus.com/" + number + "</website>", file=code)
|
||||
print("</movie>", file=code)
|
||||
print("[+]Writeed! " + path + "/" + number + ".nfo")
|
||||
except IOError as e:
|
||||
print("[-]Write Failed!")
|
||||
print(e)
|
||||
@@ -414,9 +476,28 @@ def cutImage():
|
||||
w = img.width
|
||||
h = img.height
|
||||
img.save(path + '/' + number + '.png')
|
||||
elif option == 'kodi':
|
||||
if imagecut == 1:
|
||||
try:
|
||||
img = Image.open(path + '/' + number + '-fanart.jpg')
|
||||
imgSize = img.size
|
||||
w = img.width
|
||||
h = img.height
|
||||
img2 = img.crop((w / 1.9, 0, w, h))
|
||||
img2.save(path + '/' + number + '-poster.jpg')
|
||||
except:
|
||||
print('[-]Cover cut failed!')
|
||||
elif imagecut == 0:
|
||||
img = Image.open(path + '/' + number + '-fanart.jpg')
|
||||
w = img.width
|
||||
h = img.height
|
||||
img.save(path + '/' + number + '-poster.jpg')
|
||||
def pasteFileToFolder(filepath, path): #文件路径,番号,后缀,要移动至的位置
|
||||
global houzhui
|
||||
houzhui = str(re.search('[.](AVI|RMVB|WMV|MOV|MP4|MKV|FLV|TS|avi|rmvb|wmv|mov|mp4|mkv|flv|ts)$', filepath).group())
|
||||
if part == '-CD1' and option == 'kodi':
|
||||
global number
|
||||
number += part
|
||||
try:
|
||||
os.rename(filepath, path + '/' + number + houzhui)
|
||||
except FileExistsError:
|
||||
@@ -432,6 +513,8 @@ def renameJpgToBackdrop_copy():
|
||||
shutil.copy(path + '/poster.png', path + '/thumb.png')
|
||||
if option == 'emby':
|
||||
shutil.copy(path + '/' + number + '.jpg', path + '/Backdrop.jpg')
|
||||
if option == 'kodi':
|
||||
shutil.copy(path + '/' + number + '-fanart.jpg', path + '/Backdrop.jpg')
|
||||
def renameBackdropToJpg_copy():
|
||||
if option == 'plex':
|
||||
shutil.copy(path + '/fanart.jpg', path + '/Backdrop.jpg')
|
||||
@@ -439,6 +522,8 @@ def renameBackdropToJpg_copy():
|
||||
if option == 'emby':
|
||||
shutil.copy(path + '/Backdrop.jpg', path + '/' + number + '.jpg')
|
||||
print('[+]Image Downloaded!', path + '/' + number + '.jpg')
|
||||
if option == 'kodi':
|
||||
print('跳过分集图片下载')
|
||||
def get_part(filepath):
|
||||
try:
|
||||
if re.search('-CD\d+', filepath):
|
||||
@@ -486,7 +571,7 @@ if __name__ == '__main__':
|
||||
if part == '-CD1' or multi_part == 0:
|
||||
smallCoverCheck()
|
||||
imageDownload(filepath) # creatFoder会返回番号路径
|
||||
if multi_part == 1:
|
||||
if multi_part == 1 and option != 'kodi':
|
||||
number += part
|
||||
PrintFiles(filepath) # 打印文件
|
||||
cutImage() # 裁剪图
|
||||
|
||||
Reference in New Issue
Block a user