Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,58 +1,377 @@
|
|
1 |
import gradio as gr
|
2 |
import subprocess
|
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
import subprocess
|
3 |
|
4 |
+
def list_available_formats(url):
|
5 |
+
command = f'yt-dlp -F "{url}"'
|
6 |
+
return run_command(command)
|
7 |
+
|
8 |
+
def download_mp3_max_quality(url):
|
9 |
+
command = f'yt-dlp -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 --postprocessor-args "-b:a 320k" -o "P:/Local Music/%(title)s.%(ext)s" "{url}"'
|
10 |
+
return run_command(command)
|
11 |
+
|
12 |
+
def basic_high_quality_mp3_download(url):
|
13 |
+
command = f'yt-dlp -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 -o "P:/Local Music/%(title)s.%(ext)s" "{url}"'
|
14 |
+
return run_command(command)
|
15 |
+
|
16 |
+
def download_custom_bitrate(url, bitrate):
|
17 |
+
command = f'yt-dlp -f bestaudio --extract-audio --audio-format mp3 --postprocessor-args "-b:a {bitrate}k" -o "P:/Local Music/%(title)s.%(ext)s" "{url}"'
|
18 |
+
return run_command(command)
|
19 |
+
|
20 |
+
def download_and_add_metadata_tags(url):
|
21 |
+
command = f'yt-dlp -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 --embed-metadata -o "P:/Local Music/%(title)s.%(ext)s" "{url}"'
|
22 |
+
return run_command(command)
|
23 |
+
|
24 |
+
def download_entire_playlist(url):
|
25 |
+
command = f'yt-dlp -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 -o "P:/Local Music/%(playlist_title)s/%(title)s.%(ext)s" "{url}"'
|
26 |
+
return run_command(command)
|
27 |
+
|
28 |
+
def download_playlist_specific_range(url, start, end):
|
29 |
+
command = f'yt-dlp --playlist-items {start}-{end} -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 -o "P:/Local Music/%(playlist_title)s/%(title)s.%(ext)s" "{url}"'
|
30 |
+
return run_command(command)
|
31 |
+
|
32 |
+
def download_hq_from_soundcloud(url):
|
33 |
+
command = f'yt-dlp -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 -o "P:/Local Music/SoundCloud/%(uploader)s - %(title)s.%(ext)s" "{url}"'
|
34 |
+
return run_command(command)
|
35 |
+
|
36 |
+
def embed_album_art_automatically(url):
|
37 |
+
command = f'yt-dlp -f bestaudio --extract-audio --audio-format mp3 --embed-thumbnail --audio-quality 0 -o "P:/Local Music/%(title)s.%(ext)s" "{url}"'
|
38 |
+
return run_command(command)
|
39 |
+
|
40 |
+
def download_specific_formats(url, format):
|
41 |
+
command = f'yt-dlp -f bestaudio --extract-audio --audio-format {format} -o "P:/Local Music/%(title)s.%(ext)s" "{url}"'
|
42 |
+
return run_command(command)
|
43 |
+
|
44 |
+
def skip_already_downloaded_files(url):
|
45 |
+
command = f'yt-dlp --download-archive "P:/Local Music/downloaded.txt" -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 -o "P:/Local Music/%(title)s.%(ext)s" "{url}"'
|
46 |
+
return run_command(command)
|
47 |
+
|
48 |
+
def download_multiple_individual_files(urls):
|
49 |
+
command = f'yt-dlp -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 --add-metadata --embed-thumbnail --write-description --postprocessor-args "-b:a 320k" -o "P:/Local Music/%(title)s.%(ext)s" {" ".join(urls)}'
|
50 |
+
return run_command(command)
|
51 |
+
|
52 |
+
def download_and_automatically_split_by_chapters(url):
|
53 |
+
command = f'yt-dlp -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 --split-chapters -o "P:/Local Music/%(title)s.%(ext)s" "{url}"'
|
54 |
+
return run_command(command)
|
55 |
+
|
56 |
+
def extract_only_a_portion_of_a_video(url, start_time, end_time):
|
57 |
+
command = f'yt-dlp -f bestvideo+bestaudio --external-downloader ffmpeg --external-downloader-args "ffmpeg_i:-ss {start_time} -to {end_time}" -o "P:/Local Music/%(title)s.%(ext)s" "{url}"'
|
58 |
+
return run_command(command)
|
59 |
+
|
60 |
+
def update_metadata_of_existing_files(url):
|
61 |
+
command = f'yt-dlp --download-archive "P:/Local Music/downloaded.txt" --skip-download --embed-metadata --embed-thumbnail --write-description "{url}"'
|
62 |
+
return run_command(command)
|
63 |
+
|
64 |
+
def auto_rename_duplicate_files(url):
|
65 |
+
command = f'yt-dlp -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 --force-overwrites -o "P:/Local Music/%(title)s.%(ext)s" "{url}"'
|
66 |
+
return run_command(command)
|
67 |
+
|
68 |
+
def download_from_url_list_file(file_path):
|
69 |
+
command = f'yt-dlp -a "{file_path}" -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 -o "P:/Local Music/%(title)s.%(ext)s"'
|
70 |
+
return run_command(command)
|
71 |
+
|
72 |
+
def download_and_limit_download_speed(url, speed):
|
73 |
+
command = f'yt-dlp -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 --rate-limit {speed} -o "P:/Local Music/%(title)s.%(ext)s" "{url}"'
|
74 |
+
return run_command(command)
|
75 |
+
|
76 |
+
def download_from_vimeo(url):
|
77 |
+
command = f'yt-dlp -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 -o "P:/Local Music/Vimeo/%(uploader)s - %(title)s.%(ext)s" "{url}"'
|
78 |
+
return run_command(command)
|
79 |
+
|
80 |
+
def download_from_facebook(url):
|
81 |
+
command = f'yt-dlp -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 -o "P:/Local Music/Facebook/%(uploader)s - %(title)s.%(ext)s" "{url}"'
|
82 |
+
return run_command(command)
|
83 |
+
|
84 |
+
def download_from_instagram(url):
|
85 |
+
command = f'yt-dlp -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 -o "P:/Local Music/Instagram/%(uploader)s - %(title)s.%(ext)s" "{url}"'
|
86 |
+
return run_command(command)
|
87 |
+
|
88 |
+
def download_from_twitter(url):
|
89 |
+
command = f'yt-dlp -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 -o "P:/Local Music/Twitter/%(uploader)s - %(title)s.%(ext)s" "{url}"'
|
90 |
+
return run_command(command)
|
91 |
+
|
92 |
+
def download_from_tiktok(url):
|
93 |
+
command = f'yt-dlp -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 -o "P:/Local Music/TikTok/%(uploader)s - %(title)s.%(ext)s" "{url}"'
|
94 |
+
return run_command(command)
|
95 |
+
|
96 |
+
def download_from_reddit(url):
|
97 |
+
command = f'yt-dlp -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 -o "P:/Local Music/Reddit/%(uploader)s - %(title)s.%(ext)s" "{url}"'
|
98 |
+
return run_command(command)
|
99 |
+
|
100 |
+
def download_from_dailymotion(url):
|
101 |
+
command = f'yt-dlp -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 -o "P:/Local Music/Dailymotion/%(uploader)s - %(title)s.%(ext)s" "{url}"'
|
102 |
+
return run_command(command)
|
103 |
+
|
104 |
+
def download_youtube_transcript_as_text(url):
|
105 |
+
command = f'yt-dlp --write-auto-subs --sub-lang en --skip-download -o "P:/Local Music/%(title)s.%(ext)s" "{url}"'
|
106 |
+
return run_command(command)
|
107 |
+
|
108 |
+
def download_youtube_transcript_as_markdown(url):
|
109 |
+
command = f'yt-dlp --write-auto-subs --sub-lang en --skip-download --convert-subs srt -o "P:/Local Music/%(title)s.md" "{url}"'
|
110 |
+
return run_command(command)
|
111 |
+
|
112 |
+
def download_video_info_and_save_as_json(url):
|
113 |
+
command = f'yt-dlp --write-info-json --skip-download -o "P:/Local Music/%(title)s.json" "{url}"'
|
114 |
+
return run_command(command)
|
115 |
+
|
116 |
+
def list_available_formats_without_downloading(url):
|
117 |
+
command = f'yt-dlp -F "{url}"'
|
118 |
+
return run_command(command)
|
119 |
+
|
120 |
+
def download_from_youtube_age_restricted_content(url, email, password):
|
121 |
+
command = f'yt-dlp --username "{email}" --password "{password}" -f bestvideo+bestaudio -o "P:/Local Music/%(title)s.%(ext)s" "{url}"'
|
122 |
+
return run_command(command)
|
123 |
+
|
124 |
+
def run_command(command):
|
125 |
+
result = subprocess.run(command, shell=True, capture_output=True, text=True)
|
126 |
+
return result.stdout + result.stderr
|
127 |
+
|
128 |
+
with gr.Blocks() as demo:
|
129 |
+
gr.Markdown("## YT-DLP Commands via Gradio")
|
130 |
+
|
131 |
+
with gr.Tab("General Commands"):
|
132 |
+
with gr.Row():
|
133 |
+
url_input = gr.Textbox(label="URL")
|
134 |
+
list_formats_btn = gr.Button("List Available Formats")
|
135 |
+
list_formats_btn.click(list_available_formats, inputs=url_input, outputs=gr.Textbox())
|
136 |
+
|
137 |
+
with gr.Row():
|
138 |
+
url_input_mp3 = gr.Textbox(label="URL")
|
139 |
+
download_mp3_btn = gr.Button("Download MP3 at Max Quality")
|
140 |
+
download_mp3_btn.click(download_mp3_max_quality, inputs=url_input_mp3, outputs=gr.Textbox())
|
141 |
+
|
142 |
+
with gr.Row():
|
143 |
+
url_input_basic = gr.Textbox(label="URL")
|
144 |
+
basic_mp3_btn = gr.Button("Basic High-Quality MP3 Download")
|
145 |
+
basic_mp3_btn.click(basic_high_quality_mp3_download, inputs=url_input_basic, outputs=gr.Textbox())
|
146 |
+
|
147 |
+
with gr.Row():
|
148 |
+
url_input_custom = gr.Textbox(label="URL")
|
149 |
+
bitrate_input = gr.Textbox(label="Bitrate (e.g., 192)")
|
150 |
+
custom_bitrate_btn = gr.Button("Download Custom Bitrate")
|
151 |
+
custom_bitrate_btn.click(download_custom_bitrate, inputs=[url_input_custom, bitrate_input], outputs=gr.Textbox())
|
152 |
+
|
153 |
+
with gr.Row():
|
154 |
+
url_input_metadata = gr.Textbox(label="URL")
|
155 |
+
metadata_btn = gr.Button("Download and Add Metadata Tags")
|
156 |
+
metadata_btn.click(download_and_add_metadata_tags, inputs=url_input_metadata, outputs=gr.Textbox())
|
157 |
+
|
158 |
+
with gr.Row():
|
159 |
+
url_input_playlist = gr.Textbox(label="Playlist URL")
|
160 |
+
playlist_btn = gr.Button("Download Entire Playlist")
|
161 |
+
playlist_btn.click(download_entire_playlist, inputs=url_input_playlist, outputs=gr.Textbox())
|
162 |
+
|
163 |
+
with gr.Row():
|
164 |
+
url_input_playlist_range = gr.Textbox(label="Playlist URL")
|
165 |
+
start_input = gr.Textbox(label="Start Index")
|
166 |
+
end_input = gr.Textbox(label="End Index")
|
167 |
+
playlist_range_btn = gr.Button("Download Playlist (Specific Range)")
|
168 |
+
playlist_range_btn.click(download_playlist_specific_range, inputs=[url_input_playlist_range, start_input, end_input], outputs=gr.Textbox())
|
169 |
+
|
170 |
+
with gr.Row():
|
171 |
+
url_input_soundcloud = gr.Textbox(label="SoundCloud Track URL")
|
172 |
+
soundcloud_btn = gr.Button("Download HQ from SoundCloud")
|
173 |
+
soundcloud_btn.click(download_hq_from_soundcloud, inputs=url_input_soundcloud, outputs=gr.Textbox())
|
174 |
+
|
175 |
+
with gr.Row():
|
176 |
+
url_input_album_art = gr.Textbox(label="URL")
|
177 |
+
album_art_btn = gr.Button("Embed Album Art Automatically")
|
178 |
+
album_art_btn.click(embed_album_art_automatically, inputs=url_input_album_art, outputs=gr.Textbox())
|
179 |
+
|
180 |
+
with gr.Row():
|
181 |
+
url_input_specific_format = gr.Textbox(label="URL")
|
182 |
+
format_input = gr.Textbox(label="Format (e.g., opus)")
|
183 |
+
specific_format_btn = gr.Button("Download Specific Formats")
|
184 |
+
specific_format_btn.click(download_specific_formats, inputs=[url_input_specific_format, format_input], outputs=gr.Textbox())
|
185 |
+
|
186 |
+
with gr.Row():
|
187 |
+
url_input_skip = gr.Textbox(label="URL")
|
188 |
+
skip_btn = gr.Button("Skip Already Downloaded Files")
|
189 |
+
skip_btn.click(skip_already_downloaded_files, inputs=url_input_skip, outputs=gr.Textbox())
|
190 |
+
|
191 |
+
with gr.Row():
|
192 |
+
urls_input = gr.Textbox(label="URLs (space-separated)")
|
193 |
+
multiple_files_btn = gr.Button("Download Multiple Individual Files")
|
194 |
+
multiple_files_btn.click(download_multiple_individual_files, inputs=urls_input, outputs=gr.Textbox())
|
195 |
+
|
196 |
+
with gr.Row():
|
197 |
+
url_input_chapters = gr.Textbox(label="URL")
|
198 |
+
chapters_btn = gr.Button("Download and Automatically Split by Chapters")
|
199 |
+
chapters_btn.click(download_and_automatically_split_by_chapters, inputs=url_input_chapters, outputs=gr.Textbox())
|
200 |
+
|
201 |
+
with gr.Row():
|
202 |
+
url_input_portion = gr.Textbox(label="URL")
|
203 |
+
start_time_input = gr.Textbox(label="Start Time (e.g., 00:01:00)")
|
204 |
+
end_time_input = gr.Textbox(label="End Time (e.g., 00:05:00)")
|
205 |
+
portion_btn = gr.Button("Extract Only a Portion of a Video")
|
206 |
+
portion_btn.click(extract_only_a_portion_of_a_video, inputs=[url_input_portion, start_time_input, end_time_input], outputs=gr.Textbox())
|
207 |
+
|
208 |
+
with gr.Row():
|
209 |
+
url_input_metadata_update = gr.Textbox(label="URL")
|
210 |
+
metadata_update_btn = gr.Button("Update Metadata of Existing Files")
|
211 |
+
metadata_update_btn.click(update_metadata_of_existing_files, inputs=url_input_metadata_update, outputs=gr.Textbox())
|
212 |
+
|
213 |
+
with gr.Row():
|
214 |
+
url_input_rename = gr.Textbox(label="URL")
|
215 |
+
rename_btn = gr.Button("Auto-Rename Duplicate Files")
|
216 |
+
rename_btn.click(auto_rename_duplicate_files, inputs=url_input_rename, outputs=gr.Textbox())
|
217 |
+
|
218 |
+
with gr.Row():
|
219 |
+
file_path_input = gr.Textbox(label="File Path")
|
220 |
+
url_list_btn = gr.Button("Download from URL List File")
|
221 |
+
url_list_btn.click(download_from_url_list_file, inputs=file_path_input, outputs=gr.Textbox())
|
222 |
+
|
223 |
+
with gr.Row():
|
224 |
+
url_input_speed = gr.Textbox(label="URL")
|
225 |
+
speed_input = gr.Textbox(label="Speed (e.g., 1M)")
|
226 |
+
speed_btn = gr.Button("Download and Limit Download Speed")
|
227 |
+
speed_btn.click(download_and_limit_download_speed, inputs=[url_input_speed, speed_input], outputs=gr.Textbox())
|
228 |
+
|
229 |
+
with gr.Row():
|
230 |
+
url_input_vimeo = gr.Textbox(label="Vimeo Video URL")
|
231 |
+
vimeo_btn = gr.Button("Download from Vimeo")
|
232 |
+
vimeo_btn.click(download_from_vimeo, inputs=url_input_vimeo, outputs=gr.Textbox())
|
233 |
+
|
234 |
+
with gr.Row():
|
235 |
+
url_input_facebook = gr.Textbox(label="Facebook Video URL")
|
236 |
+
facebook_btn = gr.Button("Download from Facebook")
|
237 |
+
facebook_btn.click(download_from_facebook, inputs=url_input_facebook, outputs=gr.Textbox())
|
238 |
+
|
239 |
+
with gr.Row():
|
240 |
+
url_input_instagram = gr.Textbox(label="Instagram Video URL")
|
241 |
+
instagram_btn = gr.Button("Download from Instagram")
|
242 |
+
instagram_btn.click(download_from_instagram, inputs=url_input_instagram, outputs=gr.Textbox())
|
243 |
+
|
244 |
+
with gr.Row():
|
245 |
+
url_input_twitter = gr.Textbox(label="Twitter Video URL")
|
246 |
+
twitter_btn = gr.Button("Download from Twitter")
|
247 |
+
twitter_btn.click(download_from_twitter, inputs=url_input_twitter, outputs=gr.Textbox())
|
248 |
+
|
249 |
+
with gr.Row():
|
250 |
+
url_input_tiktok = gr.Textbox(label="TikTok Video URL")
|
251 |
+
tiktok_btn = gr.Button("Download from TikTok")
|
252 |
+
tiktok_btn.click(download_from_tiktok, inputs=url_input_tiktok, outputs=gr.Textbox())
|
253 |
+
|
254 |
+
with gr.Row():
|
255 |
+
url_input_reddit = gr.Textbox(label="Reddit Video URL")
|
256 |
+
reddit_btn = gr.Button("Download from Reddit")
|
257 |
+
reddit_btn.click(download_from_reddit, inputs=url_input_reddit, outputs=gr.Textbox())
|
258 |
+
|
259 |
+
with gr.Row():
|
260 |
+
url_input_dailymotion = gr.Textbox(label="Dailymotion Video URL")
|
261 |
+
dailymotion_btn = gr.Button("Download from Dailymotion")
|
262 |
+
dailymotion_btn.click(download_from_dailymotion, inputs=url_input_dailymotion, outputs=gr.Textbox())
|
263 |
+
|
264 |
+
with gr.Row():
|
265 |
+
url_input_transcript_text = gr.Textbox(label="YouTube Video URL")
|
266 |
+
transcript_text_btn = gr.Button("Download YouTube Transcript as Text")
|
267 |
+
transcript_text_btn.click(download_youtube_transcript_as_text, inputs=url_input_transcript_text, outputs=gr.Textbox())
|
268 |
+
|
269 |
+
with gr.Row():
|
270 |
+
url_input_transcript_md = gr.Textbox(label="YouTube Video URL")
|
271 |
+
transcript_md_btn = gr.Button("Download YouTube Transcript as Markdown")
|
272 |
+
transcript_md_btn.click(download_youtube_transcript_as_markdown, inputs=url_input_transcript_md, outputs=gr.Textbox())
|
273 |
+
|
274 |
+
with gr.Row():
|
275 |
+
url_input_video_info = gr.Textbox(label="YouTube Video URL")
|
276 |
+
video_info_btn = gr.Button("Download Video Info and Save as JSON")
|
277 |
+
video_info_btn.click(download_video_info_and_save_as_json, inputs=url_input_video_info, outputs=gr.Textbox())
|
278 |
+
|
279 |
+
with gr.Row():
|
280 |
+
url_input_list_formats = gr.Textbox(label="YouTube Video URL")
|
281 |
+
list_formats_without_downloading_btn = gr.Button("List Available Formats without Downloading")
|
282 |
+
list_formats_without_downloading_btn.click(list_available_formats_without_downloading, inputs=url_input_list_formats, outputs=gr.Textbox())
|
283 |
+
|
284 |
+
with gr.Row():
|
285 |
+
url_input_age_restricted = gr.Textbox(label="Age-Restricted Video URL")
|
286 |
+
email_input = gr.Textbox(label="Your YouTube Email")
|
287 |
+
password_input = gr.Textbox(label="Your Password", type="password")
|
288 |
+
age_restricted_btn = gr.Button("Download from YouTube Age-Restricted Content")
|
289 |
+
age_restricted_btn.click(download_from_youtube_age_restricted_content, inputs=[url_input_age_restricted, email_input, password_input], outputs=gr.Textbox())
|
290 |
+
|
291 |
+
with gr.Tab("SoundCloud Commands"):
|
292 |
+
with gr.Row():
|
293 |
+
url_input_soundcloud_formats = gr.Textbox(label="SoundCloud URL")
|
294 |
+
soundcloud_formats_btn = gr.Button("List Available Formats")
|
295 |
+
soundcloud_formats_btn.click(list_available_formats, inputs=url_input_soundcloud_formats, outputs=gr.Textbox())
|
296 |
+
|
297 |
+
with gr.Row():
|
298 |
+
url_input_soundcloud_hq = gr.Textbox(label="SoundCloud Track URL")
|
299 |
+
soundcloud_hq_btn = gr.Button("Download High-Quality MP3 from SoundCloud")
|
300 |
+
soundcloud_hq_btn.click(download_hq_from_soundcloud, inputs=url_input_soundcloud_hq, outputs=gr.Textbox())
|
301 |
+
|
302 |
+
with gr.Row():
|
303 |
+
url_input_soundcloud_metadata = gr.Textbox(label="SoundCloud Track URL")
|
304 |
+
soundcloud_metadata_btn = gr.Button("Download HQ with Metadata from SoundCloud")
|
305 |
+
soundcloud_metadata_btn.click(download_hq_from_soundcloud, inputs=url_input_soundcloud_metadata, outputs=gr.Textbox())
|
306 |
+
|
307 |
+
with gr.Row():
|
308 |
+
url_input_soundcloud_playlist = gr.Textbox(label="SoundCloud Playlist URL")
|
309 |
+
soundcloud_playlist_btn = gr.Button("Download Entire Playlist from SoundCloud")
|
310 |
+
soundcloud_playlist_btn.click(download_entire_playlist, inputs=url_input_soundcloud_playlist, outputs=gr.Textbox())
|
311 |
+
|
312 |
+
with gr.Row():
|
313 |
+
url_input_soundcloud_playlist_metadata = gr.Textbox(label="SoundCloud Playlist URL")
|
314 |
+
soundcloud_playlist_metadata_btn = gr.Button("Download Entire Playlist from SoundCloud with Metadata")
|
315 |
+
soundcloud_playlist_metadata_btn.click(download_entire_playlist, inputs=url_input_soundcloud_playlist_metadata, outputs=gr.Textbox())
|
316 |
+
|
317 |
+
with gr.Row():
|
318 |
+
url_input_soundcloud_multiple_playlists = gr.Textbox(label="SoundCloud Playlist URLs (space-separated)")
|
319 |
+
soundcloud_multiple_playlists_btn = gr.Button("Download Multiple Playlists with Metadata")
|
320 |
+
soundcloud_multiple_playlists_btn.click(download_multiple_individual_files, inputs=url_input_soundcloud_multiple_playlists, outputs=gr.Textbox())
|
321 |
+
|
322 |
+
with gr.Row():
|
323 |
+
url_input_soundcloud_playlist_range = gr.Textbox(label="SoundCloud Playlist URL")
|
324 |
+
start_input_soundcloud = gr.Textbox(label="Start Index")
|
325 |
+
end_input_soundcloud = gr.Textbox(label="End Index")
|
326 |
+
soundcloud_playlist_range_btn = gr.Button("Download Playlist with Specific Range")
|
327 |
+
soundcloud_playlist_range_btn.click(download_playlist_specific_range, inputs=[url_input_soundcloud_playlist_range, start_input_soundcloud, end_input_soundcloud], outputs=gr.Textbox())
|
328 |
+
|
329 |
+
with gr.Row():
|
330 |
+
url_input_soundcloud_album_art = gr.Textbox(label="SoundCloud Track URL")
|
331 |
+
soundcloud_album_art_btn = gr.Button("Download and Embed Album Art")
|
332 |
+
soundcloud_album_art_btn.click(embed_album_art_automatically, inputs=url_input_soundcloud_album_art, outputs=gr.Textbox())
|
333 |
+
|
334 |
+
with gr.Row():
|
335 |
+
url_input_soundcloud_skip = gr.Textbox(label="SoundCloud Track URL")
|
336 |
+
soundcloud_skip_btn = gr.Button("Skip Downloading Already Downloaded SoundCloud Files")
|
337 |
+
soundcloud_skip_btn.click(skip_already_downloaded_files, inputs=url_input_soundcloud_skip, outputs=gr.Textbox())
|
338 |
+
|
339 |
+
with gr.Row():
|
340 |
+
urls_input_soundcloud = gr.Textbox(label="SoundCloud Track URLs (space-separated)")
|
341 |
+
soundcloud_multiple_tracks_btn = gr.Button("Download Multiple Tracks from SoundCloud")
|
342 |
+
soundcloud_multiple_tracks_btn.click(download_multiple_individual_files, inputs=urls_input_soundcloud, outputs=gr.Textbox())
|
343 |
+
|
344 |
+
with gr.Row():
|
345 |
+
url_input_soundcloud_speed = gr.Textbox(label="SoundCloud Track URL")
|
346 |
+
speed_input_soundcloud = gr.Textbox(label="Speed (e.g., 1M)")
|
347 |
+
soundcloud_speed_btn = gr.Button("Limit Download Speed for SoundCloud")
|
348 |
+
soundcloud_speed_btn.click(download_and_limit_download_speed, inputs=[url_input_soundcloud_speed, speed_input_soundcloud], outputs=gr.Textbox())
|
349 |
+
|
350 |
+
with gr.Row():
|
351 |
+
url_input_soundcloud_chapters = gr.Textbox(label="SoundCloud Track URL")
|
352 |
+
soundcloud_chapters_btn = gr.Button("Download from SoundCloud and Split by Chapters (if available)")
|
353 |
+
soundcloud_chapters_btn.click(download_and_automatically_split_by_chapters, inputs=url_input_soundcloud_chapters, outputs=gr.Textbox())
|
354 |
+
|
355 |
+
with gr.Row():
|
356 |
+
url_input_soundcloud_portion = gr.Textbox(label="SoundCloud Track URL")
|
357 |
+
start_time_input_soundcloud = gr.Textbox(label="Start Time (e.g., 00:01:00)")
|
358 |
+
end_time_input_soundcloud = gr.Textbox(label="End Time (e.g., 00:05:00)")
|
359 |
+
soundcloud_portion_btn = gr.Button("Download SoundCloud Track and Extract a Specific Portion")
|
360 |
+
soundcloud_portion_btn.click(extract_only_a_portion_of_a_video, inputs=[url_input_soundcloud_portion, start_time_input_soundcloud, end_time_input_soundcloud], outputs=gr.Textbox())
|
361 |
+
|
362 |
+
with gr.Row():
|
363 |
+
url_input_soundcloud_metadata_update = gr.Textbox(label="SoundCloud Track URL")
|
364 |
+
soundcloud_metadata_update_btn = gr.Button("Update Metadata of Existing SoundCloud Downloads")
|
365 |
+
soundcloud_metadata_update_btn.click(update_metadata_of_existing_files, inputs=url_input_soundcloud_metadata_update, outputs=gr.Textbox())
|
366 |
+
|
367 |
+
with gr.Row():
|
368 |
+
url_input_soundcloud_rename = gr.Textbox(label="SoundCloud Track URL")
|
369 |
+
soundcloud_rename_btn = gr.Button("Auto-Rename Duplicate SoundCloud Files")
|
370 |
+
soundcloud_rename_btn.click(auto_rename_duplicate_files, inputs=url_input_soundcloud_rename, outputs=gr.Textbox())
|
371 |
+
|
372 |
+
with gr.Row():
|
373 |
+
file_path_input_soundcloud = gr.Textbox(label="File Path")
|
374 |
+
soundcloud_url_list_btn = gr.Button("Download from SoundCloud URL List File")
|
375 |
+
soundcloud_url_list_btn.click(download_from_url_list_file, inputs=file_path_input_soundcloud, outputs=gr.Textbox())
|
376 |
+
|
377 |
+
demo.launch()
|