CatPtain commited on
Commit
5668917
·
verified ·
1 Parent(s): f8e1a5b

Upload 5 files

Browse files
Files changed (2) hide show
  1. README.md +66 -66
  2. app.py +108 -35
README.md CHANGED
@@ -1,67 +1,67 @@
1
- ---
2
- title: MoneyPrinterTurbo
3
- emoji: 🎬
4
- colorFrom: blue
5
- colorTo: purple
6
- sdk: streamlit
7
- sdk_version: 1.45.0
8
- app_file: app.py
9
- pinned: false
10
- license: mit
11
- ---
12
-
13
- # MoneyPrinterTurbo 🎬
14
-
15
- AI驱动的短视频自动生成工具,支持自动文案生成、语音合成、视频剪辑等功能。
16
-
17
- ## 功能特点
18
-
19
- - 🤖 **AI文案生成**: 支持OpenAI、DeepSeek、Moonshot等多种LLM
20
- - 🎵 **智能语音合成**: Azure TTS、Edge TTS等多种语音服务
21
- - 🎥 **自动视频剪辑**: 从Pexels、Pixabay获取素材并智能剪辑
22
- - 📝 **字幕生成**: 自动生成和同步字幕
23
- - 🔄 **API支持**: 完整的RESTful API接口
24
-
25
- ## 快速开始
26
-
27
- ### 配置API密钥
28
-
29
- 在使用前,请在WebUI的"基础设置"中配置以下API密钥:
30
-
31
- #### 必需配置
32
- - **LLM提供商**: DeepSeek/Moonshot/OpenAI (至少选择一个)
33
- - **视频素材源**: Pexels/Pixabay (至少选择一个)
34
-
35
- #### 可选配置
36
- - **Azure Speech**: 高质量语音合成
37
- - **SiliconFlow**: 备用语音服务
38
-
39
- ### API密钥获取
40
- - DeepSeek: https://platform.deepseek.com/api_keys (推荐,国内可访问)
41
- - Moonshot: https://platform.moonshot.cn/console/api-keys (推荐,国内可访问)
42
- - Pexels: https://www.pexels.com/api/ (免费,高质量素材)
43
-
44
- ## 使用说明
45
-
46
- 1. 在左侧配置面板中设置API密钥
47
- 2. 在主界面输入视频主题
48
- 3. 调整视频参数(时长、比例、语音等)
49
- 4. 点击"开始生成"等待视频制作完成
50
-
51
- ## API调用
52
-
53
- 本应用提供完整的API接口,支持外部系统调用。详细文档请参考项目中的 `API_GUIDE.md`。
54
-
55
- ## 注意事项
56
-
57
- - 首次使用需要下载模型文件,请耐心等待
58
- - 建议生成较短的视频以节省资源
59
- - 如遇到网络问题,请检查API密钥配置
60
-
61
- ## 技术栈
62
-
63
- - **前端**: Streamlit
64
- - **后端**: FastAPI
65
- - **AI**: OpenAI、DeepSeek、Moonshot
66
- - **视频处理**: MoviePy
67
  - **语音合成**: Azure TTS、Edge TTS
 
