Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
TeaEntityLab
teaScriptUtils
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
teaScriptUtils
/
download_to_mp3
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
executable file
·
45 lines (36 loc) · 1.33 KB
master
Breadcrumbs
teaScriptUtils
/
download_to_mp3
Copy path
Top
File metadata and controls
Code
Blame
executable file
·
45 lines (36 loc) · 1.33 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# 檢查是否提供了至少兩個參數 (集數和至少一個輸入檔)
if [ "$#" -lt 2 ]; then
echo "錯誤: 未提供足夠的參數。"
echo "用法: $0 <episode-number> <input-file-1> [input-file-2] ..."
echo "範例: $0 101 video1.mp4 video2.mkv"
exit 1
fi
# 第一個參數是集數
episode_number="$1"
# 移除第一個參數,剩下的就是檔案列表
shift
# 初始化輸入檔案的索引
input_index=1
# 遍歷所有剩餘的參數 (即輸入檔案列表)
for input in "$@"; do
# # 檢查輸入檔案是否存在
# if [ ! -f "${input}" ]; then
# echo "警告: 找不到檔案 '${input}',將跳過處理。"
# continue # 跳到下一個檔案
# fi
# 設定輸出的檔名
output_filename="${episode_number}-${input_index}.mp3"
echo "----------------------------------------"
echo "正在處理檔案 #${input_index}: ${input}"
echo "輸出至 -> ${output_filename}"
echo "----------------------------------------"
# 執行 ffmpeg 指令
# -i "${input}" : 指定輸入檔案 (用引號括起來以支援包含空格的檔名)
# -vn : 忽略影片軌,只處理音訊
# "${output_filename}" : 指定輸出檔名
ffmpeg -i "${input}" -vn "${output_filename}"
# 索引加一,為下一個檔案做準備
((input_index++))
done
echo "所有檔案處理完畢。"
You can’t perform that action at this time.