|
|
@ -9,6 +9,7 @@ tmdbApiKey="3b7751e3179f796565d88fdb2fcdf426"
|
|
|
|
#trailerLanguages=en
|
|
|
|
#trailerLanguages=en
|
|
|
|
#trailerExtrasType=all
|
|
|
|
#trailerExtrasType=all
|
|
|
|
#trailerOfficialOnly=true
|
|
|
|
#trailerOfficialOnly=true
|
|
|
|
|
|
|
|
#trailerSingle=true
|
|
|
|
|
|
|
|
|
|
|
|
if [ -z "$arrUrl" ] || [ -z "$arrApiKey" ]; then
|
|
|
|
if [ -z "$arrUrl" ] || [ -z "$arrApiKey" ]; then
|
|
|
|
arrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)"
|
|
|
|
arrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)"
|
|
|
@ -54,7 +55,6 @@ itemTitle=$(echo "$arrItemData" | jq -r .title)
|
|
|
|
itemHasFile=$(echo "$arrItemData" | jq -r .hasFile)
|
|
|
|
itemHasFile=$(echo "$arrItemData" | jq -r .hasFile)
|
|
|
|
itemPath="$(echo "$arrItemData" | jq -r ".path")"
|
|
|
|
itemPath="$(echo "$arrItemData" | jq -r ".path")"
|
|
|
|
itemTrailerId="$(echo "$arrItemData" | jq -r ".youTubeTrailerId")"
|
|
|
|
itemTrailerId="$(echo "$arrItemData" | jq -r ".youTubeTrailerId")"
|
|
|
|
itemTrailerurl="https://www.youtube.com/watch?v=$itemTrailerId"
|
|
|
|
|
|
|
|
tmdbId="$(echo "$arrItemData" | jq -r ".tmdbId")"
|
|
|
|
tmdbId="$(echo "$arrItemData" | jq -r ".tmdbId")"
|
|
|
|
|
|
|
|
|
|
|
|
echo "$arrItemData"
|
|
|
|
echo "$arrItemData"
|
|
|
@ -76,6 +76,19 @@ fi
|
|
|
|
tmdbVideosListData=$(curl -s "https://api.themoviedb.org/3/movie/$tmdbId/videos?api_key=$tmdbApiKey&language=jp" | jq -r '.results[] | select(.site=="YouTube")')
|
|
|
|
tmdbVideosListData=$(curl -s "https://api.themoviedb.org/3/movie/$tmdbId/videos?api_key=$tmdbApiKey&language=jp" | jq -r '.results[] | select(.site=="YouTube")')
|
|
|
|
echo "$tmdbVideosListData"
|
|
|
|
echo "$tmdbVideosListData"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ ! -f "$itemPath/Trailer-trailer.mkv" ]; then
|
|
|
|
|
|
|
|
if [ ! -z "$cookiesFile" ]; then
|
|
|
|
|
|
|
|
yt-dlp --cookies "$cookiesFile" -o "$itemPath/Trailer-trailer" --write-sub --sub-lang $trailerLanguages --embed-subs --merge-output-format mkv --no-mtime --geo-bypass "https://www.youtube.com/watch?v=$itemTrailerId"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
yt-dlp -o "$itemPath/Trailer-trailer" --write-sub --sub-lang $trailerLanguages --embed-subs --merge-output-format mkv --no-mtime --geo-bypass "https://www.youtube.com/watch?v=$itemTrailerId"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$trailerSingle" == "true" ]; then
|
|
|
|
|
|
|
|
exit
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IFS=',' read -r -a filters <<< "$trailerLanguages"
|
|
|
|
IFS=',' read -r -a filters <<< "$trailerLanguages"
|
|
|
|
for filter in "${filters[@]}"
|
|
|
|
for filter in "${filters[@]}"
|
|
|
|
do
|
|
|
|
do
|
|
|
@ -123,10 +136,9 @@ for id in $(echo "$tmdbVideosListDataIds"); do
|
|
|
|
fileSuffix=behindthescenes
|
|
|
|
fileSuffix=behindthescenes
|
|
|
|
elif [ "$themoviedbvidetype" == "Clip" ]; then
|
|
|
|
elif [ "$themoviedbvidetype" == "Clip" ]; then
|
|
|
|
fileSuffix=clip
|
|
|
|
fileSuffix=clip
|
|
|
|
elif [ "$themoviedbvidetype" == "Bloopers" ]; then
|
|
|
|
elif [ "$themoviedbvidetype" == "Bloopers" ]; then
|
|
|
|
fileSuffix=scene
|
|
|
|
fileSuffix=scene
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
echo "$tmdbExtraTitleClean-$fileSuffix.mkv"
|
|
|
|
|
|
|
|
log "$itemTitle :: $i of $tmdbVideosListDataIdsCount :: $tmdbExtraType :: $tmdbExtraTitle ($tmdbExtraKey)"
|
|
|
|
log "$itemTitle :: $i of $tmdbVideosListDataIdsCount :: $tmdbExtraType :: $tmdbExtraTitle ($tmdbExtraKey)"
|
|
|
|
if [ ! -z "$cookiesFile" ]; then
|
|
|
|
if [ ! -z "$cookiesFile" ]; then
|
|
|
|
yt-dlp --cookies "$cookiesFile" -o "$itemPath/$tmdbExtraTitleClean-$fileSuffix" --write-sub --sub-lang $trailerLanguages --embed-subs --merge-output-format mkv --no-mtime --geo-bypass "https://www.youtube.com/watch?v=$tmdbExtraKey"
|
|
|
|
yt-dlp --cookies "$cookiesFile" -o "$itemPath/$tmdbExtraTitleClean-$fileSuffix" --write-sub --sub-lang $trailerLanguages --embed-subs --merge-output-format mkv --no-mtime --geo-bypass "https://www.youtube.com/watch?v=$tmdbExtraKey"
|
|
|
|