Skip to content

Commit 5591e55

Browse files
committed
新增007-CutVideoAudio视频剪辑、修复下载器bug
1 parent e41e660 commit 5591e55

23 files changed

+901
-30
lines changed

001-Downloader/config.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
expired_time=2025/12/15 23:59:59
55

66
#app的版本名称
7-
version_name=1.0.3
7+
version_name=1.0.4
88

99
#app的版本号
10-
version_code=103
10+
version_code=1040

001-Downloader/douyin/dy_download.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def start(self, url, path):
3030
# 读取保存路径
3131
self.save = path
3232
# 读取下载视频个数
33-
self.count = 35
33+
self.count = 10
3434
# 读取下载是否下载音频
3535
self.musicarg = True
3636
# 读取用户主页地址
@@ -83,7 +83,7 @@ def parse_single(self):
8383
aweme_id.append(str(detail['aweme_id']))
8484
nickname.append(str(detail['author']['nickname']))
8585
Downloader.print_ui('开始下载单个视频' + video_list[0])
86-
self.videos_download(1, author_list, video_list, aweme_id, nickname, max_cursor)
86+
self.videos_download(author_list, video_list, aweme_id, nickname, max_cursor)
8787

8888
# 匹配粘贴的url地址
8989
def Find(self, string):
@@ -130,7 +130,6 @@ def get_data(self, api_post_url, max_cursor):
130130
Downloader.print_ui('[ 用户 ]:' + str(self.nickname) + '\r')
131131
max_cursor = html['max_cursor']
132132
result = html['aweme_list']
133-
self.count = len(result)
134133
Downloader.print_ui('----抓获数据成功----\r')
135134

136135
# 处理第一页视频信息
@@ -167,14 +166,13 @@ def next_data(self, max_cursor):
167166
index += 1
168167
# Downloader.print_ui('----正在对' + max_cursor + '页进行第 %d 次尝试----\r' % index)
169168
Downloader.print_ui('----正在对{}页进行第 {} 次尝试----\r'.format(max_cursor, index))
170-
time.sleep(0.3)
169+
time.sleep(3)
171170
response = requests.get(url=api_naxt_post_url, headers=self.headers)
172171
html = json.loads(response.content.decode())
173172
if self.end == False:
174173
# 下一页值
175174
max_cursor = html['max_cursor']
176175
result = html['aweme_list']
177-
self.count = len(result)
178176
Downloader.print_ui('----{}页抓获数据成功----\r'.format(max_cursor))
179177
# 处理下一页视频信息
180178
self.video_info(result, max_cursor)
@@ -200,7 +198,7 @@ def video_info(self, result, max_cursor):
200198
# 封面大图
201199
# dynamic_cover = []
202200

203-
for i2 in range(self.count):
201+
for i2 in range(len(result)):
204202
try:
205203
author_list.append(str(result[i2]['desc']))
206204
video_list.append(str(result[i2]['video']['play_addr']['url_list'][0]))
@@ -210,10 +208,11 @@ def video_info(self, result, max_cursor):
210208
except Exception as error:
211209
# Downloader.print_ui2(error)
212210
pass
213-
self.videos_download(self.count, author_list, video_list, aweme_id, nickname, max_cursor)
211+
self.videos_download(author_list, video_list, aweme_id, nickname, max_cursor)
214212
return self, author_list, video_list, aweme_id, nickname, max_cursor
215213

