diff --git a/lidarr/Video.service.bash b/lidarr/Video.service.bash index 64c9e64a..b7ff95dd 100644 --- a/lidarr/Video.service.bash +++ b/lidarr/Video.service.bash @@ -226,9 +226,14 @@ DownloadVideo () { ytdlpConfigurableArgs="$ytdlpConfigurableArgs --write-info-json " fi + ytdlpMaxFileSize="" + if [ "${extrasMaxFileSize::-1}" -gt 0 ]; then + ytdlpMaxFileSize+="--max-filesize $extrasMaxFileSize" + fi + if echo "$1" | grep -i "youtube" | read; then if [ $videoContainer = mkv ]; then - yt-dlp -f "$videoFormat" --no-video-multistreams -o "$videoDownloadPath/incomplete/${2}${3}" $ytdlpConfigurableArgs --embed-subs --sub-lang $youtubeSubtitleLanguage --merge-output-format mkv --remux-video mkv --no-mtime --geo-bypass "$1" + yt-dlp -f "$videoFormat" --no-video-multistreams -o "$videoDownloadPath/incomplete/${2}${3}" $ytdlpConfigurableArgs --embed-subs --sub-lang $youtubeSubtitleLanguage --merge-output-format mkv --remux-video mkv $ytdlpMaxFileSize --no-mtime --geo-bypass "$1" if [ -f "$videoDownloadPath/incomplete/${2}${3}.mkv" ]; then chmod 666 "$videoDownloadPath/incomplete/${2}${3}.mkv" downloadFailed=false @@ -236,7 +241,7 @@ DownloadVideo () { downloadFailed=true fi else - yt-dlp --format-sort ext:mp4:m4a --merge-output-format mp4 --no-video-multistreams -o "$videoDownloadPath/incomplete/${2}${3}" $ytdlpConfigurableArgs --embed-subs --sub-lang $youtubeSubtitleLanguage --no-mtime --geo-bypass "$1" + yt-dlp --format-sort ext:mp4:m4a --merge-output-format mp4 --no-video-multistreams -o "$videoDownloadPath/incomplete/${2}${3}" $ytdlpConfigurableArgs --embed-subs --sub-lang $youtubeSubtitleLanguage $ytdlpMaxFileSize --no-mtime --geo-bypass "$1" if [ -f "$videoDownloadPath/incomplete/${2}${3}.mp4" ]; then chmod 666 "$videoDownloadPath/incomplete/${2}${3}.mp4" downloadFailed=false diff --git a/radarr/Extras.bash b/radarr/Extras.bash index 07a02d7b..336a41a3 100644 --- a/radarr/Extras.bash +++ b/radarr/Extras.bash @@ -201,11 +201,15 @@ do mkdir -p "$tempFolder" fi + ytdlpMaxFileSize="" + if [ "${extrasMaxFileSize::-1}" -gt 0 ]; then + ytdlpMaxFileSize+="--max-filesize $extrasMaxFileSize" + fi log "$itemTitle :: $i of $tmdbVideosListDataIdsCount :: $tmdbExtraType :: $tmdbExtraTitle ($tmdbExtraKey) :: Downloading (yt-dlp :: $videoFormat)..." if [ ! -z "$cookiesFile" ]; then - yt-dlp -f "$videoFormat" --no-video-multistreams --cookies "$cookiesFile" -o "$tempFolder/$finalFileName" --write-sub --sub-lang $videoLanguages --embed-subs --merge-output-format mkv --no-mtime --geo-bypass $ytdlpExtraOpts "https://www.youtube.com/watch?v=$tmdbExtraKey" + yt-dlp -f "$videoFormat" --no-video-multistreams --cookies "$cookiesFile" -o "$tempFolder/$finalFileName" --write-sub --sub-lang $videoLanguages --embed-subs --merge-output-format mkv --no-mtime --geo-bypass $ytdlpExtraOpts $ytdlpMaxFileSize "https://www.youtube.com/watch?v=$tmdbExtraKey" else - yt-dlp -f "$videoFormat" --no-video-multistreams -o "$tempFolder/$finalFileName" --write-sub --sub-lang $videoLanguages --embed-subs --merge-output-format mkv --no-mtime --geo-bypass $ytdlpExtraOpts "https://www.youtube.com/watch?v=$tmdbExtraKey" + yt-dlp -f "$videoFormat" --no-video-multistreams -o "$tempFolder/$finalFileName" --write-sub --sub-lang $videoLanguages --embed-subs --merge-output-format mkv --no-mtime --geo-bypass $ytdlpExtraOpts $ytdlpMaxFileSize "https://www.youtube.com/watch?v=$tmdbExtraKey" fi if [ -f "$tempFolder/$finalFileName.mkv" ]; then log "$itemTitle :: $i of $tmdbVideosListDataIdsCount :: $tmdbExtraType :: $tmdbExtraTitle ($tmdbExtraKey) :: Compete" diff --git a/sonarr/Extras.bash b/sonarr/Extras.bash index 3c968609..86057e8f 100644 --- a/sonarr/Extras.bash +++ b/sonarr/Extras.bash @@ -146,11 +146,16 @@ DownloadExtras () { mkdir -p "$tempFolder" fi + ytdlpMaxFileSize="" + if [ "${extrasMaxFileSize::-1}" -gt 0 ]; then + ytdlpMaxFileSize+="--max-filesize $extrasMaxFileSize" + fi + log "$itemTitle :: $i of $tmdbVideosListDataIdsCount :: $tmdbExtraType :: $tmdbExtraTitle ($tmdbExtraKey) :: Downloading (yt-dlp :: $videoFormat)..." if [ ! -z "$cookiesFile" ]; then - yt-dlp -f "$videoFormat" --no-video-multistreams --cookies "$cookiesFile" -o "$tempFolder/$finalFileName" --write-sub --sub-lang $videoLanguages --embed-subs --merge-output-format mkv --no-mtime --geo-bypass $ytdlpExtraOpts "https://www.youtube.com/watch?v=$tmdbExtraKey" 2>&1 | tee -a /config/logs/$scriptName.txt + yt-dlp -f "$videoFormat" --no-video-multistreams --cookies "$cookiesFile" -o "$tempFolder/$finalFileName" --write-sub --sub-lang $videoLanguages --embed-subs --merge-output-format mkv --no-mtime --geo-bypass $ytdlpExtraOpts $ytdlpMaxFileSize "https://www.youtube.com/watch?v=$tmdbExtraKey" 2>&1 | tee -a /config/logs/$scriptName.txt else - yt-dlp -f "$videoFormat" --no-video-multistreams -o "$tempFolder/$finalFileName" --write-sub --sub-lang $videoLanguages --embed-subs --merge-output-format mkv --no-mtime --geo-bypass $ytdlpExtraOpts "https://www.youtube.com/watch?v=$tmdbExtraKey" 2>&1 | tee -a /config/logs/$scriptName.txt + yt-dlp -f "$videoFormat" --no-video-multistreams -o "$tempFolder/$finalFileName" --write-sub --sub-lang $videoLanguages --embed-subs --merge-output-format mkv --no-mtime --geo-bypass $ytdlpExtraOpts $ytdlpMaxFileSize "https://www.youtube.com/watch?v=$tmdbExtraKey" 2>&1 | tee -a /config/logs/$scriptName.txt fi if [ -f "$tempFolder/$finalFileName.mkv" ]; then log "$itemTitle :: $i of $tmdbVideosListDataIdsCount :: $tmdbExtraType :: $tmdbExtraTitle ($tmdbExtraKey) :: Compete" diff --git a/sonarr/extended.conf b/sonarr/extended.conf index 4accb5b7..7c3b5e0f 100644 --- a/sonarr/extended.conf +++ b/sonarr/extended.conf @@ -29,7 +29,7 @@ configureNaming="false" extrasLanguages="en-US" # Set the desired language for Extras, all languages will be processed... (this is a "," separated list of TMDB language codes, get the code from there sites language opitons, example: en-US) extrasType="all" # all or trailers :: all downloads all available videos (trailers, clips, featurette, etc...) :: trailers only downloads trailers extrasOfficialOnly="false" # true = enabled :: Skips extras that are not considered/marked as Official from TMDB site. - +extrasMaxFileSize="" # Set the max filesize for downloaded extras. Syntax: 100M for 100 megabytes, 1G for 1 gigabyte, 100K for 100 kilobytes, etc. See --max-filesize: https://github.com/yt-dlp/yt-dlp#video-selection ##### DailySeriesEpisodeTrimmer SCRIPT maximumDailyEpisodes="7" # number of episodes to keep when using DailySeriesEpisodeTrimmer script sonarrSeriesEpisodeTrimmerTag="" # set to a single sonarr series tag (case sensitive). This allows the script to process non-daily series type series that have a matching tag. For non-daily series, the entire season is kept and the maximum episodes setting is ignored.