1
+ ---
2
+ title: MoneyPrinterTurbo
3
+ emoji: 🎬
4
+ colorFrom: blue
5
+ colorTo: purple
6
+ sdk: streamlit
7
+ sdk_version: 1.45.0
8
+ app_file: app.py
9
+ pinned: false
10
+ license: mit
11
+ ---
12
+
13
+ # MoneyPrinterTurbo 🎬
14
+
15
+ AI驱动的短视频自动生成工具,支持自动文案生成、语音合成、视频剪辑等功能。
16
+
17
+ ## 功能特点
18
+
19
+ - 🤖 **AI文案生成**: 支持OpenAI、DeepSeek、Moonshot等多种LLM
20
+ - 🎵 **智能语音合成**: Azure TTS、Edge TTS等多种语音服务
21
+ - 🎥 **自动视频剪辑**: 从Pexels、Pixabay获取素材并智能剪辑
22
+ - 📝 **字幕生成**: 自动生成和同步字幕
23
+ - 🔄 **API支持**: 完整的RESTful API接口
24
+
25
+ ## 快速开始
26
+
27
+ ### 配置API密钥
28
+
29
+ 在使用前,请在WebUI的"基础设置"中配置以下API密钥:
30
+
31
+ #### 必需配置
32
+ - **LLM提供商**: DeepSeek/Moonshot/OpenAI (至少选择一个)
33
+ - **视频素材源**: Pexels/Pixabay (至少选择一个)
34
+
35
+ #### 可选配置
36
+ - **Azure Speech**: 高质量语音合成
37
+ - **SiliconFlow**: 备用语音服务
38
+
39
+ ### API密钥获取
40
+ - DeepSeek: https://platform.deepseek.com/api_keys (推荐,国内可访问)
41
+ - Moonshot: https://platform.moonshot.cn/console/api-keys (推荐,国内可访问)
42
+ - Pexels: https://www.pexels.com/api/ (免费,高质量素材)
43
+
44
+ ## 使用说明
45
+
46
+ 1. 在左侧配置面板中设置API密钥
47
+ 2. 在主界面输入视频主题
48
+ 3. 调整视频参数(时长、比例、语音等)
49
+ 4. 点击"开始生成"等待视频制作完成
50
+
51
+ ## API调用
52
+
53
+ 本应用提供完整的API接口,支持外部系统调用。详细文档请参考项目中的 `API_GUIDE.md`。
54
+
55
+ ## 注意事项
56
+
57
+ - 首次使用需要下载模型文件,请耐心等待
58
+ - 建议生成较短的视频以节省资源
59
+ - 如遇到网络问题,请检查API密钥配置
60
+
61
+ ## 技术栈
62
+
63
+ - **前端**: Streamlit
64
+ - **后端**: FastAPI
65
+ - **AI**: OpenAI、DeepSeek、Moonshot
66
+ - **视频处理**: MoviePy
67
  - **语音合成**: Azure TTS、Edge TTS
app.py CHANGED
@@ -12,81 +12,154 @@ print("🚀 Starting ultra-minimal MoneyPrinterTurbo...")
12
  os.makedirs("storage/tasks", exist_ok=True)
13
  os.makedirs("storage/temp", exist_ok=True)
14
 
15
- # Create a test HTML page instead of Streamlit
 
 
 
 
16
  test_html = """<!DOCTYPE html>
17
  <html>
18
  <head>
19
  <title>MoneyPrinterTurbo - Test Version</title>
 
20
  <style>
21
- body { font-family: Arial, sans-serif; text-align: center; padding: 50px; background: #f5f5f5; }
22
- .container { max-width: 800px; margin: 0 auto; background: white; padding: 40px; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
23
- h1 { color: #4CAF50; margin-bottom: 10px; }
24
- .subtitle { color: #666; margin-bottom: 30px; }
25
- .status { padding: 20px; background: #e8f5e8; border-radius: 8px; margin: 20px 0; border-left: 4px solid #4CAF50; }
26
- .info { padding: 15px; background: #f0f8ff; border-radius: 8px; margin: 15px 0; }
27
- .step { text-align: left; margin: 10px 0; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  .success { color: #4CAF50; font-weight: bold; }
29
  .next { color: #2196F3; }
30
  ul { text-align: left; }
31
- .footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid #eee; color: #888; font-size: 14px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  </style>
33
  </head>
34
  <body>
35
  <div class="container">
36
- <h1>🎬 MoneyPrinterTurbo</h1>
37
- <p class="subtitle">AI驱动的短视频生成工具 - 测试版本</p>
38
 
39
  <div class="status">
40
- <h2 class="success">✅ 部署测试成功!</h2>
41
- <p>恭喜!如果您看到这个页面,说明 Huggingface Spaces 基础架构运行正常。</p>
42
  </div>
43
 
44
  <div class="info">
45
- <h3>📋 测试结果</h3>
46
- <div class="step">✅ Python 环境:正常</div>
47
- <div class="step">✅ 端口配置:7860 端口访问正常</div>
48
- <div class="step">✅ 文件系统:存储目录创建成功</div>
49
- <div class="step">✅ HTTP 服务:Python 内置服务器运行正常</div>
 
50
  </div>
51
 
52
  <div class="info">
53
- <h3>🔄 下一步部署计划</h3>
54
  <ul>
55
- <li><span class="success">阶段 1</span>:零依赖测试 ✅</li>
56
- <li><span class="next">阶段 2</span>:添加 Streamlit 依赖</li>
57
- <li><span class="next">阶段 3</span>:添加核心依赖包</li>
58
- <li><span class="next">阶段 4</span>:完整功能部署</li>
59
  </ul>
60
  </div>
61
 
62
  <div class="info">
63
- <h3>📝 部署说明</h3>
64
- <p>这是一个分阶段部署策略:</p>
65
  <ul>
66
- <li><strong>当前版本</strong>:仅使用 Python 标准库,验证基础环境</li>
67
- <li><strong>优势</strong>:构建速度快,启动迅速,便于问题排查</li>
68
- <li><strong>目的</strong>:确认 HF Spaces 环境配置正确</li>
 
69
  </ul>
70
  </div>
71
 
 
 
 
 
 
 
 
 
 
 
 
72
  <div class="footer">
73
- <p>MoneyPrinterTurbo v1.2.6 | Powered by Huggingface Spaces</p>
74
- <p>测试时间: <script>document.write(new Date().toLocaleString());</script></p>
 
75
  </div>
76
  </div>
77
  </body>
78
  </html>"""
