BC101 31 Posted December 29, 2013 Share Posted December 29, 2013 (edited) 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: URL: http://192.168.1.125:8096/mediabrowser/Library/VirtualFolders.xml 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 ====== 17:13:14 PlexAPI: <ns0:ArrayOfVirtualFolderInfo xmlns:ns0="http://schemas.datacontract.org/2004/07/MediaBrowser.Model.Entities" xmlns:ns1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <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 December 29, 2013 by BC101 2 Link to comment Share on other sites More sharing options...
Cheesegeezer 3087 Posted December 30, 2013 Share Posted December 30, 2013 @@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 2 Link to comment Share on other sites More sharing options...
BC101 31 Posted December 31, 2013 Share Posted December 31, 2013 problem is the XML that MediaBrowser3 outputs is not compatible with the ElementTree python library im using :\ e.x. <ns0:ArrayOfVirtualFolderInfo xmlns:ns0="http://schemas.datacontract.org/2004/07/MediaBrowser.Model.Entities" xmlns:ns1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <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() >>> print s2.tag {http://schemas.datacontract.org/2004/07/MediaBrowser.Model.Entities}ArrayOfVirtualFolderInfo >>> print s2.attrib {} 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 More sharing options...
Luke 37095 Posted December 31, 2013 Share Posted December 31, 2013 why not just get json? Link to comment Share on other sites More sharing options...
BC101 31 Posted December 31, 2013 Share Posted December 31, 2013 (edited) The framework I'm hacking at uses XML only, no json. That's the only reason I'm not using json. You can see the original code at https://github.com/iBaa/PlexConnect/blob/master/XMLConverter.py Edited December 31, 2013 by BC101 1 Link to comment Share on other sites More sharing options...
BC101 31 Posted December 31, 2013 Share Posted December 31, 2013 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 More sharing options...
BC101 31 Posted December 31, 2013 Share Posted December 31, 2013 Got it. So how do i get the Collection of, for example, TV Shows using xml? I couldn't find the xml url Link to comment Share on other sites More sharing options...
BC101 31 Posted December 31, 2013 Share Posted December 31, 2013 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 {http://schemas.datacontract.org/2004/07/MediaBrowser.Model.Dto}Id 8dc319b746ea8f007d4bfcd231fde44e {http://schemas.datacontract.org/2004/07/MediaBrowser.Model.Dto}Name UFC {http://schemas.datacontract.org/2004/07/MediaBrowser.Model.Dto}Id a4cce7c32133d8344de10518e19ce2ef {http://schemas.datacontract.org/2004/07/MediaBrowser.Model.Dto}Name TV {http://schemas.datacontract.org/2004/07/MediaBrowser.Model.Dto}Id bc073fd852581495d10fe35fc7c0d17b {http://schemas.datacontract.org/2004/07/MediaBrowser.Model.Dto}Name Movies Now to enumerate TV folder, id a4cce7c32133d8344de10518e19ce2ef to show all 40 subfolders (which are the shows themselves)? Link to comment Share on other sites More sharing options...
BC101 31 Posted December 31, 2013 Share Posted December 31, 2013 oh i see, need to specify parentid in the Items.xml place i was already at... Link to comment Share on other sites More sharing options...
Luke 37095 Posted December 31, 2013 Share Posted December 31, 2013 if you're doing folder navigation, then you never really know what anything is. it could be just a folder. Link to comment Share on other sites More sharing options...
BC101 31 Posted December 31, 2013 Share Posted December 31, 2013 im trying to find best way to enumerate a Collection Link to comment Share on other sites More sharing options...
BC101 31 Posted December 31, 2013 Share Posted December 31, 2013 (edited) 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 December 31, 2013 by BC101 Link to comment Share on other sites More sharing options...
BC101 31 Posted January 1, 2014 Share Posted January 1, 2014 (edited) Made progress enumerating my TV directory and it displaying in a list. I think will have to limit it because my 40 folders took a while to render. Believe! http://www.youtube.com/watch?v=kxT4Ufis4ns Edited January 1, 2014 by BC101 2 Link to comment Share on other sites More sharing options...
BC101 31 Posted January 1, 2014 Share Posted January 1, 2014 (edited) 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 January 2, 2014 by BC101 Link to comment Share on other sites More sharing options...
BC101 31 Posted January 2, 2014 Share Posted January 2, 2014 It's 2014, MB3 should be competing with Plex (and NetFlix to a degree on the Apple TV by now... here's my progress enumerating Libraries, browsing to Movies, going to a grid view pulling all content from MB3: http://www.youtube.com/watch?v=hwgvZjxQWVc 5 Link to comment Share on other sites More sharing options...
MongooseMan 31 Posted January 2, 2014 Share Posted January 2, 2014 Link to comment Share on other sites More sharing options...
Cheesegeezer 3087 Posted January 3, 2014 Share Posted January 3, 2014 I've subscribed, mate you are doing great!! Link to comment Share on other sites More sharing options...
BC101 31 Posted January 3, 2014 Share Posted January 3, 2014 Well this should make development a bit easier, instead of having to test on the ATV every time, can test in this simulator: https://github.com/intrepidusgroup/rpi-atv , yay! 1 Link to comment Share on other sites More sharing options...
BC101 31 Posted January 5, 2014 Share Posted January 5, 2014 (edited) can use https://github.com/Yonsm/ATVME/blob/master/appletv/us/js/application.js code to potentially render subtitles like netflix does to overlay subs on the video rather than switch a video stream to an alternate with burned in subtitles. Edited January 5, 2014 by BC101 Link to comment Share on other sites More sharing options...
Tikuf 663 Posted January 5, 2014 Share Posted January 5, 2014 We will be supporting separate srt sub stream soon (ish) will that help you out? Link to comment Share on other sites More sharing options...
BC101 31 Posted January 5, 2014 Share Posted January 5, 2014 (edited) 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 January 5, 2014 by BC101 Link to comment Share on other sites More sharing options...
Tikuf 663 Posted January 5, 2014 Share Posted January 5, 2014 Ya there are no api calls yet but it is in the list so I would hold off with subs for now if you can. Link to comment Share on other sites More sharing options...
BC101 31 Posted January 5, 2014 Share Posted January 5, 2014 (edited) This is the most hacked up way I've ever seen to stream to appletv (see the source after looking at Process): https://code.google.com/p/appletv-mserver/wiki/Process even accounts for .srt 's (subtitles) Edited January 5, 2014 by BC101 1 Link to comment Share on other sites More sharing options...
BC101 31 Posted January 7, 2014 Share Posted January 7, 2014 I hope i can download the srt via the api. i do see GET /Videos/{Id}/Subtitle/{Index} in swagger UI now. 1 Link to comment Share on other sites More sharing options...
Luke 37095 Posted January 7, 2014 Share Posted January 7, 2014 yes that can be used to download external subtitle files 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