LiveTV support (both DVR and free Plex streaming/IPTV) - Requesting code review#543
LiveTV support (both DVR and free Plex streaming/IPTV) - Requesting code review#543nwithan8 wants to merge 23 commits intopushingkarmaorg:masterfrom
Conversation
Catch-up
plexapi/video.py
Outdated
| """ Load attribute values from Plex XML response. """ | ||
| self._data = data | ||
| self.listType = 'video' | ||
| self.guid = data.attrib.get('guid') |
There was a problem hiding this comment.
Im not sold on the changed to the video class. This is getting reusing many places. Would it be better for subclass used own class for live tv/recordings) ? Im not sure.
There was a problem hiding this comment.
Hasn't given me an issue, but I can subclass it just to make sure
There was a problem hiding this comment.
Strike that, the TAG and type are the same for Live videos and non-live videos, so I can't register a new Plex object. Plex doesn't make a distinction between them, so I think it's safe to just add the guid and live attributes, and the record method (checks if video is live first)
|
Nice work. Livetv etc support has been non existent because no contributer have used it. :) |
|
Thanks for the feedback. I will make the necessary changes. |
|
@nwithan8 any updates? I have a tuner setup and am willing to test. |
|
@blacktwin been meaning to get back to this, got sidetracked with other projects. If you want to have a look over, be my guest. |
|
Has there been any progress with this feature addition? |
|
Waiting on @pkkid or @Hellowlol |
|
The PR has merge conflicts. Those will need to be addressed first. |
|
Is anybody working on fixing the conflicts? Many thanks in advance |
Addressed |
|
Thanks @nwithan8, Much appreciate it! |
Here's a code snippet that I was using to test: |
|
Thanks again @nwithan8, Much appreciate your help. |
|
By the way, after making the changes manually, if I run a simple script to list all movies in my library I get the following message for each item found in the search: Here is my code to do the search: Please note that if I use original files, the same simple search script runs flawlessly. Cheers |
|
@nwithan8 Maybe it's me but is how you'd get to the guide? plex = PlexServer(PLEX_URL, PLEX_TOKEN)
live = plex.livetv
dvr = live.dvrs[0]
print(live.guide())I'm getting I'm thinking that you |
I also got the same error when I tried to load the guide. |
…ts.Response object if needed
…ocal XMLTV guide))
|
It seems some things have changed with Plex since I started this, so I'm working on updating it. Turns out the "cloud key" is different if you're using the ZIP Code guide versus the local XMLTV path guide, so I'm having to account for that. The code for this PR is still in progress. Should I/How do I retract/remove this PR request in the meantime? |
|
Change the PR to a draft. The link is beneath the reviewers at the top right. |
|
Hi @nwithan8, Thanks |
| class Setting(PlexObject): | ||
| """ Represents a single DVRDevice Setting.""" | ||
|
|
||
| TAG = 'Setting' |
There was a problem hiding this comment.
This conflicts with Setting(PlexObject) in settings.py
| self.channelTitle = data.attrib.get('channelTitle') | ||
| self.beginsAt = utils.toDatetime(data.attrib.get('beginsAt')) | ||
| self.endsAt = utils.toDatetime(data.attrib.get('endsAt')) | ||
| self.onAir = cast(int, data.attrib.get('onAir')) |
There was a problem hiding this comment.
self.onAir = **utils.**cast(int, data.attrib.get('onAir'))
Seconding @rockstar2020: Any news on this draft, @nwithan8? |
First time working with XML data. Seems rather straightforward once I understood how you handled parsing.
Have not written test files yet, waiting for feedback if you could give any.