Skip to content

Commit 7184aed

Browse files
author
Yohane
committed
First commit
0 parents  commit 7184aed

36 files changed

+5983
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.py text=auto eol=lf

.github/workflows/main.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: PyInstaller
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
build:
13+
runs-on: ${{ matrix.os }}
14+
15+
strategy:
16+
matrix:
17+
os: [windows-latest, macos-latest, ubuntu-latest]
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Install UPX
23+
uses: crazy-max/ghaction-upx@v2
24+
if: matrix.os == 'windows-latest' || matrix.os == 'ubuntu-latest'
25+
with:
26+
install-only: true
27+
28+
- name: UPX version
29+
if: matrix.os == 'windows-latest' || matrix.os == 'ubuntu-latest'
30+
run: upx --version
31+
32+
- name: Setup Python 3.10
33+
uses: actions/setup-python@v2
34+
with:
35+
python-version: '3.10'
36+
37+
- name: Install dependencies
38+
run: |
39+
python -m pip install --upgrade pip
40+
pip install -r requirements.txt
41+
pip install face_recognition --no-deps
42+
pip install pyinstaller
43+
44+
- name: Test number_perser.get_number
45+
run: |
46+
python number_parser.py -v
47+
48+
- name: Build with PyInstaller for macos/ubuntu
49+
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
50+
run: |
51+
pyinstaller \
52+
--onefile Movie_Data_Capture.py \
53+
--python-option u \
54+
--hidden-import "ImageProcessing.cnn" \
55+
--add-data "$(python -c 'import cloudscraper as _; print(_.__path__[0])' | tail -n 1):cloudscraper" \
56+
--add-data "$(python -c 'import opencc as _; print(_.__path__[0])' | tail -n 1):opencc" \
57+
--add-data "$(python -c 'import face_recognition_models as _; print(_.__path__[0])' | tail -n 1):face_recognition_models" \
58+
--add-data "Img:Img" \
59+
--add-data "scrapinglib:scrapinglib" \
60+
--add-data "config.ini:." \
61+
62+
- name: Build with PyInstaller for windows
63+
if: matrix.os == 'windows-latest'
64+
run: |
65+
pyinstaller `
66+
--onefile Movie_Data_Capture.py `
67+
--python-option u `
68+
--hidden-import "ImageProcessing.cnn" `
69+
--add-data "$(python -c 'import cloudscraper as _; print(_.__path__[0])' | tail -n 1);cloudscraper" `
70+
--add-data "$(python -c 'import opencc as _; print(_.__path__[0])' | tail -n 1);opencc" `
71+
--add-data "$(python -c 'import face_recognition_models as _; print(_.__path__[0])' | tail -n 1);face_recognition_models" `
72+
--add-data "Img;Img" `
73+
--add-data "scrapinglib;scrapinglib" `
74+
--add-data "config.ini;." `
75+
76+
- name: Copy config.ini
77+
run: |
78+
cp config.ini dist/
79+
80+
- name: Set VERSION variable for macos/ubuntu
81+
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
82+
run: |
83+
echo "VERSION=$(python Movie_Data_Capture.py --version)" >> $GITHUB_ENV
84+
85+
- name: Set VERSION variable for windows
86+
if: matrix.os == 'windows-latest'
87+
run: |
88+
echo "VERSION=$(python Movie_Data_Capture.py --version)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
89+
90+
- name: Upload build artifact
91+
uses: actions/upload-artifact@v1
92+
with:
93+
name: MDC-${{ env.VERSION }}-${{ runner.os }}-amd64
94+
path: dist
95+
96+
- name: Run test (Ubuntu & MacOS)
97+
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
98+
run: |
99+
cd dist
100+
./Movie_Data_Capture

.gitignore

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
MANIFEST
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
.hypothesis/
48+
.pytest_cache/
49+
50+
# Translations
51+
*.mo
52+
*.pot
53+
54+
# Django stuff:
55+
*.log
56+
local_settings.py
57+
db.sqlite3
58+
59+
# Flask stuff:
60+
instance/
61+
.webassets-cache
62+
63+
# Scrapy stuff:
64+
.scrapy
65+
66+
# Sphinx documentation
67+
docs/_build/
68+
69+
# PyBuilder
70+
target/
71+
72+
# Jupyter Notebook
73+
.ipynb_checkpoints
74+
75+
# pyenv
76+
.python-version
77+
78+
# celery beat schedule file
79+
celerybeat-schedule
80+
81+
# SageMath parsed files
82+
*.sage.py
83+
84+
# Environments
85+
.env
86+
.venv
87+
env/
88+
venv/
89+
ENV/
90+
env.bak/
91+
venv.bak/
92+
93+
# Spyder project settings
94+
.spyderproject
95+
.spyproject
96+
97+
# Rope project settings
98+
.ropeproject
99+
100+
# mkdocs documentation
101+
/site
102+
103+
# mypy
104+
.mypy_cache/
105+
106+
# movie files
107+
*.mp4
108+
109+
# success/failed folder
110+
JAV_output/**/*
111+
failed/*
112+
.vscode/launch.json
113+
114+
.idea

.vscode/launch.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
// 使用 IntelliSense 了解相关属性。
3+
// 悬停以查看现有属性的描述。
4+
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python: 当前文件",
9+
"type": "python",
10+
"request": "launch",
11+
"console": "integratedTerminal",
12+
"env": {
13+
"PYTHONIOENCODING": "utf-8"
14+
},
15+
"program": "${workspaceFolder}/Movie_Data_capture.py",
16+
"program4": "${workspaceFolder}/number_parser.py",
17+
"program5": "${workspaceFolder}/config.py",
18+
"cwd0": "${fileDirname}",
19+
"cwd1": "${workspaceFolder}/dist",
20+
"cwd2": "${env:HOME}${env:USERPROFILE}/.mdc",
21+
"args0": ["-a","-p","J:/Downloads","-o","J:/log"],
22+
"args1": ["-g","-m","3","-c","1","-d","0"],
23+
"args3": ["-agd0","-m3", "-q", ".*","-p","J:/#output"],
24+
"args4": ["-gic1", "-d0", "-m3", "-o", "avlog", "-p", "I:/output"],
25+
"args5": ["-gic1", "-d0", "-m1", "-o", "avlog", "-p", "J:/Downloads"],
26+
"args6": ["-z", "-o", "J:/log"]
27+
}
28+
]
29+
}

0 commit comments

Comments
 (0)