216-
def videos_download(self, count, author_list, video_list, aweme_id, nickname, max_cursor):
214+
def videos_download(self, author_list, video_list, aweme_id, nickname, max_cursor):
215+
count = len(author_list)
217216
Downloader.add_total_count(count)
218217
for i in range(count):
219218
if count == 1:
@@ -290,7 +289,7 @@ def videos_download(self, count, author_list, video_list, aweme_id, nickname, ma
290289
Downloader.add_success_count()
291290
except Exception as error:
292291
# Downloader.print_ui2(error)
293-
Downloader.print_ui('该页视频没有' + str(self.count) + '个,已为您跳过\r')
292+
Downloader.print_ui('该页视频没有' + str(count) + '个,已为您跳过\r')
294293
Downloader.add_failed_count()
295294
break
296295
self.next_data(max_cursor)
+4-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
ss://[email protected]:5003#github.com/freefq%20-%20%E7%BE%8E%E5%9B%BD%20%2010,172.99.190.39,美国 康涅狄格
2-
ss://[email protected]:9101#github.com/freefq%20-%20%E7%BE%8E%E5%9B%BD%20%2015,172.99.190.205,美国 康涅狄格
3-
ss://YWVzLTI1Ni1nY206ZmFCQW9ENTRrODdVSkc3QDE0NS4yMzkuMS4xMDA6MjM3NQ==#github.com%2Ffreefq+-+%E8%8B%B1%E5%9B%BD++18,145.239.1.100,德国 Hessen
4-
ss://Y2hhY2hhMjAtaWV0Zi1wb2x5MTMwNTpzRjQzWHQyZ09OcWNnRlg1NjNAMTQxLjk1LjAuMjY6ODI2#github.com%2Ffreefq+-+%E8%8B%B1%E5%9B%BD++13,54.38.217.138,美国 新泽西
5-
ss://YWVzLTI1Ni1nY206WTZSOXBBdHZ4eHptR0NAMTcyLjk5LjE5MC4xNDk6MzMwNg==#github.com%2Ffreefq+-+%E7%BE%8E%E5%9B%BD++14,172.99.190.149,美国 康涅狄格
6-
ss://YWVzLTI1Ni1nY206ZmFCQW9ENTRrODdVSkc3QDE3Mi45OS4xOTAuMTg4OjIzNzY=#github.com%2Ffreefq+-+%E7%BE%8E%E5%9B%BD++11,172.99.190.188,美国 康涅狄格
7-
ss://YWVzLTI1Ni1nY206UENubkg2U1FTbmZvUzI3QDEzNC4xOTUuMTk2LjE0Nzo4MDkw#github.com%2Ffreefq+-+%E5%8C%97%E7%BE%8E%E5%9C%B0%E5%8C%BA++9,134.195.196.147,美国
8-
ss://YWVzLTI1Ni1nY206ekROVmVkUkZQUWV4Rzl2QDE2OS4xOTcuMTQxLjkxOjYzNzk=#github.com%2Ffreefq+-+%E5%8C%97%E7%BE%8E%E5%9C%B0%E5%8C%BA++22,169.197.141.91,美国 佐治亚 亚特兰大
9-
ss://YWVzLTI1Ni1nY206ZmFCQW9ENTRrODdVSkc3QDEzNC4xOTUuMTk2LjE5MzoyMzc2#github.com%2Ffreefq+-+%E5%8C%97%E7%BE%8E%E5%9C%B0%E5%8C%BA++15,134.195.196.193,美国
10-
ss://YWVzLTI1Ni1nY206ZzVNZUQ2RnQzQ1dsSklkQDEzNC4xOTUuMTk2LjIwMDo1MDAz#github.com%2Ffreefq+-+%E5%8C%97%E7%BE%8E%E5%9C%B0%E5%8C%BA++10,134.195.196.200,美国
1+
ss://[email protected]:443#github.com/freefq%20-%20%E5%8C%97%E7%BE%8E%E5%9C%B0%E5%8C%BA%20%202,134.195.196.68,美国
2+
ss://[email protected]:9101#github.com/freefq%20-%20%E5%8C%97%E7%BE%8E%E5%9C%B0%E5%8C%BA%20%206,134.195.196.81,美国
3+
ss://[email protected]:8009#github.com/freefq%20-%20%E5%8C%97%E7%BE%8E%E5%9C%B0%E5%8C%BA%20%201,134.195.196.187,美国
4+
vmess://ew0KICAidiI6ICIyIiwNCiAgInBzIiA6Iue/u+WimeWFmmZhbnFpYW5nZGFuZy5jb20iLCIiIDogIkBTU1JTVUItVjE1LeS7mOi0ueaOqOiNkDpzdW8ueXQvc3Nyc3ViIiwNCiAgImFkZCI6ICI0Mi4xOTMuNDguNjQiLA0KICAicG9ydCI6ICI1MDAwMiIsDQogICJpZCI6ICI0MTgwNDhhZi1hMjkzLTRiOTktOWIwYy05OGNhMzU4MGRkMjQiLA0KICAiYWlkIjogIjY0IiwNCiAgInNjeSI6ICJhdXRvIiwNCiAgIm5ldCI6ICJ0Y3AiLA0KICAidHlwZSI6ICJub25lIiwNCiAgImhvc3QiOiAiNDIuMTkzLjQ4LjY0IiwNCiAgInBhdGgiOiAiIiwNCiAgInRscyI6ICIiLA0KICAic25pIjogIiINCn0=,42.193.48.64,中国 上海 上海市 电信

005-PaidSource/v2ray_util.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ def search_node():
1818
Config.set_v2ray_core_path('/Users/Qincji/Desktop/develop/soft/intalled/v2ray-macos-64') # v2ray内核存放路径
1919
Config.set_v2ray_node_path(
2020
'/Users/Qincji/Desktop/develop/py/project/PythonIsTools/005-PaidSource/v2ray_pool') # 保存获取到节点的路径
21-
proxy_url = 'ss://[email protected]:8091#github.com/freefq%20-%20%E8%8B%B1%E5%9B%BD%20%207'
21+
proxy_url = 'ss://[email protected]:3306#github.com/freefq%20-%20%E5%8C%97%E7%BE%8E%E5%9C%B0%E5%8C%BA%20%201'
2222
dbm = DBManage()
2323
dbm.init() # 必须初始化
24-
# if dbm.check_url_single(proxy_url):
25-
# urls = dbm.load_urls_by_net(proxy_url=proxy_url)
26-
# dbm.check_and_save(urls, append=False)
27-
dbm.load_urls_and_save_auto()
24+
if dbm.check_url_single(proxy_url):
25+
urls = dbm.load_urls_by_net(proxy_url=proxy_url)
26+
dbm.check_and_save(urls, append=False)
27+
# dbm.load_urls_and_save_auto()
2828
# urls = dbm.load_unchecked_urls_by_local()
2929
# dbm.check_and_save(urls, append=False)
3030
utils.kill_all_v2ray()

006-TikTok/tikstar.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def parse_tags(page):
2323

2424

2525
if __name__ == '__main__':
26-
html = futil.read('source/tags.html')
26+
html = futil.read('tags.html')
2727
result = parse_tags(html)
2828
print(result)
29-
futil.write_json(result, 'source/handmade.json')
29+
futil.write_json(result, 'shoes.json')

006-TikTok/tt_review.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@
1010
import time
1111
from datetime import datetime
1212

13+
import file_util as futil
14+
1315
import uiautomator2 as u2
1416

1517
'''
1618
https://github.com/openatx/uiautomator2
1719
运行pip3 install -U uiautomator2 安装uiautomator2
1820
运行python3 -m uiautomator2 init安装包含httprpc服务的apk到安卓手机
1921
uiautomator2操作:https://python.iitter.com/other/35522.html
20-
借助:weditor 来获取元素
22+
借助:weditor 来获取元素,双击找控件id
2123
(注意电脑要把代理关掉)
2224
'''
2325

@@ -197,5 +199,6 @@ def print_t(content):
197199
if __name__ == "__main__":
198200
# start_vpn()
199201
# review_tiktok()
200-
review_forYou()
202+
# review_forYou()
201203
# comment('Look at my')
204+
d(resourceId="com.zhiliaoapp.musically:id/afa").click()

007-CutVideoAudio/.gitignore

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
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+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
53+
# Translations
54+
*.mo
55+
*.pot
56+
57+
# Django stuff:
58+
*.log
59+
local_settings.py
60+
db.sqlite3
61+
db.sqlite3-journal
62+
63+
# Flask stuff:
64+
instance/
65+
.webassets-cache
66+
67+
# Scrapy stuff:
68+
.scrapy
69+
70+
# Sphinx documentation
71+
docs/_build/
72+
73+
# PyBuilder
74+
target/
75+
76+
# Jupyter Notebook
77+
.ipynb_checkpoints
78+
79+
# IPython
80+
profile_default/
81+
ipython_config.py
82+
83+
# pyenv
84+
.python-version
85+
86+
# pipenv
87+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
88+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
89+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
90+
# install all needed dependencies.
91+
#Pipfile.lock
92+
93+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
94+
__pypackages__/
95+
96+
# Celery stuff
97+
celerybeat-schedule
98+
celerybeat.pid
99+
100+
# SageMath parsed files
101+
*.sage.py
102+
103+
# Environments
104+
.env
105+
.venv
106+
env/
107+
venv/
108+
ENV/
109+
env.bak/
110+
venv.bak/
111+
112+
# Spyder project settings
113+
.spyderproject
114+
.spyproject
115+
116+
# Rope project settings
117+
.ropeproject
118+
119+
# mkdocs documentation
120+
/site
121+
122+
# mypy
123+
.mypy_cache/
124+
.dmypy.json
125+
dmypy.json
126+
127+
# Pyre type checker
128+
.pyre/
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="PYTHON_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$" />
6+
<orderEntry type="inheritedJdk" />
7+
<orderEntry type="sourceFolder" forTests="false" />
8+
</component>
9+
</module>

007-CutVideoAudio/README.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# FFmpeg批量剪切音视频
2+
3+
本项目主要通过ffmpeg工具进行批量视频剪辑,随机剪辑,从而躲过自媒体平台的检查,从而达到一份视频多个账号运营。
4+
5+
使用前提:**必须要安装ffmpeg程序**,安装过程请自行百度。
6+
7+
8+
下载地址:
9+
10+
MacOS:[QincjiCut1.0.0-mac](https://github.com/xhunmon/PythonIsTools/releases/download/v1.0.4/QincjiCut1.0.0.app.zip) 下载后解压后使用
11+
12+
Window:QincjiCut1.0.0-mac (未打包)
13+
14+
效果如图:
15+
16+
![剪辑器截图](./doc/example.png)
17+
18+
#主要知识点
19+
20+
## python GUI(界面)
21+
22+
本文使用tkinter GUI(界面)框架进行界面显示:[./ui.py](ui.py)[学习参考](https://www.cnblogs.com/shwee/p/9427975.html)
23+
24+
## [pyinstaller](https://pyinstaller.readthedocs.io/en/stable/) 打包
25+
26+
使用pyinstaller把python程序打包成window和mac可执行文件,主要命令如下:
27+
```shell
28+
#① :生成xxx.spec文件;(去掉命令窗口-w)
29+
pyinstaller -F -i res/logo.ico main.py -w
30+
#②:修改xxx.spec,参考main.spec
31+
#③:再次进行打包,参考installer-mac.sh
32+
pyinstaller -F -i res/logo.ico main.spec -w
33+
```
34+
打包脚本与配置已放在 `doc` 目录下,需要拷贝出根目录进行打包。
35+
36+
注意:
37+
pyinstaller打包工具的版本与python版本、python所需第三方库以及操作系统会存在各种问题,所以需要看日志查找问题。例如:打包后运用,发现导入pyppeteer报错,通过降低版本后能正常使用:pip install pyppeteer==0.2.2
38+
39+
## 项目
40+
本项目跟Downloader下载器基本相同,而ffmpeg命令则可以通过 [](https://qincji.gitee.io/2021/01/18/ffmpeg/18_command/)
41+

007-CutVideoAudio/__init__.py

Whitespace-only changes.

007-CutVideoAudio/config.ini

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# 常用配置模块
2+
[common]
3+
#软件使用截止日期
4+
expired_time=2025/12/15 23:59:59
5+
6+
#app的版本名称
7+
version_name=1.0.0
8+
9+
#app的版本号
10+
version_code=1000

007-CutVideoAudio/doc/example.png

96.6 KB
Loading
+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
3+
4+
block_cipher = None
5+
6+
7+
a = Analysis(['main.py','type_enum.py','ui.py','utils.py','editors.py','ff_util.py','ff_cut.py'],
8+
pathex=['.'],
9+
binaries=[],
10+
datas=[('res/logo.ico', 'images'),('config.ini', '.')],
11+
hiddenimports=[],
12+
hookspath=[],
13+
hooksconfig={},
14+
runtime_hooks=[],
15+
excludes=[],
16+
win_no_prefer_redirects=False,
17+
win_private_assemblies=False,
18+
cipher=block_cipher,
19+
noarchive=False)
20+
pyz = PYZ(a.pure, a.zipped_data,
21+
cipher=block_cipher)
22+
23+
exe = EXE(pyz,
24+
a.scripts,
25+
a.binaries,
26+
a.zipfiles,
27+
a.datas,
28+
[],
29+
name='main',
30+
debug=False,
31+
bootloader_ignore_signals=False,
32+
strip=False,
33+
upx=True,
34+
upx_exclude=[],
35+
runtime_tmpdir=None,
36+
console=False,
37+
disable_windowed_traceback=False,
38+
target_arch=None,
39+
codesign_identity=None,
40+
entitlements_file=None , icon='res/logo.ico')
41+
app = BUNDLE(exe,
42+
name='QincjiCut.app',
43+
icon='res/logo.ico',
44+
bundle_identifier=None)

0 commit comments

Comments
 (0)