Cluttered 15 Posted July 30, 2025 Posted July 30, 2025 Apologies if this is the wrong place and apologies also for the length. --- I have a mac (Atlas) and a pc (BlackBox). I have got chronosync on the mac setup so all the media is kept up to date between the two boxes. With help from copilot I have generated numerous scripts to do checks on my servers: I generate a csv of all my TV programs and send it to obsidian to be picked up by a dataview, same for movies. I generate a list of all the media with their tags and collections. I look for problems like bad characters in filenames (Windows doesn't like " or ?, and | causes the unknown stream or something in playback). I check each library has the same items on both servers. If something is in a category say XYZ then I add a tag XYZ to it (and if it's a tv series all it's episodes) as tags are better supported i.e. smart playlists. I ensure that items I watched on one server are marked as watched on the other. I check if an item has multiple files so I can split them apart. Check the season number matches and allsorts of bits like that. I've been doing it a few weeks so I forget the details now. So they seem to be happy, all my media is on both and kept up to date, if I watch something on one it's watched on both etc. With one exception. Live TV timers. If I go to Live TV then Series from the top bar it lists 73 entries. I want to be able to do a couple of things: clear them all on a given server, otherwise both servers will grab a tuner and record them. synch the timers between boxes (probably not a good idea long term as they will both grab tuners) export them. import them (to either server). The idea being on BlackBox I can clear the timers so there's nothing there and they won't contend for the hdhomerun. But if Atlas is unavailable I could import the saved list to blackbox and off it would go. Copilot though is driving me mad, it always gives error 403 and I am getting nowhere (don't get me started on all the other issues like it throwing my code away and totally rewriting it at whim negating all my testing). I got it writing out the 73 timers, I also had it write out the channel names, channel internal ids, channel external ids and channel numbers. The idea being it would import the timers, then import the channel data and create a lookup table so it could check the imported timer data and make changes as required - so basically replace the channelid from atlas with the relevant one from blackbox but it always gives the 403 error. The users are the same name and ID, (Blackbox was restored from Atlas initially then i set up all the paths etc), the serverid's are different and the user has full access to everything, plus It has the api keys. Both boxes have the premiere key on it. It's just me, an ipad, a mac, a pc and an apple tv. Remote access is turned off I only want local access. I looked on the swagger thing at post for LiveTV/SeriesTimers which is hopefully the right one but I have no idea what to enter into the large structure. Can anyone give me some pointers. I have an example of a saved timer (I deleted it from blackbox so it has 72 and I could check it was imported) - one point I noticed is that the serverid in the json is neither of my servers, I don't believe I ever had another serverid as far as I am aware I created them all on Atlas quite some time ago: { ""RecordAnyTime"": true, ""SkipEpisodesInLibrary"": true, ""MatchExistingItemsWithAnyLibrary"": true, ""RecordAnyChannel"": false, ""KeepUpTo"": 0, ""MaxRecordingSeconds"": 0, ""RecordNewOnly"": true, ""ChannelIds"": [ ""387667"" ], ""Days"": [ ""Sunday"", ""Monday"", ""Tuesday"", ""Wednesday"", ""Thursday"", ""Friday"", ""Saturday"" ], ""ImageTags"": {}, ""SeriesId"": ""10829714"", ""Keywords"": [], ""TimerType"": ""Program"", ""Id"": ""1aeaccf9077c40fcbfd73a3b6a1a5e10"", ""Type"": ""SeriesTimer"", ""ServerId"": ""79ff99a4fc3549718267ae00a92d363e"", ""ChannelId"": ""387667"", ""ChannelName"": ""U&Dave"", ""ChannelNumber"": ""19"", ""ProgramId"": ""400828"", ""Name"": ""Alan Davies: As Yet Untitled"", ""Overview"": ""Comedian Alan Davies welcomes a group of comedians and presents interesting facts about the guests that descends into an unpredictable, entertaining conversation."", ""StartDate"": ""2023-11-07T23:40:00.0000000Z"", ""EndDate"": ""2023-11-08T00:40:00.0000000Z"", ""Priority"": 0, ""PrePaddingSeconds"": 120, ""PostPaddingSeconds"": 480, ""IsPrePaddingRequired"": false, ""IsPostPaddingRequired"": false, ""KeepUntil"": ""UntilDeleted"" }, And looking at the channels in the GUI I see: data from emby ui on atlas: number 19 internalid 387667 name U&Dave externalid hdhr_19 sortname U&Dave data from emby ui on blackbox: number 19 internalid 2702126 name U&Dave externalid hdhr_19 sortname U&Dave" Thank you for any help offered.
Cluttered 15 Posted July 30, 2025 Author Posted July 30, 2025 Got the delete bit to work. The server and port are for mine obviously. #Go to LiveTV then recording, add a recording, say ==TEST== and keyword Wibble. #Go to the series part, click on ==TEST== note the seriestimerid in the URL. Then back to the list. #Run this script, P1 is the user, P2 their password and P3 the seriestimerid #The timer should vanish from the list as you watch. # Step 1: Authenticate and save token token=$(curl -s -X POST http://blackbox.local:8095/Users/AuthenticateByName \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "X-Emby-Authorization: MediaBrowser Client=\"curl\", Device=\"Mark's Script\", DeviceId=\"sync-script-001\", Version=\"1.0\"" \ -d "Username=$1&Pw=$2" | jq -r .AccessToken) echo "$token" > token.txt # Step 2: Use token to delete timer curl -X DELETE http://blackbox.local:8095/LiveTv/SeriesTimers/$3 \ -H "X-Emby-Token: $token" rm token.txt So the API is unused which suggests a reason copilot's attempts all fail. I would prefer not having to use a password if possible. I still have no idea what to give the API to create the recordings but maybe this explains the 403 error from the .py script!
brothom 177 Posted July 30, 2025 Posted July 30, 2025 @Clutteredit sounds like you're trying to much more than just sync data between two installations. You're basically created a middleware platform to load data from one side, manipulate it to conform to other standards and sent it to another server. What exactly are you trying to achieve? If you wanted to simply "sync" you could just grab the files, put them in a clean install of Emby and copy the (old) Emby database probably so that users don't lose progress or whatever. Keep in mind that Emby uses the file structure to identify media - losing a path or drive might cause the data to be deleted anyway. Again, what exactly do you want to do? Create an mirror image of your Atlas's Emby installation and "paste" that onto your Blackbox PC's Emby?
Solution Cluttered 15 Posted July 30, 2025 Author Solution Posted July 30, 2025 I think it's now working the user authentication was the problem. I can now save/clear/restore my timers. I want two working emby servers, one on windows one on mac, and i want them to have the same media, watch status and all the rest I described. Anyway it's fine now. 1
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