-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-small.sh
More file actions
275 lines (215 loc) · 6.18 KB
/
Copy pathsetup-small.sh
File metadata and controls
275 lines (215 loc) · 6.18 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
#!/data/data/com.termux/files/usr/bin/bash
echo "Starting Termux Setup install software..."
# Server
termux-change-repo
# update
yes | pkg update && yes | pkg upgrade
# Install packages
yes | pkg install python ffmpeg git tmux wget unzip php fish nodejs net-tools nano deno -y
yes | pkg install tur-repo -y
yes | pkg install ollama -y
yes | pkg install jq -y
yes | pkg install iproute2 -y
# Install pip tools
pip install --upgrade pip
pip install flask yt-dlp pyftpdlib
pip install -U yt-dlp
# Fix fish config folder (important)
mkdir -p ~/.config/fish
# Set fish shell (safe)
chsh -s fish || echo "⚠️ Cannot change shell (ignore if error)"
# Fix PATH
grep -qxF 'set -U fish_user_paths $fish_user_paths $HOME' ~/.config/fish/config.fish || \
echo 'set -U fish_user_paths $fish_user_paths $HOME' >> ~/.config/fish/config.fish
# ---------------- VIDEO SCRIPT ----------------
cat > ~/video.sh << 'EOF'
#!/data/data/com.termux/files/usr/bin/bash
DOWNLOAD_FOLDER="/storage/emulated/0/Movies"
mkdir -p "$DOWNLOAD_FOLDER"
echo "🎬 Multi Video Downloader (CTRL+C to exit)"
while true; do
read -p "Enter video URL: " url
if [[ -z "$url" ]]; then
echo "⚠️ No URL entered"
continue
fi
echo "⬇️ Downloading $url ..."
yt-dlp \
-f "bestvideo[height<=720][ext=mp4][fps<=60]+bestaudio[ext=m4a]/mp4" \
--merge-output-format mp4 \
-S "vcodec:h264,lang,quality,res,fps,hdr:12,acodec:aac" \
-o "$DOWNLOAD_FOLDER/%(title).80s.%(ext)s" \
"$url" &
echo "✅ Started!"
done
EOF
chmod +x ~/video.sh
# ---------------- AUDIO SCRIPT ----------------
cat > ~/song.sh << 'EOF'
#!/data/data/com.termux/files/usr/bin/bash
DOWNLOAD_FOLDER="/storage/emulated/0/Music"
mkdir -p "$DOWNLOAD_FOLDER"
echo "🎵 Multi Audio Downloader (CTRL+C to exit)"
while true; do
read -p "Enter video URL: " url
if [[ -z "$url" ]]; then
echo "⚠️ No URL entered"
continue
fi
echo "⬇️ Downloading audio..."
yt-dlp -x \
--audio-format mp3 \
--audio-quality 256k \
--embed-thumbnail \
--add-metadata \
-o "$DOWNLOAD_FOLDER/%(title).80s.%(ext)s" "$url" &
echo "🎧 Started!"
done
EOF
chmod +x ~/song.sh
# ---------------- FTP SERVER ----------------
cat > ~/ftp.sh << 'EOF'
#!/data/data/com.termux/files/usr/bin/bash
cd /storage/emulated/0 || exit
echo "📡 FTP Server Running"
echo "Port: 2121"
echo "User: user | Password: 12345"
python -m pyftpdlib -p 2121 -u user -P 12345 -d /storage/emulated/0 -w
EOF
chmod +x ~/ftp.sh
## Movie and Song
cat > ~/mv.sh << 'EOF'
#!/data/data/com.termux/files/usr/bin/bash
# Folder
VIDEO_FOLDER="/storage/emulated/0/Movies"
AUDIO_FOLDER="/storage/emulated/0/Music"
mkdir -p "$VIDEO_FOLDER"
mkdir -p "$AUDIO_FOLDER"
clear
echo "=========================================="
echo " 🚀 Downloader MV (MP4 & MP3)"
echo "=========================================="
while true; do
echo ""
read -p "🔗 URL video (CTRL+C to exit): " url
if [[ -z "$url" ]]; then
echo "⚠️ Please enter a link!"
continue
fi
echo "⏳ Downloading..."
# 🎬 Video MP4
yt-dlp \
-f "bestvideo[height<=720][ext=mp4][fps<=60]+bestaudio[ext=m4a]/mp4" \
--merge-output-format mp4 \
-S "vcodec:h264,lang,quality,res,fps,hdr:12,acodec:aac" \
-o "$VIDEO_FOLDER/%(title).80s.%(ext)s" \
"$url" &
# 🎧 Audio MP3
yt-dlp -x \
--audio-format mp3 \
--audio-quality 256k \
--embed-thumbnail \
--add-metadata \
-o "$AUDIO_FOLDER/%(title).80s.%(ext)s" \
"$url" &
echo "✅ Download started in background"
echo " 🎬 Video -> $VIDEO_FOLDER"
echo " 🎧 Audio -> $AUDIO_FOLDER"
done
EOF
chmod +x mv.sh
## Ai local Gemma
cat > ~/ai.sh << 'EOF'
#!/data/data/com.termux/files/usr/bin/bash
# ==========================================
# 🤖 Local AI Launcher for Ollama
# 📱 Android + Termux
# ==========================================
clear
# Check Ollama
if ! command -v ollama &> /dev/null; then
echo "❌ Ollama not installed!"
echo "Install first:"
echo "pkg install ollama"
exit 1
fi
# Start Ollama Server
echo "🚀 Starting Ollama Server..."
ollama serve > /dev/null 2>&1 &
sleep 3
while true
do
clear
echo "=================================="
echo " 🤖 LOCAL AI SELECT MENU"
echo "=================================="
echo ""
echo "1. Qwen2.5 3B"
echo "2. Gemma2 2B"
echo "3. Phi4 Mini"
echo "4. Llama3.2 3B"
echo "5. Qwen2.5 Coder 1.5B"
echo "6. Install All Models"
echo "0. Exit"
echo ""
read -p "📌 Select AI: " choice
case $choice in
1)
clear
echo "🧠 Running Qwen2.5 3B..."
ollama run qwen2.5:3b
;;
2)
clear
echo "⚡ Running Gemma2 2B..."
ollama run gemma2:2b
;;
3)
clear
echo "🔥 Running Phi4 Mini..."
ollama run phi4-mini
;;
4)
clear
echo "🌐 Running Llama3.2 3B..."
ollama run llama3.2:3b
;;
5)
clear
echo "💻 Running Qwen2.5 Coder..."
ollama run qwen2.5-coder:1.5b
;;
6)
clear
echo "📦 Installing Models..."
ollama pull qwen2.5:3b
ollama pull gemma2:2b
ollama pull phi4-mini
ollama pull llama3.2:3b
ollama pull qwen2.5-coder:1.5b
echo ""
echo "✅ All Models Installed!"
read -p "Press Enter..."
;;
0)
echo "👋 Bye!"
exit
;;
*)
echo "❌ Invalid choice!"
sleep 2
;;
esac
done
EOF
chmod +x ai.sh
## hi
echo ""
echo "✅ Setup Complete!"
echo "--------------------------------"
echo "Commands (use this to run script files)"
echo "video.sh → Download videos 🎬"
echo "song.sh → Download audio 🎵"
echo "ftp.sh → Start FTP server 📡"
echo "mv.sh → Download video and song one time"
echo "ai.sh → Ai Run Local"