fbrassin 35 Posted April 30, 2020 Share Posted April 30, 2020 If it is like that i cannot find anything like that nor in emby nor in radarr log Link to comment Share on other sites More sharing options...
Luke 37094 Posted April 30, 2020 Share Posted April 30, 2020 2019-08-17 16:43:25.341 Info HttpServer: HTTP POST http://emby-server:8096/mediabrowser/Library/Media/Updated. UserAgent: curl/7.58.02019-08-17 16:43:25.354 Debug LibraryMonitor: New file refresher created for /movies/Scary Movie 3 (2003) That looks good, right? Link to comment Share on other sites More sharing options...
fbrassin 35 Posted May 1, 2020 Share Posted May 1, 2020 I confirm the script is working. Tnx Link to comment Share on other sites More sharing options...
stuartgib 4 Posted August 22, 2020 Share Posted August 22, 2020 (edited) I've converted fizzyade's bash script into a powershell script for anyone else running sonarr/radarr on their windows pc and emby on a separate nas. #! /usr/bin/pwsh #EMBY $apiKey = "<your emby api key>" $url = "http://<emby server ip>:8096" #PATHS $local_tv_path = [regex]::escape("\\UNC\Media\TV Shows\") $local_movie_path = [regex]::escape("\\UNC\Media\Movies\") $remote_tv_path = "/volume1/Media/TV Shows/" $remote_movie_path = "/volume1/Media/Movies/" #SONARR $sonarr_episodefile_path = $env:sonarr_episodefile_path $sonarr_series_path = $env:sonarr_series_path $sonarr_eventtype = $env:sonarr_eventtype #RADARR $radarr_moviefile_path = $env:radarr_moviefile_path $radarr_movie_path = $env:radarr_movie_path $radarr_eventtype = $env:radarr_eventtype IF ([string]::IsNullOrWhitespace($apiKey)){ '*******************************' '* Error: No API Key specified.*' '*******************************' exit } IF ([string]::IsNullOrWhitespace($url)){ '********************************' '* Error: No Emby URL specified.*' '********************************' exit } IF ([string]::IsNullOrWhitespace($sonarr_eventtype) -and [string]::IsNullOrWhitespace($radarr_eventtype)){ '******************************************************************' '* Error: Must be called as a custom script from Sonarr or Radarr.*' '******************************************************************' exit } #SONARR if($sonarr_eventtype -eq 'Download' -or $sonarr_eventtype -eq 'Upgrade') { $UpdateType = "Series" $path = $sonarr_episodefile_path -replace $local_tv_path #strips the local tv path from the path $path = $path -replace "\\", "/" #substitutes back slashes with forward slashes to convert to uri format $path = $remote_tv_path + $path #adds the remote tv path to the uri #$path = $path -replace " ", "%20" #substitutes spaces with %20 }elseif($sonarr_eventtype -eq "Rename") { $UpdateType = "Series" $path = $sonarr_series_path -replace $local_tv_path $path = $path -replace "\\", "/" $path = $remote_tv_path + $path #$path = $path -replace " ", "%20" }elseif($sonarr_eventtype -eq "Test") { exit }elseif($radarr_eventtype -eq 'Download' -or $radarr_eventtype -eq 'Upgrade') { $UpdateType = "Movie" $path = $radarr_moviefile_path -replace $local_movie_path $path = $path -replace "\\", "/" $path = $remote_movie_path + $path #$path = $path -replace " ", "%20"h }elseif($radarr_eventtype -eq "Rename") { $UpdateType = "Movie" $path = $radarr_movie_path -replace $local_movie_path $path = $path -replace "\\", "/" $path = $remote_movie_path + $path #$path = $path -replace " ", "%20" }elseif($radarr_eventtype -eq "Test") { exit }else { # $UpdateType = $null } $postparams = '{"Updates":[{"Path":"' + $path + '","UpdateType":"' + $UpdateType + '"}]}' Invoke-WebRequest -uri "$url/emby/Library/Media/Updated?api_key=$apiKey" -ContentType "application/json" -Method POST -body $postparams Edited August 22, 2020 by stuartgib 1 Link to comment Share on other sites More sharing options...
fizzyade 124 Posted August 22, 2020 Author Share Posted August 22, 2020 16 hours ago, stuartgib said: I've converted fizzyade's bash script into a powershell script for anyone else running sonarr/radarr on their windows pc and emby on a separate nas. Awesome. Hopefully others will find it useful. Link to comment Share on other sites More sharing options...
CFC 25 Posted September 18, 2020 Share Posted September 18, 2020 On 8/21/2020 at 9:29 PM, stuartgib said: I've converted fizzyade's bash script into a powershell script for anyone else running sonarr/radarr on their windows pc and emby on a separate nas. #! /usr/bin/pwsh #EMBY $apiKey = "<your emby api key>" $url = "http://<emby server ip>:8096" #PATHS $local_tv_path = [regex]::escape("\\UNC\Media\TV Shows\") $local_movie_path = [regex]::escape("\\UNC\Media\Movies\") $remote_tv_path = "/volume1/Media/TV Shows/" $remote_movie_path = "/volume1/Media/Movies/" #SONARR $sonarr_episodefile_path = $env:sonarr_episodefile_path $sonarr_series_path = $env:sonarr_series_path $sonarr_eventtype = $env:sonarr_eventtype #RADARR $radarr_moviefile_path = $env:radarr_moviefile_path $radarr_movie_path = $env:radarr_movie_path $radarr_eventtype = $env:radarr_eventtype IF ([string]::IsNullOrWhitespace($apiKey)){ '*******************************' '* Error: No API Key specified.*' '*******************************' exit } IF ([string]::IsNullOrWhitespace($url)){ '********************************' '* Error: No Emby URL specified.*' '********************************' exit } IF ([string]::IsNullOrWhitespace($sonarr_eventtype) -and [string]::IsNullOrWhitespace($radarr_eventtype)){ '******************************************************************' '* Error: Must be called as a custom script from Sonarr or Radarr.*' '******************************************************************' exit } #SONARR if($sonarr_eventtype -eq 'Download' -or $sonarr_eventtype -eq 'Upgrade') { $UpdateType = "Series" $path = $sonarr_episodefile_path -replace $local_tv_path #strips the local tv path from the path $path = $path -replace "\\", "/" #substitutes back slashes with forward slashes to convert to uri format $path = $remote_tv_path + $path #adds the remote tv path to the uri #$path = $path -replace " ", "%20" #substitutes spaces with %20 }elseif($sonarr_eventtype -eq "Rename") { $UpdateType = "Series" $path = $sonarr_series_path -replace $local_tv_path $path = $path -replace "\\", "/" $path = $remote_tv_path + $path #$path = $path -replace " ", "%20" }elseif($sonarr_eventtype -eq "Test") { exit }elseif($radarr_eventtype -eq 'Download' -or $radarr_eventtype -eq 'Upgrade') { $UpdateType = "Movie" $path = $radarr_moviefile_path -replace $local_movie_path $path = $path -replace "\\", "/" $path = $remote_movie_path + $path #$path = $path -replace " ", "%20"h }elseif($radarr_eventtype -eq "Rename") { $UpdateType = "Movie" $path = $radarr_movie_path -replace $local_movie_path $path = $path -replace "\\", "/" $path = $remote_movie_path + $path #$path = $path -replace " ", "%20" }elseif($radarr_eventtype -eq "Test") { exit }else { # $UpdateType = $null } $postparams = '{"Updates":[{"Path":"' + $path + '","UpdateType":"' + $UpdateType + '"}]}' Invoke-WebRequest -uri "$url/emby/Library/Media/Updated?api_key=$apiKey" -ContentType "application/json" -Method POST -body $postparams What should be my approach since I'm in the opposite direction, running Sonarr/Radarr on FreeNAS and emby on a Windows PC? I think I should still use the @fizzyade's bash script, but may need to change the remote path. Could I get some guidance on that? Thanks for the help, CFC Link to comment Share on other sites More sharing options...
stuartgib 4 Posted October 5, 2020 Share Posted October 5, 2020 You'll need to run fizzyades bash script on a freenas machine. I'm not sure if there is a way to run powershell on that machine. You might need to convert the forward slashes in the uri into backslashes for windows to recognize it. if [ "$sonarr_eventtype" == "Download" ]; then UpdateType="Series" Path=$(echo "$sonarr_episodefile_path" | sed "s|$local_tv_path|$remote_tv_path|") Path=$(echo "$sonarr_episodefile_path" | sed -e "s/\\/\//g") fi I'd start with that and see how you go, but i'm not familiar enough with bash to know if i've fucked it up. You would add that second path substitution in each event type. 1 Link to comment Share on other sites More sharing options...
laffinalldaway 0 Posted May 20, 2021 Share Posted May 20, 2021 Hello. I have tried the bash script method, but when I chose the "script.sh" file (which I have CHMOD'd it), I get the "file/directory does not exist" prompt on radarr/sonarr. Would anyone have any idea what I may be doing wrong? radarr/sonarr is running in my Unraid server, while emby is running on Ubuntu on another machine. I have added a path to both radarr/sonarr docker to point to a folder where the bash script is located. The pull down in the file selection section in the Custom script window shows me the script.sh and allows me to select it. Unfortunately, I am told it does not exist. Link to comment Share on other sites More sharing options...
Luke 37094 Posted May 25, 2021 Share Posted May 25, 2021 On 5/20/2021 at 6:13 PM, laffinalldaway said: Hello. I have tried the bash script method, but when I chose the "script.sh" file (which I have CHMOD'd it), I get the "file/directory does not exist" prompt on radarr/sonarr. Would anyone have any idea what I may be doing wrong? radarr/sonarr is running in my Unraid server, while emby is running on Ubuntu on another machine. I have added a path to both radarr/sonarr docker to point to a folder where the bash script is located. The pull down in the file selection section in the Custom script window shows me the script.sh and allows me to select it. Unfortunately, I am told it does not exist. Hi, are you sure the path is valid? Link to comment Share on other sites More sharing options...
laffinalldaway 0 Posted May 25, 2021 Share Posted May 25, 2021 1 hour ago, Luke said: Hi, are you sure the path is valid? It should be. I added a host path in docker on unraid machine. When attempting to add a custom script connection, I manually add the path. I get the warning. I also tried to select file. Same result. Link to comment Share on other sites More sharing options...
fizzyade 124 Posted May 26, 2021 Author Share Posted May 26, 2021 (edited) And that folder unraid has been set as a mapped path on your container to /scripts ? Edited May 26, 2021 by fizzyade Link to comment Share on other sites More sharing options...
laffinalldaway 0 Posted May 26, 2021 Share Posted May 26, 2021 Yes i did. This is the radarr container settings. Link to comment Share on other sites More sharing options...
fizzyade 124 Posted May 26, 2021 Author Share Posted May 26, 2021 And are the permissions set correctly on the folder and the script itself? Link to comment Share on other sites More sharing options...
laffinalldaway 0 Posted May 26, 2021 Share Posted May 26, 2021 50 minutes ago, fizzyade said: And are the permissions set correctly on the folder and the script itself? I used chmod. I ran into the current problem. When that didn't work, I tried "Fix Permission" in Unraid, to make sure all permissions were set correctly. Link to comment Share on other sites More sharing options...
fizzyade 124 Posted May 26, 2021 Author Share Posted May 26, 2021 42 minutes ago, laffinalldaway said: I used chmod. I ran into the current problem. When that didn't work, I tried "Fix Permission" in Unraid, to make sure all permissions were set correctly. Open a console in the docker container and check you can run the script, it's possible you've got an issue with UID/GID mappings or something, I can't think of anything else to be honest, from your description it sounds like it should work, opening a terminal inside the container will let you poke around and ensure that everything is actually as you think it is. Link to comment Share on other sites More sharing options...
anontv 0 Posted August 17, 2021 Share Posted August 17, 2021 Anyway to add a sleep to script so items have time to upload? Link to comment Share on other sites More sharing options...
SkinnyT 1 Posted December 7, 2021 Share Posted December 7, 2021 Is this script still relevant? I just moved all of my aRR's off of my windows server, which Emby still resides on. The aRR's are now running on my NAS in Docker. Since switching everything over, updates have just not been working for me. I feel like I've thrown just about everything that I can at it with no luck. Any help would be much appreciated Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now