From 4aa2a01fda427939a3df53f4f0df42d94fbe5ad5 Mon Sep 17 00:00:00 2001 From: huguanjin <142820286+huguanjin@users.noreply.github.com> Date: Sat, 28 Sep 2024 15:39:12 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 单独增加了一个视频批量下载的功能,只需要提供YouTube博主主页的URL,即可批量下载该博主的所有视频 --- .../download_channel.cpython-312.pyc | Bin 0 -> 3392 bytes core/all_download_methods/download_channel.py | 53 ++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 core/all_download_methods/__pycache__/download_channel.cpython-312.pyc create mode 100644 core/all_download_methods/download_channel.py diff --git a/core/all_download_methods/__pycache__/download_channel.cpython-312.pyc b/core/all_download_methods/__pycache__/download_channel.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4589b77fcd8cf61b1ef42a8b772bf6273d11283f GIT binary patch literal 3392 zcmc&$U2GHC6~1?7{O`nxoe&ZdG7Fm$vp5N%-9>CbEOi1)!cW=2)+X%KWUiBO#vW^C zf{AORAXS2ukT!V=Q9)#%NX0$`sVnwzd04hmtIAmu5r$Av^`YX;EJ#%JrRR=+k_|{m z?L)7nd(S!d{M~c!`8?h3o0 z5-!maWkl=maM(?%MB7+9Lh617k!sOi_7wJ*d?iA-26!&Er5JDROlm~uEv6_5drd1B zas3{N?(1yDn~(TZhWHYgxWYcraT5>m65lPhXot}Rp1}U9r<6VF$A%-MjO*iPNpJud zyBN`lF2xDZ)uF)y!inBbjt!g~{P@_>^pW76q3*7Z_(WhNsV5~_(E}+(9n+GLVKM}w zfGHbVm7OD^q{vcYL6@Yu1$!xrAM`WEiN3)tqhDEg2R#`*lXd862~$^;4w9O5H^)Iz^Z0 zzQ&ATu}Z8KJ=g46PPdh9GF-X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wCa(iF8 z;Iw8j{#~$w+N+l~5Im#Rd8Kv1_1*R2zHatzows){^W9!YU#I1swV`jj(y4%v%V>9f65RXU+K}ZLV%Os)^o+JPtczu-cCr=FUO4KAvUoU*=xj?UPe@)%& zBcApV-yVVyIC3Nq4EjOW-WCe9#RF|(djD%yBGDuj@L;v``1W1zcXfWy-PO6XYj>9k zvpaZ^L?h#}&Zk*$=&w`he>i}^1hn-8G_RaAAw#8~RVq*StdV3AfWfdqkDA?Ri=2gz zHHr^{KwDK14C}Cxh)N?WMNhK>=pI#uJ&Tk`j_Yb0^;NwJ5dy^>ic^3_fKxxCmfK+Z z19}cKQoCV#W$%eA;XWxluFwSDio>&YGeb$)*+-xbdDr}H&K z_tBZh=$$9MpFqR?2J6gov=#3y9L9)qUrztPHa_$= Date: Sat, 28 Sep 2024 15:40:54 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=B8=BA=E8=A7=86=E9=A2=91=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E4=B8=8B=E8=BD=BD=E8=80=8C=E5=8D=95=E7=8B=AC=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E7=9A=84=E7=A4=BA=E4=BE=8B=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为视频批量下载而单独创建的示例页面 --- st_auto.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 st_auto.py diff --git a/st_auto.py b/st_auto.py new file mode 100644 index 00000000..5a4eb82e --- /dev/null +++ b/st_auto.py @@ -0,0 +1,44 @@ +import streamlit as st +from datetime import datetime +import sys +import os + +sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +from st_components.i18n import get_localized_string as gls +from core.all_download_methods.download_channel import download_videos_from_channel +from config import YTB_RESOLUTION + +def main(): + st.set_page_config(page_title="VideoLingo Bulk Download", page_icon="🎥") + + st.title(gls("bulk_download_title")) + + # Language selection + language_options = ["Chinese", "English", "Auto"] + selected_language = st.selectbox(gls("select_language"), options=language_options) + + # YouTube channel URL input + channel_url = st.text_input(gls("enter_channel_url"), placeholder="https://www.youtube.com/channel/...") + + # Start date input + start_date = st.date_input(gls("start_date"), datetime.now()) + + # Resolution selection + resolution_options = ["360", "720", "1080", "best"] + selected_resolution = st.selectbox(gls("select_resolution"), options=resolution_options, index=resolution_options.index(YTB_RESOLUTION)) + + if st.button(gls("start_download")): + if channel_url: + try: + with st.spinner(gls("downloading_videos")): + save_path = os.path.join('vediolingo-web', 'YouTube_Videos') + download_videos_from_channel(channel_url, start_date, resolution=selected_resolution, save_path=save_path) + st.success(gls("download_complete")) + st.info(f"{gls('videos_saved_in')} {save_path}") + except Exception as e: + st.error(f"{gls('download_error')}: {str(e)}") + else: + st.error(gls("enter_valid_url")) + +if __name__ == "__main__": + main() \ No newline at end of file From d1a0ce66782997aa8079667c1f4de99031abbffd Mon Sep 17 00:00:00 2001 From: huguanjin <142820286+huguanjin@users.noreply.github.com> Date: Sat, 28 Sep 2024 15:43:20 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B=E9=A1=B5=E9=9D=A2=E7=9A=84=E9=83=A8=E5=88=86=E4=B8=AD?= =?UTF-8?q?=E6=96=87=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加了示例页面的部分中文映射 --- st_components/locales.csv | 70 ++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/st_components/locales.csv b/st_components/locales.csv index 81d100b4..0989e0ff 100644 --- a/st_components/locales.csv +++ b/st_components/locales.csv @@ -2,29 +2,29 @@ locale,key,value en_US,app_title,"VideoLingo: Connecting Every Frame Across the World" zh_CN,app_title,"VideoLingo: 连接世界的每一帧" en_US,app_description,"Hello, thank you for visiting VideoLingo. This project is currently under construction. If you encounter any issues, please feel free to ask questions on Github or in the QQ group! We will present more features in the near future. Thank you for your understanding!" -zh_CN,app_description,"哈喽,感谢访问 VideoLingo. 目前该项目还在建设中,遇到任何问题可以在 Github 或 QQ 群提问!我们将在不久的未来呈现更多功能,感谢理解!" +zh_CN,app_description,"👏 欢迎来到 VideoLingo. 目前该项目还在建设中,遇到任何问题可以在 Github 或 QQ 群提问!也可以自行查看 Github 本地安装指南~" en_US,translate_generate_subtitle,"Translate and Generate Subtitles" zh_CN,translate_generate_subtitle,"翻译并生成字幕" en_US,text_processing_steps,"This stage includes the following steps:" zh_CN,text_processing_steps,"该阶段包括以下步骤:" -en_US,step1,"1. Whisper word-level transcription" -zh_CN,step1,"1. Whisper 单词级转录" -en_US,step2,"2. Sentence segmentation using Spacy and Claude" -zh_CN,step2,"2. Spacy 和 Claude 分割句子" +en_US,step1,"1. WhisperX word-level transcription" +zh_CN,step1,"1. 使用 WhisperX 单词级转录" +en_US,step2,"2. Sentence segmentation using NLP and LLM" +zh_CN,step2,"2. 使用 NLP 和 LLM 分割句子" en_US,step3,"3. Summarization and multi-step translation" -zh_CN,step3,"3. 总结和多步翻译" +zh_CN,step3,"3. 总结提取术语和多步翻译" en_US,step4,"4. Cutting and aligning long subtitles" -zh_CN,step4,"4. 切割对齐长字幕" +zh_CN,step4,"4. 二次切割长字幕并对齐" en_US,step5,"5. Generating timeline and subtitles" zh_CN,step5,"5. 生成时间轴和字幕" en_US,step6,"6. Merging subtitles into the video" -zh_CN,step6,"6. 将字幕合并到视频中" +zh_CN,step6,"6. 将字幕压制到视频中" en_US,start_processing_subtitles,"Start Processing Subtitles" zh_CN,start_processing_subtitles,"开始处理字幕" en_US,linux_warning,"Currently, merging Chinese subtitles on Linux displays garbled characters. Please download the srt file and process it yourself." zh_CN,linux_warning,"目前 Linux 下合并中文字幕展示乱码,请下载 srt 文件自行压制处理~" en_US,subtitle_translation_complete,"Subtitle translation is complete! It's recommended to download the srt file and process it yourself." -zh_CN,subtitle_translation_complete,"字幕翻译已完成! 建议下载 srt 文件自行压制 ~" +zh_CN,subtitle_translation_complete,"字幕翻译已完成! 建议下载 srt 文件自行调整样式压制 ~" en_US,download_all_subtitles,"Download All Subtitles" zh_CN,download_all_subtitles,"下载所有字幕" en_US,archive_to_history,"Archive to 'history'" @@ -35,8 +35,8 @@ en_US,audio_processing_steps,"This stage includes the following steps:" zh_CN,audio_processing_steps,"该阶段包括以下步骤:" en_US,audio_step1,"1. Generate audio tasks" zh_CN,audio_step1,"1. 生成音频任务" -en_US,audio_step2,"2. UVR5 noise reduction" -zh_CN,audio_step2,"2. UVR5降噪" +en_US,audio_step2,"2. UVR5 人声分离" +zh_CN,audio_step2,"2. UVR5 人声分离" en_US,audio_step3,"3. Generate audio" zh_CN,audio_step3,"3. 生成音频" en_US,audio_step4,"4. Merge audio into the video" @@ -46,7 +46,7 @@ zh_CN,audio_processing_complete_emoji,"配音处理完成!🎇" en_US,start_audio_processing,"Start Audio Processing" zh_CN,start_audio_processing,"开始配音处理" en_US,audio_processing_complete,"Audio processing is complete! You can check the audio files in the `output` folder." -zh_CN,audio_processing_complete,"配音处理已完成! 可以在`output`文件夹下查看音频文件 ~" +zh_CN,audio_processing_complete,"配音处理已完成! 可以在 `output` 文件夹下查看音频文件 ~" en_US,upload_video,"Upload Video" zh_CN,upload_video,"上传视频" en_US,download_or_upload_video,"Download or Upload Video" @@ -65,30 +65,16 @@ en_US,base_url_help,"No need to add v1 suffix, it will be automatically appended zh_CN,base_url_help,"不需要添加 v1 后缀,会自动补充 /v1/chat/completions" en_US,subtitle_settings,"Transcription and Subtitle Settings" zh_CN,subtitle_settings,"转录与字幕设置" -en_US,whisper_method,"Whisper Method:" -zh_CN,whisper_method,"Whisper 方法:" +en_US,whisper_method,"WhisperX Method:" +zh_CN,whisper_method,"WhisperX 方法:" en_US,replicate_api_token,"Replicate API Token:" zh_CN,replicate_api_token,"Replicate API Token:" en_US,replicate_api_token_help,"Used for calling whisperX api, get it from: https://replicate.com/account/api-tokens" zh_CN,replicate_api_token_help,"调用whisperX api用,获取地址:https://replicate.com/account/api-tokens" -en_US,whisper_recognition_language,"Transcription Language:" -zh_CN,whisper_recognition_language,"转录语言:" -en_US,whisper_recognition_language_help,"'auto' for automatic recognition, 'en' for forced English transcription" -zh_CN,whisper_recognition_language_help,"auto 为自动识别,en 为强制转译为英文" en_US,translation_target_language,"Translation Target Language:" zh_CN,translation_target_language,"翻译目标语言:" en_US,translation_target_language_help,"Use natural language description, e.g.: Simplified Chinese, Traditional Chinese, English, Japanese" zh_CN,translation_target_language_help,"使用自然语言描述即可,如:简体中文,繁体中文,English,日本語" -en_US,subtitle_line_length_settings,"Subtitle Line Length Settings:" -zh_CN,subtitle_line_length_settings,"字幕行长度设置:" -en_US,max_characters_per_line,"Maximum Characters Per Line:" -zh_CN,max_characters_per_line,"单行最大字符数:" -en_US,max_characters_per_line_help,"Maximum number of characters per line of subtitles, calculated based on English. For Chinese, it will be automatically multiplied by 1.75. Default is 75" -zh_CN,max_characters_per_line_help,"每一行字幕的最大字符数,按照英文计算,中文会自动乘以1.75,默认 75" -en_US,translation_length_multiplier,"Translation Length Multiplier:" -zh_CN,translation_length_multiplier,"翻译长度倍数:" -en_US,translation_length_multiplier_help,"Considering the audience, translated subtitles are usually larger than the original language. Default is set to 1.5 times the length" -zh_CN,translation_length_multiplier_help,"考虑到受众,翻译字幕一般比原语言字号大,默认设置为长度上的1.5倍" en_US,video_resolution,"Video Compression Options:" zh_CN,video_resolution,"压制视频选项:" en_US,remember_save_settings,"Remember to click the 'Save' button below" @@ -135,8 +121,10 @@ en_US,tts_method,"TTS Method" zh_CN,tts_method,"TTS 方法" en_US,openai_voice,"OpenAI Voice" zh_CN,openai_voice,"OpenAI 语音" -en_US,edge_tts_voice,"Edge TTS Voice" -zh_CN,edge_tts_voice,"Edge TTS 语音" +en_US,fish_tts_api_key,"FishTTS API" +zh_CN,fish_tts_api_key,"FishTTS API" +en_US,fish_tts_character,"FishTTS Character" +zh_CN,fish_tts_character,"FishTTS 角色" en_US,azure_key,"Azure Key" zh_CN,azure_key,"Azure 密钥" en_US,azure_region,"Azure Region" @@ -157,3 +145,25 @@ en_US,refer_mode,"Reference Audio Mode" zh_CN,refer_mode,"参考音频模式" en_US,delete_dubbing_files,"Delete dubbing files" zh_CN,delete_dubbing_files,"删除此步配音文件" +en_US,bulk_download_title,"VideoLingo Bulk Download" +zh_CN,bulk_download_title,"VideoLingo 批量下载" +en_US,select_language,"Select Language" +zh_CN,select_language,"选择语言" +en_US,enter_channel_url,"Enter YouTube channel URL:" +zh_CN,enter_channel_url,"输入YouTube频道URL:" +en_US,start_date,"Start Date" +zh_CN,start_date,"开始日期" +en_US,select_resolution,"Select Resolution" +zh_CN,select_resolution,"选择分辨率" +en_US,start_download,"Start Download" +zh_CN,start_download,"开始下载" +en_US,downloading_videos,"Downloading videos..." +zh_CN,downloading_videos,"正在下载视频..." +en_US,download_complete,"Download complete" +zh_CN,download_complete,"下载完成" +en_US,videos_saved_in,"Videos saved in" +zh_CN,videos_saved_in,"视频保存在" +en_US,download_error,"Download error" +zh_CN,download_error,"下载错误" +en_US,enter_valid_url,"Please enter a valid URL" +zh_CN,enter_valid_url,"请输入有效的URL" \ No newline at end of file