plittlefield 56 Posted July 17, 2025 Posted July 17, 2025 Is there a way to get the series number and episode number from the API when someone is playing content? I already have this, to get the User, Series Name and Title ... wget -q -O - "http://localhost:8096/emby/Sessions?api_key=3469e31bbxxxxxxxxxxxxxxxxxxxx" | jq -r -M '.[] | {UserName, SeriesName: .NowPlayingItem.SeriesName, Name: .NowPlayingItem.Name} | select(.Name != null) | {user: .UserName, item: ((if .SeriesName then .SeriesName + " ~ " else "" end) + .Name)} | map(.) | @csv' ... which gives me ... "Paul","Severance: Goodbye, Mrs. Selvig" ... but would like the 'S2E2' information please. Thanks, Paully
plittlefield 56 Posted July 17, 2025 Author Posted July 17, 2025 Ah, yes ... "PlaylistIndex": 1, "IndexNumber": 2, "ParentIndexNumber": 2, ... so I am guessing that the ParentIndexNumber is the Season and the IndexNumber is the Episode? 1
Luke 42077 Posted July 17, 2025 Posted July 17, 2025 6 minutes ago, plittlefield said: Ah, yes ... "PlaylistIndex": 1, "IndexNumber": 2, "ParentIndexNumber": 2, ... so I am guessing that the ParentIndexNumber is the Season and the IndexNumber is the Episode? Yes exactly. 1
plittlefield 56 Posted July 17, 2025 Author Posted July 17, 2025 Great, I will give that a go and report back tomorrow with my edited script 1
plittlefield 56 Posted July 20, 2025 Author Posted July 20, 2025 Here is the tweaked bash script command line ... wget -q -O - "http://localhost:8096/emby/Sessions?api_key=xxxxxxxxxxxxxxxxxxx" | jq -r -M '.[] | {UserName, SeriesName: .NowPlayingItem.SeriesName, Name: .NowPlayingItem.Name, Season: .NowPlayingItem.ParentIndexNumber, Episode: .NowPlayingItem.IndexNumber} | select(.Name != null) | {user: .UserName, item: ((if .SeriesName then .SeriesName + " ~ " + "S" + (.Season|tostring) + "E" + (.Episode|tostring) + " ~ " else "" end) + .Name)} | map(.) | @csv' ... which now gives this output ... "Paul","Severance ~ S2E2 ~ Goodbye, Mrs. Selvig" 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