🎉 Try it now! Add our LINE Bot 🎉
CarTunes is a real-time collaborative music queue system designed for road trips, parties, or any group listening experience. Users can control playlists, add songs, and manage playback through a LINE bot and web interface - all synchronized in real-time.
- 🤖 LINE Bot Integration - Add songs by searching keywords or pasting YouTube links directly in LINE chat
- 🌐 Real-time Web Player - Beautiful web interface with live updates for all users
- 🔄 Collaborative Queue - Multiple users can add, remove, and reorder songs simultaneously
- 📱 Mobile-First Design - Optimized for use on phones during road trips or parties
- 🎵 Smart Autoplay - Automatically queues recommended songs when playlist ends
- 🏠 Room System - Create private rooms with 6-character codes to share with friends
- Click here to add CarTunes Official Account to your LINE.
- Tap on
創建房間to create a new room or加入房間to join an existing one with the RichMenu - Or directly forward a friend's room message to join instantly
- Search by typing song or artists names directly in chat
- YouTube links are also supported, just paste them in
- Use the rich menu buttons for quick controls like play/pause, skip, and more
- Click the
點擊進入網頁播放器button in RichMenu to open the synchronized web player. - You can reorder the queue, delete songs, or toggle autoplay from there.
- Python 3.13+
- Node.js 16+
- FFmpeg
- LINE Developer Account
- HTTPS domain (for LINE webhooks)
- Clone the repository
git clone https://github.com/HappyGroupHub/CarTunes.git- Backend Hosting and Config
cd CarTunes/backend
# ===== Setup python environment and install dependencies =====
# Windows
setup.bat
# Linux/Mac
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# ===== Setup config file =====
# Windows
copy config.example.yml config.yml
# Linux/Mac
cp config.example.yml config.yml
# Before you run the backend server,
# Edit config.yml to set your LINE bot credentials and other settings
# ===== Run the backend (Finish config.yml first) =====
# Windows
run.bat
# Linux/Mac
python main.py- Frontend Hosting and .ENV
cd ../frontend
npm install
cp .env.example .env.local
# Before you run the frontend server,
# Edit .env.local to set your environment variables
npm run build
npm startThe config.yml file contains all backend settings:
# LINE Bot Credentials (Required)
line_channel_access_token: 'YOUR_CHANNEL_ACCESS_TOKEN'
line_channel_secret: 'YOUR_CHANNEL_SECRET'
# Server Ports
api_endpoints_port: 5000
line_webhook_port: 5001
# Frontend URL (for rich menu links)
frontend_url: 'https://your-domain.com'
# Audio Settings
song_start_delay_seconds: 1 # Delay before playback starts
song_length_limit: 1800 # Max song length (30 minutes)
audio_quality_kbps: 96 # Audio bitrate
max_cache_size_mb: 300 # Cache size limit
cache_duration_hours: 1 # How long to keep cached audio
max_playlist_songs: 20 # Maximum songs for playlist import
# Room Settings
numeric_room_code: false # Use numbers-only room codes
pause_music_after_no_connections: 10 # Auto-pause delay
room_cleanup_after_inactivity: 120 # Room deletion timeout
# Autoplay Settings
autoplay_default: true # Enable autoplay by default
autoplay_search_engine: 'youtube_music' # or 'youtube'
# Localization (for search results)
hl_param: 'zh-TW'
gl_param: 'TW'
# Rate Limiting
action_throttle_seconds: 1
bring_to_top_throttle:
max_requests: 2
window_seconds: 5
line_message_throttle_seconds: 0.8NEXT_PUBLIC_API_BASE_URL=http://localhost:5000
NEXT_PUBLIC_WS_BASE_URL=ws://localhost:5000
NEXT_PUBLIC_LINE_BOT_URL=https://line.me/R/ti/p/@YOUR_LINE_BOTFill in your backend API URL in both NEXT_PUBLIC_API_BASE_URL and NEXT_PUBLIC_WS_BASE_URL.
Most of the time, it should be the same URL, just change http(s) to ws(s) for the WebSocket URL.
Place your LINE bot invite link in NEXT_PUBLIC_LINE_BOT_URL.
- Go to LINE Developers and login with your LINE account
- If you don't have a Business ID, simply create one by following the instructions
- Then click
Create a new provider - Fill in the required information and click
Create - Click
Create a new channeland selectMessaging API - Fill in the required information and click
Create - You can now find your channel secret in Basic settings and channel access token in Message API, click
Issueto copy it
Notes: Please make sure you've checked Allow bot to join group chats option and un-checked
Auto-reply messages in your LINE bot settings, which can be found in Messaging API >
LINE Official Account features section.
- Go to LINE Developers and login with your LINE account
- Select your channel application
- Select Messaging API, find
Webhook URLand click edit - Fill in your webhook URL and add
/callbackat the end - Click
Saveand it's pretty done! - Remember to check
Use webhookunder theWebhook URLsection
Notes: LINE webhook only works with HTTPS, so you need to use a reverse proxy to make it work. If you don't know how to create a reverse proxy, you can use ngrok or cloudflared to create one easily.
We welcome contributions! Please feel free to submit pull requests or open issues for bugs and feature requests.
This project is for educational and personal use only. Users are responsible for complying with all applicable laws and terms of service when using CarTunes. The developers are not liable for any misuse of this software or copyright infringement. Please respect intellectual property rights and use this software responsibly.
For full disclaimer, see DISCLAIMER.md.
This project is licensed under the AGPL-3.0 License - see the LICENSE file for details.
CarTunes 是一個即時協作音樂播放系統,專為公路旅行、派對或任何團體聆聽體驗而設計。使用者可以透過 LINE 機器人和網頁介面控制播放清單、新增歌曲和管理播放 - 全部即時同步。
- 🤖 LINE Bot 整合 - 透過搜尋關鍵字或直接貼上 YouTube 連結來新增歌曲
- 🌐 即時網頁播放器 - 美觀的網頁介面,所有使用者都能看到即時更新
- 🔄 協作播放清單 - 多位使用者可以同時新增、刪除和重新排序歌曲
- 📱 行動優先設計 - 針對旅途或派對中的手機使用進行最佳化
- 🎵 智慧自動播放 - 播放清單結束時自動加入推薦歌曲
- 🏠 房間系統 - 建立私人房間,使用 6 字元代碼與朋友分享
- 點擊這裡將 CarTunes 官方帳號加入您的 LINE。
- 在 RichMenu 中點選
創建房間來建立新房間,或點選加入房間來加入現有房間 - 或直接轉發朋友的房間訊息立即加入
- 直接在聊天室中輸入歌曲或歌手名稱來搜尋
- 也支援 YouTube 連結,直接貼上即可
- 使用 Rich Menu 按鈕快速控制播放/暫停、跳過等功能
- 點擊 RichMenu 中的
點擊進入網頁播放器按鈕來開啟同步的網頁播放器 - 您可以在此重新排序播放清單、刪除歌曲或切換自動播放
- Python 3.13+
- Node.js 16+
- FFmpeg
- LINE 開發者帳號
- HTTPS 網域(用於 LINE webhooks)
- 複製儲存庫
git clone https://github.com/HappyGroupHub/CarTunes.git- 後端架設與設定
cd CarTunes/backend
# ===== 設定 Python 環境並安裝相依套件 =====
# Windows
setup.bat
# Linux/Mac
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# ===== 設定 config 檔案 =====
# Windows
copy config.example.yml config.yml
# Linux/Mac
cp config.example.yml config.yml
# 在執行後端伺服器前
# 編輯 config.yml 來設定您的 LINE bot 憑證和其他設定
# ===== 執行後端(先完成 config.yml 設定)=====
# Windows
run.bat
# Linux/Mac
python main.py- 前端架設與 .ENV 設定
cd ../frontend
npm install
cp .env.example .env.local
# 在執行前端伺服器前
# 編輯 .env.local 來設定您的環境變數
npm run build
npm startconfig.yml 檔案包含所有後端設定:
# LINE Bot 憑證(必填)
line_channel_access_token: 'YOUR_CHANNEL_ACCESS_TOKEN'
line_channel_secret: 'YOUR_CHANNEL_SECRET'
# 伺服器連接埠
api_endpoints_port: 5000
line_webhook_port: 5001
# 前端網址(用於 Rich Menu 連結)
frontend_url: 'https://your-domain.com'
# 音訊設定
song_start_delay_seconds: 1 # 播放開始前的延遲
song_length_limit: 1800 # 最長歌曲長度(30 分鐘)
audio_quality_kbps: 96 # 音訊位元率
max_cache_size_mb: 300 # 快取大小限制
cache_duration_hours: 1 # 保留快取音訊的時間
max_playlist_songs: 20 # 播放清單匯入的最大歌曲數量
# 房間設定
numeric_room_code: false # 使用純數字房間代碼
pause_music_after_no_connections: 10 # 自動暫停延遲
room_cleanup_after_inactivity: 120 # 房間刪除逾時
# 自動播放設定
autoplay_default: true # 預設啟用自動播放
autoplay_search_engine: 'youtube_music' # 或 'youtube'
# 本地化(用於搜尋結果)
hl_param: 'zh-TW'
gl_param: 'TW'
# 速率限制
action_throttle_seconds: 1
bring_to_top_throttle:
max_requests: 2
window_seconds: 5
line_message_throttle_seconds: 0.8NEXT_PUBLIC_API_BASE_URL=http://localhost:5000
NEXT_PUBLIC_WS_BASE_URL=ws://localhost:5000
NEXT_PUBLIC_LINE_BOT_URL=https://line.me/R/ti/p/@YOUR_LINE_BOT在 NEXT_PUBLIC_API_BASE_URL 和 NEXT_PUBLIC_WS_BASE_URL 中填入您的後端 API URL。
大多數情況下應該是相同的 URL,只需將 http(s) 改為 ws(s) 用於 WebSocket URL。
在 NEXT_PUBLIC_LINE_BOT_URL 中放置您的 LINE bot 邀請連結。
- 前往 LINE Developers 並使用您的 LINE 帳號登入
- 如果您沒有 Business ID,只需按照說明建立一個
- 然後點擊
Create a new provider - 填寫必要資訊並點擊
Create - 點擊
Create a new channel並選擇Messaging API - 填寫必要資訊並點擊
Create - 現在您可以在 Basic settings 中找到 channel secret,在 Messaging API 中找到 channel access token,點擊
Issue來複製
注意事項:請確保您已經勾選了 Allow bot to join group chats 選項,並取消勾選
Auto-reply messages,這些設定可以在 Messaging API > LINE Official Account features 部分找到。
- 前往 LINE Developers 並使用您的 LINE 帳號登入
- 選擇您的頻道應用程式
- 選擇 Messaging API,找到
Webhook URL並點擊編輯 - 填入您的 webhook URL 並在結尾加上
/callback - 點擊
Save就完成了! - 記得在
Webhook URL部分下方勾選Use webhook
注意事項:LINE webhook 只能使用 HTTPS,所以您需要使用反向代理來讓它運作。如果您不知道如何建立反向代理, 可以使用 ngrok 或 cloudflared 輕鬆建立。
我們歡迎貢獻!請隨時提交 pull request 或為錯誤和功能請求開啟 issues。
本專案僅供教育和個人使用。使用 CarTunes 時,使用者需自行負責遵守所有適用的法律和服務條款。開發者對於本軟體的任何濫用或版權侵權行為概不負責。請尊重智慧財產權並負責任地使用本軟體。
完整免責聲明請參閱 DISCLAIMER.md。
本專案採用 AGPL-3.0 授權 - 詳細資訊請參閱 LICENSE 檔案。
