text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
else if quit_or_return is theButtonDownloadLabel then
|
Main.applescript
|
do shell script shellPath & "cd " & quoted form of downloadsFolder_Path & " ; export LC_CTYPE=UTF-8 ; " & DL_Use_YTDLP & " --get-filename " & YTDL_no_playlist & DL_Playlist_Items_Spec & YTDL_credentials & URL_user_entered_clean_quoted & " " & simulate_YTDL_output_template & " > /dev/null" & " &> " & YTDL_simulate_file
|
Main.applescript
|
else if quit_or_return is "Remux" then
|
Main.applescript
|
set remux_format_choice to DL_format
|
Main.applescript
|
if YTDL_format_pref is "3gp" then
|
Main.applescript
|
set remux_format_choice to "mp4"
|
Main.applescript
|
set YTDL_simulate_log to run_Utilities_handlers's replace_chars(YTDL_simulate_log, "True#", "")
|
Main.applescript
|
set YTDL_simulate_log to run_Utilities_handlers's replace_chars(YTDL_simulate_log, "False#", "")
|
Main.applescript
|
set YTDL_simulate_log to run_Utilities_handlers's replace_chars(YTDL_simulate_log, "NA#", "") -- Removes placeholder when there is no is_live returned by simulate
|
Main.applescript
|
set is_SBS_bug_page to false
|
Main.applescript
|
if YTDL_simulate_log contains "ERROR:" and YTDL_simulate_log does not contain "Unsupported URL: https://www.sbs.com.au/ondemand" and YTDL_simulate_log does not contain "Unsupported URL: https://iview.abc.net.au/show" then
|
Main.applescript
|
if URL_user_entered_clean contains "https://iview.abc.net.au/show" and YTDL_simulate_log contains "An extractor error has occurred" then
|
Main.applescript
|
else if URL_user_entered_clean contains "https://www.sbs.com.au/ondemand/" and YTDL_simulate_log contains "HTTP Error 403: Forbidden" then
|
Main.applescript
|
set is_SBS_bug_page to true
|
Main.applescript
|
if playlist_Name is not "" then
|
Main.applescript
|
set theURLErrorTextLabelString to localized string "for the playlist" from table "MacYTDL"
|
Main.applescript
|
set theURLErrorTextLabel4 to localized string theURLErrorTextLabelString & " " & "'" & playlist_Name & "':"
|
Main.applescript
|
set theURLErrorTextLabel4 to ":"
|
Main.applescript
|
set theURLErrorTextLabel1 to localized string "There was an error with the URL you entered" from table "MacYTDL"
|
Main.applescript
|
set theURLErrorTextLabel2 to localized string "The error message was: " from table "MacYTDL"
|
Main.applescript
|
set theURLErrorTextLabel3 to localized string "OK to give up or Download to try anyway." from table "MacYTDL"
|
Main.applescript
|
set quit_or_return to button returned of (display dialog theURLErrorTextLabel1 & " " & theURLErrorTextLabel4 & return & return & URL_user_entered & return & return & theURLErrorTextLabel2 & return & return & YTDL_simulate_log & return & theURLErrorTextLabel3 buttons {theButtonOKLabel, theButtonDownloadLabel} default button 2 cancel button 1 with title diag_Title with icon file MacYTDL_custom_icon_file giving up after 600)
|
Main.applescript
|
set theURLErrorTextLabel3 to localized string "Quit, OK to return or Download to try anyway." from table "MacYTDL"
|
Main.applescript
|
set quit_or_return to button returned of (display dialog theURLErrorTextLabel1 & theURLErrorTextLabel4 & return & return & URL_user_entered & return & return & theURLErrorTextLabel2 & return & return & YTDL_simulate_log & return & theURLErrorTextLabel3 buttons {theButtonQuitLabel, theButtonOKLabel, theButtonDownloadLabel} default button 2 cancel button 1 with title diag_Title with icon file MacYTDL_custom_icon_file giving up after 600)
|
Main.applescript
|
if YTDL_simulate_log contains "IOError: CRC check failed" then
|
Main.applescript
|
set theURLErrorTextLabel1 to localized string "There was an error with the URL you entered. The video might be DRM protected or it could be a network, VPN or macOS install issue. If the URL is correct, you may need to look more deeply into your network settings and macOS install." from table "MacYTDL"
|
Main.applescript
|
display dialog theURLErrorTextLabel1 buttons {theButtonOKLabel} with title diag_Title with icon file MacYTDL_custom_icon_file giving up after 600
|
Main.applescript
|
set ABC_show_indicator to "No"
|
Main.applescript
|
set SBS_show_indicator to "No"
|
Main.applescript
|
if URL_user_entered_clean contains "iview.abc.net.au/show/" then
|
Main.applescript
|
if last character of URL_user_entered_clean is not "/" then
|
Main.applescript
|
set URL_user_entered_clean to (URL_user_entered_clean & "/")
|
Main.applescript
|
set branch_execution to run_Utilities_handlers's Get_ABC_Episodes(URL_user_entered, diag_Title, theButtonOKLabel, theButtonCancelLabel, theButtonDownloadLabel, X_position, screen_height, MacYTDL_custom_icon_file, MacYTDL_custom_icon_file_posix, theButtonReturnLabel, skip_Main_dialog, path_to_MacYTDL)
|
Main.applescript
|
if branch_execution is "Main" then main_dialog()
|
Main.applescript
|
set ABC_show_indicator to "Yes"
|
Main.applescript
|
set URL_user_entered to ABC_show_URLs
|
Main.applescript
|
set number_ABC_SBS_episodes to number of text items in ABC_show_URLs
|
Main.applescript
|
if number_ABC_SBS_episodes is greater than 1 and DL_formats_list is true then
|
Main.applescript
|
set theTooManyUELsLabel to localized string "Sorry, but MacYTDL cannot list formats for more than one ABC show. Would you like to cancel the download and return to the main dialog or skip the formats list and continue to download ?" from table "MacYTDL"
|
Main.applescript
|
else if skip_or_return is theButtonContinueLabel then
|
Main.applescript
|
set DL_formats_list to false
|
Main.applescript
|
if YTDL_simulate_log contains "Unsupported URL: https://www.sbs.com.au/ondemand" or is_SBS_bug_page is true then
|
Main.applescript
|
if URL_user_entered contains "?action=play" then
|
Main.applescript
|
set URL_user_entered to (text 1 thru -14 of URL_user_entered & "'")
|
Main.applescript
|
if YTDL_simulate_log contains "?play=" or URL_user_entered contains "ondemand/search" then
|
Main.applescript
|
set theOnDemandURLProblemLabel to localized string "MacYTDL cannot download video from an SBS OnDemand \"Play\" or Search links. Navigate to a \"Show\" page and try again." from table "MacYTDL"
|
Main.applescript
|
display dialog theOnDemandURLProblemLabel with title diag_Title buttons {theButtonOKLabel} default button 1 with icon file MacYTDL_custom_icon_file giving up after 100
|
Main.applescript
|
else if URL_user_entered contains "/ondemand/movie/" then
|
Main.applescript
|
set SBS_movie_ID to text 1 thru -2 of (last text item of URL_user_entered)
|
Main.applescript
|
set URL_user_entered to quoted form of ("https://www.sbs.com.au/ondemand/watch/" & SBS_movie_ID)
|
Main.applescript
|
do shell script shellPath & "cd " & quoted form of downloadsFolder_Path & " ; export LC_CTYPE=UTF-8 ; " & DL_Use_YTDLP & " --get-filename " & YTDL_credentials & URL_user_entered & " " & YTDL_output_template & " > /dev/null" & " &> " & YTDL_simulate_file
|
Main.applescript
|
set check_URL_ID to last word of URL_user_entered
|
Main.applescript
|
set length_check_URL_ID to length of check_URL_ID
|
Main.applescript
|
set check_URL_number to check_URL_ID as number
|
Main.applescript
|
set is_ID to true
|
Main.applescript
|
on error errText number errNum
|
Main.applescript
|
set is_ID to false
|
Main.applescript
|
if is_SBS_bug_page is true then
|
Main.applescript
|
set URL_user_entered to ("https://www.sbs.com.au/api/v3/video_smil?id=" & check_URL_ID)
|
Main.applescript
|
set SBS_show_name to "This is a bug URL"
|
Main.applescript
|
set number_ABC_SBS_episodes to 1
|
Main.applescript
|
set SBS_workaround_page to do shell script "curl " & URL_user_entered
|
Main.applescript
|
if SBS_workaround_page contains "abstract" then
|
Main.applescript
|
set AppleScript's text item delimiters to {"title=\"", "\" abstract="}
|
Main.applescript
|
set download_filename to (text item 2 of SBS_workaround_page) & ".mp4"
|
Main.applescript
|
set AppleScript's text item delimiters to {"title=\"", "\" copyright="}
|
Main.applescript
|
set download_filename_new to run_Utilities_handlers's replace_chars(download_filename, " ", "_")
|
Main.applescript
|
set download_date_time to get_Date_Time()
|
Main.applescript
|
set YTDL_log_file to MacYTDL_preferences_path & "youtube-dl_log-" & download_filename_new & "-" & download_date_time & ".txt"
|
Main.applescript
|
if YTDL_remux_format contains "recode" then set YTDL_remux_format to ""
|
Main.applescript
|
set YTDL_output_template to "-o '" & download_filename_new & ".%(ext)s'"
|
Main.applescript
|
else if is_ID is true and length_check_URL_ID is greater than 7 and URL_user_entered does not contain "watch" then
|
Main.applescript
|
set URL_user_entered to ("https://www.sbs.com.au/ondemand/watch/" & check_URL_ID)
|
Main.applescript
|
set SBS_show_name to "This is a watcher URL"
|
Main.applescript
|
set branch_execution to run_Utilities_handlers's Get_SBS_Episodes(URL_user_entered, diag_Title, theButtonOKLabel, theButtonCancelLabel, theButtonDownloadLabel, X_position, screen_height, MacYTDL_custom_icon_file, MacYTDL_custom_icon_file_posix, theButtonReturnLabel, skip_Main_dialog, path_to_MacYTDL)
|
Main.applescript
|
set SBS_show_indicator to "Yes"
|
Main.applescript
|
set URL_user_entered to SBS_show_URLs
|
Main.applescript
|
set number_ABC_SBS_episodes to number of text items in SBS_show_URLs
|
Main.applescript
|
set theTooManyUELsLabel to localized string "Sorry, but MacYTDL cannot list formats for more than one SBS show. Would you like to cancel the download and return to the main dialog or skip the formats list and continue to download ?" from table "MacYTDL"
|
Main.applescript
|
set simulate_warnings to ""
|
Main.applescript
|
repeat with aPara in (paragraphs of YTDL_simulate_log)
|
Main.applescript
|
if aPara contains "WARNING:" and aPara does not contain "Falling back on generic information" and aPara does not contain "Ignoring subtitle tracks found in the HLS manifest" and aPara does not contain "FutureWarning:" then
|
Main.applescript
|
if simulate_warnings is "" then
|
Main.applescript
|
set simulate_warnings to aPara
|
Main.applescript
|
set simulate_warnings to simulate_warnings & return & aPara
|
Main.applescript
|
if is_SBS_bug_page is false then
|
Main.applescript
|
if simulate_warnings is not "" then
|
Main.applescript
|
set theURLWarningTextLabel1 to DL_Use_YTDLP & (localized string " has given a warning on the URL you entered:" from table "MacYTDL")
|
Main.applescript
|
set theURLWarningTextLabel2 to localized string "The warning message(s) was: " from table "MacYTDL"
|
Main.applescript
|
set theURLWarningTextLabel3 to (localized string "You can return to the main dialog or continue to see what happens." from table "MacYTDL")
|
Main.applescript
|
set theWarningButtonsMainLabel to localized string "Main" from table "MacYTDL"
|
Main.applescript
|
set warning_quit_or_continue to button returned of (display dialog theURLWarningTextLabel1 & return & return & URL_user_entered & return & return & theURLWarningTextLabel2 & return & return & simulate_warnings & return & return & theURLWarningTextLabel3 buttons {theWarningButtonsMainLabel, theButtonContinueLabel} default button 2 with title diag_Title with icon file MacYTDL_custom_icon_file giving up after 600)
|
Main.applescript
|
if warning_quit_or_continue is theButtonContinueLabel then -- <= Ignore warning - try DL - get filename from last paragraph of simulate file
|
Main.applescript
|
set_File_Names(shellPath, YTDL_simulate_log, URL_user_entered, ABC_show_name, SBS_show_name, DL_Use_YTDLP)
|
Main.applescript
|
else if warning_quit_or_continue is theWarningButtonsMainLabel then -- <= Stop and return to Main dialog
|
Main.applescript
|
set URL_user_entered to set_File_Names(shellPath, YTDL_simulate_log, URL_user_entered, ABC_show_name, SBS_show_name, DL_Use_YTDLP)
|
Main.applescript
|
if subtitles_choice is true or DL_YTAutoST is true then
|
Main.applescript
|
set YTDL_subtitles to check_subtitles_download_available(shellPath, diag_Title, subtitles_choice, URL_user_entered, theButtonQuitLabel, theButtonReturnLabel, theButtonContinueLabel, MacYTDL_custom_icon_file, DL_Use_YTDLP)
|
Main.applescript
|
set YTDL_formats_to_download to ""
|
Main.applescript
|
if DL_formats_list is true then
|
Main.applescript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.