Jump to content

Running Emby on Apple TV 3


sw1tchm4st3r

Recommended Posts

How do I get all the items in the TV collection for example, the friendlyname not the actual directory name?

 

Got it to request virtual folders, not yet parsed it:

 

17:13:14 PlexAPI: xargs: {'X-Plex-Token': 'gJQ25gK2hTJqY8DJmtf8', 'X-Plex-Platform': 'iOS', 'X-Plex-Model': '3,1', 'X-Plex-Client-Platform': 'iOS', 'X-Plex-Client-Identifier': 'DY5xxxxxxxxx', 'X-Plex-Device': 'AppleTV', 'X-Plex-Product': 'PlexConnect', 'X-Plex-Platform-Version': '6.0.2', 'X-Plex-Version': '0.3.1+'}
17:13:14 PlexAPI: ====== received PMS-XML ======
  <ns0:VirtualFolderInfo>
    <ns0:CollectionType>movies</ns0:CollectionType>
    <ns0:Locations>
      <ns1:string>Q:\VIDs\Movies</ns1:string>
 
    </ns0:Locations>
    <ns0:Name>Movies</ns0:Name>
  </ns0:VirtualFolderInfo>
  <ns0:VirtualFolderInfo>
    <ns0:CollectionType>tvshows</ns0:CollectionType>
    <ns0:Locations>
      <ns1:string>Q:\TV</ns1:string>
    </ns0:Locations>
    <ns0:Name>TV</ns0:Name>
  </ns0:VirtualFolderInfo>
  <ns0:VirtualFolderInfo>
    <ns0:CollectionType xsi:nil="true" />
    <ns0:Locations>
      <ns1:string>Q:\VIDs\MMA\UFC</ns1:string>
    </ns0:Locations>
    <ns0:Name>UFC</ns0:Name>
  </ns0:VirtualFolderInfo>
</ns0:ArrayOfVirtualFolderInfo>
 
17:13:14 PlexAPI: ====== PMS-XML finished ======
 
Will continue on this after UFC tonight. :)
Edited by BC101
  • Like 2
Link to comment
Share on other sites

Cheesegeezer

@@BC101 hats off to you fella, i'm very impressed with how far you've gone with this. Please dont give up!

 

Well done and keep up the great work :D

  • Like 2
Link to comment
Share on other sites

problem is the XML that MediaBrowser3 outputs is not compatible with the ElementTree python library im using :\

e.x.

  <ns0:VirtualFolderInfo>
    <ns0:CollectionType>movies</ns0:CollectionType>
    <ns0:Locations>
      <ns1:string>Q:\VIDs\Movies</ns1:string>
      <ns1:string>Q:\VIDs\Standup</ns1:string>
    </ns0:Locations>
    <ns0:Name>Movies</ns0:Name>
  </ns0:VirtualFolderInfo>
  <ns0:VirtualFolderInfo>
    <ns0:CollectionType>tvshows</ns0:CollectionType>
    <ns0:Locations>
      <ns1:string>Q:\TV</ns1:string>
    </ns0:Locations>
    <ns0:Name>TV</ns0:Name>
  </ns0:VirtualFolderInfo>
  <ns0:VirtualFolderInfo>
    <ns0:CollectionType xsi:nil="true" />
    <ns0:Locations>
      <ns1:string>Q:\VIDs\MMA\UFC</ns1:string>
    </ns0:Locations>
    <ns0:Name>UFC</ns0:Name>
  </ns0:VirtualFolderInfo>
</ns0:ArrayOfVirtualFolderInfo>

 

 

 

>>> t2 = ET.ElementTree(file='t2.txt')
>>> t2.getroot()
<Element '{http://schemas.datacontract.org/2004/07/MediaBrowser.Model.Entities}ArrayOfVirtualFolderInfo' at 0x0000000002B53870>
>>> s2 = t2.getroot()
 

If i make the XML more standard it works:

consider fake xml:

<?xml version="1.0"?>
<ArrayOfVirtualFolderInfo>
</ArrayOfVirtualFolderInfo>
 
>>> tree = ET.ElementTree(file='t.txt')
>>> r2 = tree.getroot()
>>> print r2.tag
ArrayOfVirtualFolderInfo
>>> print r2.attrib
{}
>>> 
 
So now i find a way to make it work
Link to comment
Share on other sites

i think its a bug that the xmlconverter is adding extraneous information, need to hunt that down because natively ns0: / ns1: shouldnt be in the xml output.

Link to comment
Share on other sites

I think I found it, parse Items.xml (call /mediabrowser/Users/$userid/Items.xml )

 

>>> for elem in t2.iter():
blah = str(elem.tag)
if (blah.endswith("}Name")) or (blah.endswith("}Id")):
print elem.tag, elem.text
 
 
 
Now to enumerate TV folder, id a4cce7c32133d8344de10518e19ce2ef to show all 40 subfolders (which are the shows themselves)?
Link to comment
Share on other sites

Just need someone pro with python's ElementTree to lend a hand and will have this going in no time, I'm just not experienced enough to know how to add elements at certain positions according to some state.

http://docs.python.org/2/library/xml.etree.elementtree.html#xml.etree.ElementTree.SubElement

 

for reference

Edited by BC101
Link to comment
Share on other sites

Got a Grid view (7 per row) working (demo shows it for Movies).

New YouTube video demo'ing that is on its way!

 

Thanks for the words of encouragement and support so far. Great community.

Edited by BC101
Link to comment
Share on other sites

We will be supporting separate srt sub stream soon (ish) will that help you out?

How? Do you have example API calls or something for that?

 

I'll be experimenting with that js code to implement subtitles outside of MB3. Will be interesting to see how that goes.

 

https://code.google.com/p/hdweb/source/browse/ATV/ce/media.js has some subtitle code in it as well that might be useful

Edited by BC101
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...