I will check these links out. I just checked the first. What’s frustrating is, based on its wording, it starts by implying there is one (1) (singular) audio track in my video. This is at the heart of what I have been trying to figure out. (ExportTools code should show me. But I’ve been busy just using its output – not studying its code. Like I’ve said, I have a lot to learn. Of course the question is how much should I have to learn just to make simple decisions about my media?) Anyway, I will keep reading. I will add more to this post if there’s something relevant. Wait – one more thing. It does occur to me that what I think of as a movie is actually one of a list of videos. I could be confusing what’s a video with a movie, etc. Somehow there would be one movie per audio codec, but that combination is one instance of a list of another object. Whatever. My main point is I haven’t been able to divine this object hierarchy, and it runs counter to my intuition and what I’ve been reading online in the Python Plex API. I will continue reading these links, and perhaps end up studying code to see just what I am missing here. One interesting observation: unless I missed something, a video can have, say, “dca - dca - ac3” but when you look at the actual audio-codec field, it will say dca-ma. That “dca - dca - ac3” might really mean “dts-ma 5.1, dts 5.1, dolby stereo”. While I don’t understand why Plex chooses to use dca, I don’t understand why the output doesn’t say dca-ma for one of those dca’s! (I am not talking about which is currently seleted, which seems to be all N/A’s except for one “1”, and picks off the one out of the sequence “in use.”) I will read more…
FOLLOW-UP 1: I of course have used “Get Info,” but I never bothered to look at the XML. The XML and the Python Plex API are not completely in sync (it seems to me). But I should still be able to use the API to muddle through things. I can see the XML layout, and the stream information I have been looking for is in the XML, but it does NOT seem to be returned by the API. I have tried countless ways to get a the stream information. None have worked. Here is very simplified code template that shows what SHOULD WORK as far as I can tell. (NOTE: This is not how I would code this in practice, but it does show you an “object hierarchy” that I think should work to pull the streams.)
from plexapi.myplex import MyPlexAccount
account = MyPlexAccount('foo','bar')
plex = account.resource('fnord').connect() # returns a PlexServer instance ***ONLY*** if DISABLE REMOTE ACCESS is in effect!?!?!?
movies = plex.library.section('Movies')
movies.search()[0].media[0].parts[0].streams
[]
The list of streams is always empty! I have tried 90,000,000 ways to get this to work. I am beginning to wonder if there isn’t a bug in the Python Plex API. But still I muddle on…
P.S. I am quite happy with using ExportTools, and if I knew about it before I began this whole Python Plex API thing, we would probably not be having this discussion. I would still like to figure this API thing out, but ExportTools is quite adequate to solve the original problems I had.