Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加自定义正则 & 番号大写转换配置 #1059

Merged
merged 4 commits into from
Aug 6, 2023

Conversation

TachibanaKimika
Copy link

添加以下两项配置

  • 自定义正则(number_regexs): 有些番号使用默认的规则匹配不到, 添加用户配置自定义正则的入口(匹配第一组), 如果自定义正则匹配不到会使用默认规则匹配.

  • 番号大写转换(number_uppercase): 由于有些番号匹配下来是小写的, 添加了一个配置项, 可以在写入数据时将番号转换成大写的.

效果预览:

location_rule = number, 其他为默认配置

默认配置

 ~  python .\Movie_Data_Capture.py                                         
[*]================= Movie Data Capture =================
[*]                        6.6.6
[*]======================================================
[*] - Windows-10-10.0.22621-SP0
[*] - AMD64 - Python-3.10.0
[*]======================================================
[*] - 严禁在墙内宣传本项目 -
[*]======================================================
[+]Start at 2023-08-06 15:56:01
[+]Load Config file 'F:\Repo\Movie_Data_Capture\config.ini'.
[+]Main Working mode ## 1: Scraping ## , nfo_skip_days=30
[+]Find 3 movies.
[*]======================================================
[!]                - 33.3% [1/3] -             15:56:02
[!] [ipx015] As Number Processing for 'F:\Repo\Movie_Data_Capture\test\input\ipx015.mp4'
[+]Image Downloaded! thumb.jpg
[+]Successfully downloaded 13 extrafanarts.
[+]Image Cutted!     poster.jpg
[+]Wrote!            test\output\ipx-015\ipx-015.nfo
[*]======================================================
[!]                - 66.6% [2/3] -             15:56:14
[!] [ipz00014fhd] As Number Processing for 'F:\Repo\Movie_Data_Capture\test\input\ipz00014fhd.mp4'
[-]Movie Number not found!
[*]======================================================
[!]                - 100.% [3/3] -             15:57:12
[!] [THZ] As Number Processing for 'F:\Repo\Movie_Data_Capture\test\input\[Thz.com]arbb-013-FHD.mp4'
[+]Image Downloaded! thumb.jpg
[-]Model found face  test\output\RJ294502\thumb.jpg
[+]Image Cutted!     poster.jpg
[+]Wrote!            test\output\RJ294502\RJ294502.nfo
[*]======================================================
[+]Running time 0:01:44.135  End at 2023-08-06 15:57:45
[+]All finished!!!

修改配置后

  • config.ini:
; 番号大写 1 | 0, 仅在写入数据时会进行大写转换, 搜索刮削流程则不影响
number_uppercase = 0
; 自定义正则表达式, 多个正则使用空格隔开, 第一个分组为提取的番号, 若自定义正则未能匹配到番号则使用默认规则
; example: ([A-Za-z]{2,4}\-\d{3}) ([A-Za-z]{2,4}00\d{3})
number_regexs = ([A-Za-z]{2,4}\-\d{3}) ([A-Za-z]{2,4}00\d{3})
  • 输出:
 ~  python .\Movie_Data_Capture.py
[*]================= Movie Data Capture =================
[*]                        6.6.6
[*]======================================================
[*] - Windows-10-10.0.22621-SP0
[*] - AMD64 - Python-3.10.0
[*]======================================================
[*] - 严禁在墙内宣传本项目 -
[*]======================================================
[+]Start at 2023-08-06 15:58:38
[+]Load Config file 'F:\Repo\Movie_Data_Capture\config.ini'.
[+]Main Working mode ## 1: Scraping ## , nfo_skip_days=30
[+]Find 3 movies.
[*]======================================================
[!]                - 33.3% [1/3] -             15:58:39
[!] [ipx015] As Number Processing for 'F:\Repo\Movie_Data_Capture\test\input\ipx015.mp4'
[+]Image Downloaded! thumb.jpg
[+]Successfully downloaded 13 extrafanarts.
[+]Image Cutted!     poster.jpg
[+]Wrote!            test\output\IPX-015\IPX-015.nfo
[*]======================================================
[!]                - 66.6% [2/3] -             15:58:50
[!] [ipz00014] As Number Processing for 'F:\Repo\Movie_Data_Capture\test\input\ipz00014fhd.mp4'
[+]Image Downloaded! thumb.jpg
[+]Successfully downloaded 13 extrafanarts.
[+]Image Cutted!     poster.jpg
[+]Wrote!            test\output\IPZ-014\IPZ-014.nfo
[*]======================================================
[!]                - 100.% [3/3] -             15:58:59
[!] [arbb-013] As Number Processing for 'F:\Repo\Movie_Data_Capture\test\input\[Thz.com]arbb-013-FHD.mp4'
[+]Image Downloaded! thumb.jpg
[+]Successfully downloaded 20 extrafanarts.
[+]Image Cutted!     poster.jpg
[+]Wrote!            test\output\ARBB-013\ARBB-013.nfo
[*]======================================================
[+]Running time 0:00:53.808  End at 2023-08-06 15:59:32
[+]All finished!!!

@mvdctop mvdctop merged commit 40482ce into mvdctop:master Aug 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants