text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
set show_languages_avail to ""
|
Main.applescript
|
set AppleScript's text item delimiters to " "
|
Main.applescript
|
repeat with log_subtitle_paragraph in log_ST_paragraphs
|
Main.applescript
|
if log_subtitle_paragraph contains " " or character 3 of log_subtitle_paragraph is "-" then
|
Main.applescript
|
set subtitles_info to subtitles_info & log_subtitle_paragraph & return
|
Main.applescript
|
set lang_code to text item 1 of log_subtitle_paragraph
|
Main.applescript
|
set show_languages_avail to show_languages_avail & lang_code & ", "
|
Main.applescript
|
if subtitles_info does not contain (DL_STLanguage & " ") then
|
Main.applescript
|
set theSTLangNotAvailableLabel1 to localized string "There is no subtitle file in your preferred language " from table "MacYTDL"
|
Main.applescript
|
set theSTLangNotAvailableLabel2 to localized string "These languages are available: " from table "MacYTDL"
|
Main.applescript
|
set theSTLangNotAvailableLabel3 to localized string "You can quit, cancel your download (then go to Settings to change language) or download anyway." from table "MacYTDL"
|
Main.applescript
|
set subtitles_quit_or_continue to button returned of (display dialog theSTLangNotAvailableLabel1 & "\"" & DL_STLanguage & "\". " & theSTLangNotAvailableLabel2 & return & return & show_languages_avail & return & return & theSTLangNotAvailableLabel3 buttons {theButtonQuitLabel, theButtonReturnLabel, theButtonContinueLabel} default button 3 with title diag_Title with icon file MacYTDL_custom_icon_file giving up after 600)
|
Main.applescript
|
set AppleScript's text item delimiters to {"Available automatic captions for", "Available subtitles for"}
|
Main.applescript
|
if (count of text items in check_subtitles_available) is 3 then
|
Main.applescript
|
set alt_lang_avail to "N"
|
Main.applescript
|
set auto_gen_subtitles to text item 2 of check_subtitles_available
|
Main.applescript
|
set author_gen_subtitles to text item 3 of check_subtitles_available
|
Main.applescript
|
if author_gen_subtitles contains (DL_STLanguage & " ") and auto_gen_subtitles does not contain (DL_STLanguage & " ") and author_gen is false then
|
Main.applescript
|
set dialog_1_text to "auto-generated "
|
Main.applescript
|
set dialog_2_text to "author-generated "
|
Main.applescript
|
set dialog_3_text to author_gen_subtitles
|
Main.applescript
|
set theButtonContinueGoLabel to localized string "Get author" from table "MacYTDL"
|
Main.applescript
|
set alt_lang_avail to "Y"
|
Main.applescript
|
if author_gen_subtitles does not contain (DL_STLanguage & " ") and auto_gen_subtitles contains (DL_STLanguage & " ") and auto_gen is false then
|
Main.applescript
|
set dialog_1_text to "author-generated "
|
Main.applescript
|
set dialog_2_text to "auto-generated "
|
Main.applescript
|
set dialog_3_text to auto_gen_subtitles
|
Main.applescript
|
set theButtonContinueGoLabel to localized string "Get auto" from table "MacYTDL"
|
Main.applescript
|
if alt_lang_avail is "Y" then
|
Main.applescript
|
set theSTLangNotAvailableLabel1a to localized string "There is no" from table "MacYTDL"
|
Main.applescript
|
set theSTLangNotAvailableLabel1b to localized string "subtitle file in your preferred language" from table "MacYTDL"
|
Main.applescript
|
set theSTLangNotAvailableLabel1 to localized string theSTLangNotAvailableLabel1a & " " & dialog_1_text & theSTLangNotAvailableLabel1b & " "
|
Main.applescript
|
set theSTLangNotAvailableLabel2a to localized string "But" from table "MacYTDL"
|
Main.applescript
|
set theSTLangNotAvailableLabel2b to localized string "subtitles are available." from table "MacYTDL"
|
Main.applescript
|
set theSTLangNotAvailableLabel2 to localized string theSTLangNotAvailableLabel2a & " " & dialog_2_text & theSTLangNotAvailableLabel2b
|
Main.applescript
|
set theSTLangNotAvailableLabel3a to localized string "You cancel your download, download " from table "MacYTDL"
|
Main.applescript
|
set theSTLangNotAvailableLabel3b to localized string "subtitles or download without subtitles." from table "MacYTDL"
|
Main.applescript
|
set theSTLangNotAvailableLabel3 to theSTLangNotAvailableLabel3a & dialog_2_text & theSTLangNotAvailableLabel3b
|
Main.applescript
|
set subtitles_quit_or_continue to button returned of (display dialog theSTLangNotAvailableLabel1 & "\"" & DL_STLanguage & "\". " & theSTLangNotAvailableLabel2 & return & return & theSTLangNotAvailableLabel3 buttons {theButtonReturnLabel, theButtonContinueGoLabel, theButtonContinueLabel} default button 3 with title diag_Title with icon file MacYTDL_custom_icon_file giving up after 600)
|
Main.applescript
|
if subtitles_quit_or_continue is theButtonContinueGoLabel then
|
Main.applescript
|
if dialog_2_text is "author-generated " then
|
Main.applescript
|
else if dialog_2_text is "auto-generated " then
|
Main.applescript
|
else if subtitles_quit_or_continue is theButtonContinueLabel then
|
Main.applescript
|
if author_gen is true and auto_gen is false then
|
Main.applescript
|
if subtitles_info does not contain DL_subtitles_format and DL_subtitles_format is not theBestLabel and DL_subtitles_format is not "ttml" and DL_subtitles_format is not "dfxp" then
|
Main.applescript
|
set YTDL_subtitles to "--write-sub --convert-subs " & DL_subtitles_format & " " & "--sub-lang " & DL_STLanguage & " "
|
Main.applescript
|
else if DL_subtitles_format is theBestLabel then
|
Main.applescript
|
set YTDL_subtitles to "--write-sub --sub-format best " & "--sub-lang " & DL_STLanguage & " "
|
Main.applescript
|
else if DL_subtitles_format is "dfxp" then
|
Main.applescript
|
set YTDL_subtitles to "--write-sub --sub-format dfxp " & "--sub-lang " & DL_STLanguage & " "
|
Main.applescript
|
else if DL_subtitles_format is "ttml" then
|
Main.applescript
|
set YTDL_subtitles to "--write-sub --sub-format ttml " & "--sub-lang " & DL_STLanguage & " "
|
Main.applescript
|
set YTDL_subtitles to "--write-sub --sub-format " & DL_subtitles_format & " " & "--sub-lang " & DL_STLanguage & " "
|
Main.applescript
|
if author_gen is false and auto_gen is true then
|
Main.applescript
|
set YTDL_subtitles to "--write-auto-sub --convert-subs " & DL_subtitles_format & " " & "--sub-lang " & DL_STLanguage & " "
|
Main.applescript
|
set YTDL_subtitles to "--write-auto-sub --sub-format best " & "--sub-lang " & DL_STLanguage & " "
|
Main.applescript
|
set YTDL_subtitles to "--write-auto-sub --sub-format dfxp " & "--sub-lang " & DL_STLanguage & " "
|
Main.applescript
|
set YTDL_subtitles to "--write-auto-sub --sub-format ttml " & "--sub-lang " & DL_STLanguage & " "
|
Main.applescript
|
set YTDL_subtitles to "--write-auto-sub --sub-format " & DL_subtitles_format & " " & "--sub-lang " & DL_STLanguage & " "
|
Main.applescript
|
if author_gen is true and auto_gen is true then
|
Main.applescript
|
set YTDL_subtitles to "--write-auto-sub --write-sub --convert-subs " & DL_subtitles_format & " " & "--sub-lang " & DL_STLanguage & " "
|
Main.applescript
|
set YTDL_subtitles to "--write-auto-sub --write-sub --sub-format best " & "--sub-lang " & DL_STLanguage & " "
|
Main.applescript
|
set YTDL_subtitles to "--write-auto-sub --write-sub --sub-format dfxp " & "--sub-lang " & DL_STLanguage & " "
|
Main.applescript
|
set YTDL_subtitles to "--write-auto-sub --write-sub --sub-format ttml " & "--sub-lang " & DL_STLanguage & " "
|
Main.applescript
|
set YTDL_subtitles to "--write-auto-sub --write-sub --sub-format " & DL_subtitles_format & " " & "--sub-lang " & DL_STLanguage & " "
|
Main.applescript
|
end check_subtitles_download_available
|
Main.applescript
|
on get_Date_Time()
|
Main.applescript
|
set download_date_time to (current date) as string
|
Main.applescript
|
set AppleScript's text item delimiters to {", ", " ", ":", ","}
|
Main.applescript
|
set the item_list to every text item of download_date_time
|
Main.applescript
|
set AppleScript's text item delimiters to "_"
|
Main.applescript
|
set download_date_time to the item_list as string
|
Main.applescript
|
return download_date_time
|
Main.applescript
|
end get_Date_Time
|
Main.applescript
|
on set_settings()
|
Main.applescript
|
set theSettingsDiagPromptLabel to localized string "Settings" from table "MacYTDL"
|
Main.applescript
|
set settings_diag_prompt to theSettingsDiagPromptLabel
|
Main.applescript
|
set accViewInset to 0
|
Main.applescript
|
set theButtonsSaveLabel to localized string "Save Settings" from table "MacYTDL"
|
Main.applescript
|
set {theButtons, minWidth} to create buttons {theButtonCancelLabel, theButtonsSaveLabel} button keys {".", ""} default button 2
|
Main.applescript
|
set {theSettingsRule, theTop} to create rule 3 rule width accViewWidth
|
Main.applescript
|
set theCheckboxQTCompatLabel to localized string "QT compatible video" from table "MacYTDL"
|
Main.applescript
|
set {settings_theCheckbox_QT_Compat, theTop} to create checkbox theCheckboxQTCompatLabel left inset 70 bottom (theTop + 3) max width 200 initial state DL_QT_Compat
|
Main.applescript
|
set theCheckBoxUseCustomSettingsLabel to localized string "Use custom settings" from table "MacYTDL"
|
Main.applescript
|
set {settings_theCheckbox_Use_CustomSettings, theTop, BoxCustSetLeftDist} to create checkbox theCheckBoxUseCustomSettingsLabel left inset 70 bottom (theTop + 3) max width 150 initial state DL_Use_Custom_Settings
|
Main.applescript
|
set theFieldCustomSettingsLabel to localized string "Custom settings" from table "MacYTDL"
|
Main.applescript
|
set {settings_theField_Custom_Settings, theTop} to create field DL_Custom_Settings left inset (BoxCustSetLeftDist + 70) bottom (theTop - 20) field width 200 placeholder text theFieldCustomSettingsLabel
|
Main.applescript
|
set theCheckBoxUseCustomTemplateLabel to localized string "Use custom template" from table "MacYTDL"
|
Main.applescript
|
set {settings_theCheckbox_Use_CustomTemplate, theTop, CustTempPopLeftDist} to create checkbox theCheckBoxUseCustomTemplateLabel left inset 70 bottom (theTop + 3) max width 150 initial state DL_Use_Custom_Template
|
Main.applescript
|
set theFieldCustomTemplateLabel to localized string "Custom file name template" from table "MacYTDL"
|
Main.applescript
|
set {settings_theField_Custom_Template, theTop} to create field DL_Custom_Template left inset (CustTempPopLeftDist + 70) bottom (theTop - 20) field width 200 placeholder text theFieldCustomTemplateLabel
|
Main.applescript
|
set {settings_theCookiesLocationPathControl, theTop} to create path control (POSIX path of DL_Cookies_Location) left inset 205 bottom (theTop + 1) control width 225 with pops up
|
Main.applescript
|
set theCheckboxUseCookiesLabel to localized string "Use cookies" from table "MacYTDL"
|
Main.applescript
|
set {settings_theCheckBox_Use_Cookies, theTop} to create checkbox theCheckboxUseCookiesLabel left inset 70 bottom (theTop - 25) max width 150 initial state DL_Use_Cookies
|
Main.applescript
|
set theCheckboxUseProxyLabel to localized string "Use proxy" from table "MacYTDL"
|
Main.applescript
|
set {settings_theCheckBox_Use_Proxy, theTop, ProxyCheckBoxWidth} to create checkbox theCheckboxUseProxyLabel left inset 70 bottom (theTop + 3) max width 100 initial state DL_Use_Proxy
|
Main.applescript
|
set theFieldProxyURLPlaceholderLabel to localized string "No URL set" from table "MacYTDL"
|
Main.applescript
|
set {settings_theField_ProxyURL, theTop} to create field DL_Proxy_URL left inset (ProxyCheckBoxWidth + 70) bottom (theTop - 20) field width 250 placeholder text theFieldProxyURLPlaceholderLabel
|
Main.applescript
|
set theCheckboxKeepOriginalLabel to localized string "Keep original video and/or subtitles file" from table "MacYTDL"
|
Main.applescript
|
set {settings_theCheckbox_Original, theTop} to create checkbox theCheckboxKeepOriginalLabel left inset 70 bottom (theTop + 3) max width 200 initial state DL_Remux_original
|
Main.applescript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.