Skip to content

Commit

Permalink
Update DownloadYouTubev2.ps1
Browse files Browse the repository at this point in the history
v0.11
  • Loading branch information
awirthy committed Jan 26, 2023
1 parent eb60b6b commit 73e3d43
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions DownloadYouTubev2.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function Create_RSS_v1([string]$ChannelID,[string]$RSSXML,[string]$MediaFolder){
Out-File -FilePath $strFile -InputObject $txtRSSFile;
# Send-ToEmail -email "[email protected]" -subject "RSS Podcast Downloaded (${ChannelID})" -body "${strTitle}$([Environment]::NewLine)$([Environment]::NewLine)---------------------------------------------------------------$([Environment]::NewLine)$([Environment]::NewLine)${strDescription}";

# $htmltext = "From: [email protected]$([Environment]::NewLine)To: [email protected]$([Environment]::NewLine)Subject: RSS Podcast Downloaded (${ChannelID})$([Environment]::NewLine)${strTitle}$([Environment]::NewLine)$([Environment]::NewLine)---------------------------------------------------------------$([Environment]::NewLine)$([Environment]::NewLine)${strDescription}";

$htmltext = "${strTitle}$([Environment]::NewLine)$([Environment]::NewLine)---------------------------------------------------------------$([Environment]::NewLine)$([Environment]::NewLine)${strDescription}";
Out-File -FilePath "/config/pushovernotify.txt" -InputObject $htmltext;
# cat /config/pushovernotify.txt | msmtp -a gmail [email protected]
Expand Down Expand Up @@ -85,8 +85,6 @@ function Create_RSS_v1([string]$ChannelID,[string]$RSSXML,[string]$MediaFolder){
# Set-Content -Path $strFile -Value "${txtRSSFile}";
Out-File -FilePath $strFile -InputObject $txtRSSFile;
# Send-ToEmail -email "[email protected]" -subject "RSS Podcast Downloaded (${ChannelID})" -body "${strTitle}$([Environment]::NewLine)$([Environment]::NewLine)---------------------------------------------------------------$([Environment]::NewLine)$([Environment]::NewLine)${strDescription}";

# $htmltext = "From: [email protected]$([Environment]::NewLine)To: [email protected]$([Environment]::NewLine)Subject: RSS Podcast Downloaded (${ChannelID})$([Environment]::NewLine)${strTitle}$([Environment]::NewLine)$([Environment]::NewLine)---------------------------------------------------------------$([Environment]::NewLine)$([Environment]::NewLine)${strDescription}";
$htmltext = "${strTitle}$([Environment]::NewLine)$([Environment]::NewLine)---------------------------------------------------------------$([Environment]::NewLine)$([Environment]::NewLine)${strDescription}";
Out-File -FilePath "/config/pushovernotify.txt" -InputObject $htmltext;
# cat /config/pushovernotify.txt | msmtp -a gmail [email protected]
Expand Down Expand Up @@ -174,7 +172,7 @@ function Create_RSS([string]$ChannelID,[string]$RSSXML,[string]$MediaFolder){
Out-File -FilePath $strFile -InputObject $txtRSSFile;
# Send-ToEmail -email "[email protected]" -subject "RSS Podcast Downloaded (${ChannelID})" -body "${strTitle}$([Environment]::NewLine)$([Environment]::NewLine)---------------------------------------------------------------$([Environment]::NewLine)$([Environment]::NewLine)${strDescription}";

# $htmltext = "From: [email protected]$([Environment]::NewLine)To: [email protected]$([Environment]::NewLine)Subject: RSS Podcast Downloaded (${ChannelID})$([Environment]::NewLine)${strTitle}$([Environment]::NewLine)$([Environment]::NewLine)---------------------------------------------------------------$([Environment]::NewLine)$([Environment]::NewLine)${strDescription}";

# $htmltext = "${strTitle}$([Environment]::NewLine)$([Environment]::NewLine)---------------------------------------------------------------$([Environment]::NewLine)$([Environment]::NewLine)${strDescription}";
# Out-File -FilePath "/config/pushovernotify.txt" -InputObject $htmltext;
# cat /config/pushovernotify.txt | msmtp -a gmail [email protected]
Expand Down Expand Up @@ -254,7 +252,7 @@ function Create_RSS([string]$ChannelID,[string]$RSSXML,[string]$MediaFolder){
Out-File -FilePath $strFile -InputObject $txtRSSFile;
# Send-ToEmail -email "[email protected]" -subject "RSS Podcast Downloaded (${ChannelID})" -body "${strTitle}$([Environment]::NewLine)$([Environment]::NewLine)---------------------------------------------------------------$([Environment]::NewLine)$([Environment]::NewLine)${strDescription}";

# $htmltext = "From: [email protected]$([Environment]::NewLine)To: [email protected]$([Environment]::NewLine)Subject: RSS Podcast Downloaded (${ChannelID})$([Environment]::NewLine)${strTitle}$([Environment]::NewLine)$([Environment]::NewLine)---------------------------------------------------------------$([Environment]::NewLine)$([Environment]::NewLine)${strDescription}";

# $htmltext = "${strTitle}$([Environment]::NewLine)$([Environment]::NewLine)---------------------------------------------------------------$([Environment]::NewLine)$([Environment]::NewLine)${strDescription}";
# Out-File -FilePath "/config/pushovernotify.txt" -InputObject $htmltext;
# cat /config/pushovernotify.txt | msmtp -a gmail [email protected]
Expand Down Expand Up @@ -679,8 +677,6 @@ Catch {
Write-to_Log -title "Exception" -content "$ErrMsgException";
$ErrorBody = "*********************************** ERROR ***********************************$([Environment]::NewLine)$([Environment]::NewLine)CategoryInfo: $(ErrMsgCategoryInfo)$([Environment]::NewLine)TargetObject: $(ErrMsgTargetObject)$([Environment]::NewLine)InvocationInfo: $(ErrMsgInvocationInfo)$([Environment]::NewLine)--------------------$([Environment]::NewLine)ScriptStackTrace: $(ErrMsgScriptStackTrace)$([Environment]::NewLine)--------------------$([Environment]::NewLine)ErrorDetails: $(ErrMsgErrorDetails)$([Environment]::NewLine)--------------------$([Environment]::NewLine)Exception: $(ErrMsgException)";
Stop-Transcript;
# Send-ToEmail-Error -email "[email protected]" -subject "Script Error (${ScriptName})" -body "$ErrorBody" -AttFile "$LogFile";
# $htmltext = "From: [email protected]$([Environment]::NewLine)To: [email protected]$([Environment]::NewLine)Subject: Script Error ($(ScriptName))$([Environment]::NewLine)${ErrorBody}";
$htmltext = "${ErrorBody}";
Out-File -FilePath "/config/scripterroremail.txt" -InputObject $htmltext;
Break
Expand Down

0 comments on commit 73e3d43

Please sign in to comment.