79
 
80
- # Write test HTML
81
- with open("index.html", "w", encoding="utf-8") as f:
 
82
  f.write(test_html)
83
 
84
- print("✅ Test HTML created successfully")
85
- print(f"📂 Storage directories created: storage/tasks, storage/temp")
 
 
 
 
 
 
 
86
 
87
- # Try to start a simple HTTP server instead of Streamlit
88
  try:
89
  print(f"🌐 Starting HTTP server on port 7860...")
 
 
 
 
 
 
90
  subprocess.run([
91
  sys.executable, "-m", "http.server", "7860",
92
  "--bind", "0.0.0.0"
 
12
  os.makedirs("storage/tasks", exist_ok=True)
13
  os.makedirs("storage/temp", exist_ok=True)
14
 
15
+ # Get current working directory
16
+ current_dir = os.getcwd()
17
+ print(f"📂 Current directory: {current_dir}")
18
+
19
+ # Create a test HTML page in the current directory
20
  test_html = """<!DOCTYPE html>
21
  <html>
22
  <head>
23
  <title>MoneyPrinterTurbo - Test Version</title>
24
+ <meta charset="UTF-8">
25
  <style>
26
+ body {
27
+ font-family: Arial, sans-serif;
28
+ text-align: center;
29
+ padding: 50px;
30
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
31
+ color: white;
32
+ margin: 0;
33
+ }
34
+ .container {
35
+ max-width: 800px;
36
+ margin: 0 auto;
37
+ background: rgba(255,255,255,0.95);
38
+ padding: 40px;
39
+ border-radius: 15px;
40
+ box-shadow: 0 8px 32px rgba(0,0,0,0.3);
41
+ color: #333;
42
+ }
43
+ h1 { color: #4CAF50; margin-bottom: 10px; font-size: 2.5em; }
44
+ .subtitle { color: #666; margin-bottom: 30px; font-size: 1.2em; }
45
+ .status {
46
+ padding: 20px;
47
+ background: linear-gradient(135deg, #e8f5e8, #d4edda);
48
+ border-radius: 8px;
49
+ margin: 20px 0;
50
+ border-left: 4px solid #4CAF50;
51
+ }
52
+ .info {
53
+ padding: 15px;
54
+ background: linear-gradient(135deg, #f0f8ff, #e6f3ff);
55
+ border-radius: 8px;
56
+ margin: 15px 0;
57
+ }
58
+ .step { text-align: left; margin: 10px 0; padding: 5px 0; }
59
  .success { color: #4CAF50; font-weight: bold; }
60
  .next { color: #2196F3; }
61
  ul { text-align: left; }
62
+ .footer {
63
+ margin-top: 40px;
64
+ padding-top: 20px;
65
+ border-top: 1px solid #eee;
66
+ color: #888;
67
+ font-size: 14px;
68
+ }
69
+ .pulse {
70
+ animation: pulse 2s infinite;
71
+ }
72
+ @keyframes pulse {
73
+ 0% { transform: scale(1); }
74
+ 50% { transform: scale(1.05); }
75
+ 100% { transform: scale(1); }
76
+ }
77
  </style>
78
  </head>
79
  <body>
80
  <div class="container">
81
+ <h1 class="pulse">🎬 MoneyPrinterTurbo</h1>
82
+ <p class="subtitle">AI驱动的短视频生成工具 - Huggingface Spaces 测试版本</p>
83
 
84
  <div class="status">
85
+ <h2 class="success">🎉 部署测试成功!</h2>
86
+ <p>恭喜!如果您看到这个页面,说明 Huggingface Spaces 基础架构运行完全正常。</p>
87
  </div>
88
 
89
  <div class="info">
90
+ <h3>📋 测试结果验证</h3>
91
+ <div class="step">✅ Python 环境:正常运行</div>
92
+ <div class="step">✅ 端口配置:7860 端口访问成功</div>
93
+ <div class="step">✅ 文件系统:存储目录创建完成</div>
94
+ <div class="step">✅ HTTP 服务:Python 内置服务器正常工作</div>
95
+ <div class="step">✅ HTML 渲染:页面显示功能正常</div>
96
  </div>
97
 
98
  <div class="info">
99
+ <h3>🚀 分阶段部署计划</h3>
100
  <ul>
101
+ <li><span class="success">阶段 1:零依赖测试</span> ✅ 当前完成</li>
102
+ <li><span class="next">阶段 2:Streamlit 集成</span> 🔄 准备中</li>
103
+ <li><span class="next">阶段 3:核心功能模块</span> ⏳ 待部署</li>
104
+ <li><span class="next">阶段 4:完整应用功能</span> ⏳ 待部署</li>
105
  </ul>
106
  </div>
107
 
108
  <div class="info">
109
+ <h3>📝 技术验证说明</h3>
110
+ <p><strong>测试目标</strong>:验证 Huggingface Spaces 环境的基础兼容性</p>
111
  <ul>
112
+ <li><strong>架构方案</strong>:使用 Python 标准库,无外部依赖</li>
113
+ <li><strong>性能优势</strong>:构建速度极快,启动迅速</li>
114
+ <li><strong>调试友好</strong>:便于快速定位和解决问题</li>
115
+ <li><strong>扩展性强</strong>:为后续功能模块提供稳定基础</li>
116
  </ul>
117
  </div>
118
 
119
+ <div class="info">
120
+ <h3>🔄 下一步操作</h3>
121
+ <p>既然基础测试成功,现在可以:</p>
122
+ <ol style="text-align: left;">
123
+ <li>确认这个页面正常显示</li>
124
+ <li>进入阶段2:添加 Streamlit 依赖</li>
125
+ <li>逐步集成核心功能模块</li>
126
+ <li>部署完整的视频生成功能</li>
127
+ </ol>
128
+ </div>
129
+
130
  <div class="footer">
131
+ <p><strong>MoneyPrinterTurbo v1.2.6</strong> | Powered by Huggingface Spaces</p>
132
+ <p>🕒 页面生成时间: <script>document.write(new Date().toLocaleString('zh-CN'));</script></p>
133
+ <p>🌐 服务地址: <script>document.write(window.location.href);</script></p>
134
  </div>
135
  </div>
136
  </body>
137
  </html>"""
138
 
139
+ # Write test HTML to the current directory (where HTTP server will look for it)
140
+ index_file = os.path.join(current_dir, "index.html")
141
+ with open(index_file, "w", encoding="utf-8") as f:
142
  f.write(test_html)
143
 
144
+ print(f"✅ Test HTML created at: {index_file}")
145
+ print(f"📂 Storage directories created: {current_dir}/storage/tasks, {current_dir}/storage/temp")
146
+
147
+ # Verify the file was created
148
+ if os.path.exists(index_file):
149
+ file_size = os.path.getsize(index_file)
150
+ print(f"📄 Index file size: {file_size} bytes")
151
+ else:
152
+ print("❌ Failed to create index.html file")
153
 
154
+ # Try to start a simple HTTP server
155
  try:
156
  print(f"🌐 Starting HTTP server on port 7860...")
157
+ print(f"📍 Serving files from: {current_dir}")
158
+ print(f"🔗 Access URL: http://0.0.0.0:7860/")
159
+
160
+ # Change to the current directory to ensure proper file serving
161
+ os.chdir(current_dir)
162
+
163
  subprocess.run([
164
  sys.executable, "-m", "http.server", "7860",
165
  "--bind", "0.0.0.0"