Taxel / PlexTraktSync

A python script that syncs the movies, shows and ratings between trakt and Plex (without needing a PlexPass or Trakt VIP subscription)
MIT License
1.53k stars 100 forks source link

Feature Request: Exclude library "livetv" #770

Closed theChad6 closed 2 years ago

theChad6 commented 2 years ago

Discussed in https://github.com/Taxel/PlexTraktSync/discussions/768

Originally posted by **theChad6** February 1, 2022 PlexTraktSync [0.18.15] Plex Version 1.24.4.5081 (Windows 10) Synology NAS : DSM7 : Docker Ignore Live TV from sync. While playing LiveTV, these errors get pumped out every 10 seconds. Adding this snipit to config.json doesn't seem to work. ` "excluded-libraries": [ "Private", "Family Holidays", "Home Movies", "livetv" ]` theChad@synnas:/volume1/docker/appdata$ sudo docker-compose run --rm plextraktsync Creating trash-guides_plextraktsync_run ... done Listening for events! INFO: Starting AlertListener: wss://192-168-0-16.af24ef612f1342c19cb45edd07a8fd14.plex.direct:32400/:/websockets/notifications?X-Plex-Token= ERROR: : Unable to parse a valid provider from guid tv.plex.xmltv://episode/FOX%2010%20Arizona%20Morning/1900-01-01%2000%3A00%3A00 ERROR: : Unable to parse a valid provider from guid tv.plex.xmltv://episode/FOX%2010%20Arizona%20Morning/1900-01-01%2000%3A00%3A00
glensc commented 2 years ago

I can't seem to get anything playing with https://app.plex.tv/desktop/ in browser, stuck with a spinner.

Any docs what platforms or countries the live tv is supported?

so, enable debug logging and share a few lines with:

DEBUG[PlexTraktSync.EventDispatcher]
theChad6 commented 2 years ago

Plex Live TV is the same as their DVR service where you can hook up a tuner to Plex and stream live TV. In my case, I'm running a HDHomeRun ConnectDUO hooked to an antenna to pull local broadcast stations. That's backed by an EPG leveraging data from zap2it.com for a TV Guide. I'm not playing it from https://app.plex.tv/desktop/, rather I'm playing it directly from the server hosting Plex: http://127.0.0.1:32400/, although I don't think it would matter for this.

Here's some debug while playing an OTA broadcast:

2022-02-01 12:45:32,744 DEBUG[plexapi]:Alert: type size ActivityNotification 2022-02-01 12:45:32,744 DEBUG[PlexTraktSync.EventDispatcher]:{'type': 'activity', 'size': 1, 'ActivityNotification': [{'event': 'started', 'uuid': '1cf985a9-0d0c-446a-8085-2f60674ed02e', 'Activity': {'uuid': '1cf985a9-0d0c-446a-8085-2f60674ed02e', 'type': 'grabber.grab', 'cancellable': True, 'userID': 1, 'title': 'Recording', 'subtitle': 'Live TV - Session', 'progress': 0, 'Context': {'deviceID': '1', 'grabber': 'tv.plex.grabbers.hdhomerun', 'itemKey': '', 'itemMediaIndex': '0', 'itemRatingKey': '', 'source': 'provider://tv.plex.providers.epg.xmltv', 'subscriptionID': '1279'}}}]} 2022-02-01 12:45:34,313 DEBUG[plexapi]:Alert: type size TranscodeSession 2022-02-01 12:45:34,314 DEBUG[PlexTraktSync.EventDispatcher]:{'type': 'transcodeSession.start', 'size': 1, 'TranscodeSession': [{'key': '/transcode/sessions/5eafaf2c-3a96-481d-9b7e-30d421e9478b', 'throttled': False, 'complete': False, 'progress': 0.0, 'size': 0, 'speed': 0.0, 'error': False, 'duration': 7200000, 'context': 'static', 'sourceVideoCodec': '', 'sourceAudioCodec': '', 'videoDecision': 'copy', 'audioDecision': 'copy', 'protocol': 'hls', 'container': 'mpegts', 'videoCodec': '', 'audioCodec': '', 'audioChannels': 2, 'transcodeHwRequested': True, 'transcodeHwFullPipeline': False}]} 2022-02-01 12:45:34,324 DEBUG[plexapi]:Alert: type size TimelineEntry 2022-02-01 12:45:34,324 DEBUG[PlexTraktSync.EventDispatcher]:{'type': 'timeline', 'size': 1, 'TimelineEntry': [{'identifier': 'com.plexapp.plugins.library', 'sectionID': '-4', 'itemID': '99499', 'type': 12, 'title': 'Live Session sl8nwcv8k0hpp4w2ivmkroht', 'state': 0, 'metadataState': 'created', 'updatedAt': 1643744733}]} 2022-02-01 12:45:34,330 DEBUG[plexapi]:Alert: type size StatusNotification 2022-02-01 12:45:34,330 DEBUG[PlexTraktSync.EventDispatcher]:{'type': 'status', 'size': 1, 'StatusNotification': [{'title': 'Recording Live TV - Session', 'description': '', 'notificationName': 'MEDIA_GRAB'}]} 2022-02-01 12:45:35,834 DEBUG[plexapi]:Alert: type size ActivityNotification 2022-02-01 12:45:35,834 DEBUG[PlexTraktSync.EventDispatcher]:{'type': 'activity', 'size': 1, 'ActivityNotification': [{'event': 'updated', 'uuid': '1cf985a9-0d0c-446a-8085-2f60674ed02e', 'Activity': {'uuid': '1cf985a9-0d0c-446a-8085-2f60674ed02e', 'type': 'grabber.grab', 'cancellable': True, 'userID': 1, 'title': 'Recording', 'subtitle': 'Live TV - Session', 'progress': 1, 'Context': {'deviceID': '1', 'grabber': 'tv.plex.grabbers.hdhomerun', 'itemKey': '', 'itemMediaIndex': '0', 'itemRatingKey': '', 'signalQuality': 100, 'signalStrength': 95, 'source': 'provider://tv.plex.providers.epg.xmltv', 'status': 'inprogress', 'subscriptionID': '1279', 'transcode_session': '5eafaf2c-3a96-481d-9b7e-30d421e9478b'}}}]} 2022-02-01 12:45:35,834 DEBUG[plexapi]:Alert: type size ActivityNotification 2022-02-01 12:45:35,835 DEBUG[PlexTraktSync.EventDispatcher]:{'type': 'activity', 'size': 1, 'ActivityNotification': [{'event': 'updated', 'uuid': 'e2be8b52-d163-4ac6-b596-1da0b7c1b4c5', 'Activity': {'uuid': 'e2be8b52-d163-4ac6-b596-1da0b7c1b4c5', 'type': 'provider.subscription.refresh', 'cancellable': False, 'userID': 1, 'title': 'Refreshing Sub', 'subtitle': 'Grabbing', 'progress': 1, 'Context': {'completed': 0, 'refreshing': '0', 'subscriptionID': '1279', 'total': 1, 'waiting': '0'}}}]} 2022-02-01 12:45:36,510 DEBUG[plexapi]:Alert: type size TranscodeSession 2022-02-01 12:45:36,510 DEBUG[PlexTraktSync.EventDispatcher]:{'type': 'transcodeSession.start', 'size': 1, 'TranscodeSession': [{'key': '/transcode/sessions/r60uasntfoft1l23obplvpsv', 'throttled': False, 'complete': False, 'progress': 0.0, 'size': 0, 'speed': 0.0, 'error': False, 'duration': 7200000, 'context': 'streaming', 'sourceVideoCodec': 'mpeg2video', 'sourceAudioCodec': 'ac3', 'videoDecision': 'transcode', 'audioDecision': 'transcode', 'protocol': 'dash', 'container': 'mp4', 'videoCodec': 'h264', 'audioCodec': 'aac', 'audioChannels': 2, 'transcodeHwRequested': True, 'transcodeHwDecoding': 'nvdec', 'transcodeHwEncoding': 'nvenc', 'transcodeHwDecodingTitle': 'NVIDIA (NVDEC)', 'transcodeHwFullPipeline': False, 'transcodeHwEncodingTitle': 'NVIDIA (NVENC)', 'timeStamp': 1643744733.4342391}]} 2022-02-01 12:45:36,957 DEBUG[plexapi]:Alert: type size PlaySessionStateNotification 2022-02-01 12:45:36,957 DEBUG[PlexTraktSync.EventDispatcher]:{'type': 'playing', 'size': 1, 'PlaySessionStateNotification': [{'sessionKey': '12', 'clientIdentifier': '8tno78k251wwn1ciz6bb7h97', 'guid': '', 'ratingKey': '99499', 'url': '', 'key': '/livetv/sessions/5eafaf2c-3a96-481d-9b7e-30d421e9478b', 'viewOffset': 0, 'state': 'playing', 'transcodeSession': 'r60uasntfoft1l23obplvpsv'}]} 2022-02-01 12:45:36,958 DEBUG[plexapi]:GET https://192-168-0-16.af24ef612f1342c19cb45edd07a8fd14.plex.direct:32400/status/sessions 2022-02-01 12:45:36,959 DEBUG[requests_cache.cache_control]:Cache directives from request headers: {} 2022-02-01 12:45:36,969 DEBUG[urllib3.connectionpool]:https://192-168-0-16.af24ef612f1342c19cb45edd07a8fd14.plex.direct:32400 "GET /status/sessions HTTP/1.1" 200 1255 2022-02-01 12:45:36,970 DEBUG[requests_cache.session]:Pre-cache checks for response from https://192-168-0-16.af24ef612f1342c19cb45edd07a8fd14.plex.direct:32400/status/sessions: {'disabled cache': True, 'disabled method': False, 'disabled status': False, 'disabled by filter': False, 'disabled by headers or expiration params': False} 2022-02-01 12:45:36,970 DEBUG[requests_cache.session]:Skipping cache write for URL: https://192-168-0-16.af24ef612f1342c19cb45edd07a8fd14.plex.direct:32400/status/sessions 2022-02-01 12:45:36,973 DEBUG[plexapi]:GET https://192-168-0-16.af24ef612f1342c19cb45edd07a8fd14.plex.direct:32400/livetv/sessions/5eafaf2c-3a96-481d-9b7e-30d421e9478b 2022-02-01 12:45:36,974 DEBUG[requests_cache.cache_control]:Cache directives from request headers: {} 2022-02-01 12:45:36,981 DEBUG[urllib3.connectionpool]:https://192-168-0-16.af24ef612f1342c19cb45edd07a8fd14.plex.direct:32400 "GET /livetv/sessions/5eafaf2c-3a96-481d-9b7e-30d421e9478b HTTP/1.1" 200 1092 2022-02-01 12:45:36,982 DEBUG[requests_cache.session]:Pre-cache checks for response from https://192-168-0-16.af24ef612f1342c19cb45edd07a8fd14.plex.direct:32400/livetv/sessions/5eafaf2c-3a96-481d-9b7e-30d421e9478b: {'disabled cache': True, 'disabled method': False, 'disabled status': False, 'disabled by filter': False, 'disabled by headers or expiration params': False} 2022-02-01 12:45:36,982 DEBUG[requests_cache.session]:Skipping cache write for URL: https://192-168-0-16.af24ef612f1342c19cb45edd07a8fd14.plex.direct:32400/livetv/sessions/5eafaf2c-3a96-481d-9b7e-30d421e9478b 2022-02-01 12:45:36,984 ERROR[PlexTraktSync]:<Episode:/livetv/sessions/5eafaf2c-3a96-481d-9b7e-30d421e9478b:Daytime-Jeopardy-s38e47>: Unable to parse a valid provider from guid tv.plex.xmltv://episode/Daytime%20Jeopardy/38/47

glensc commented 2 years ago

Oh, this issue is back. Something funny happened to it, it disappeared totally at some point. Likely database crash at github, and they recovered it now.

glensc commented 2 years ago

So, the guids are:

are they resolvable to something that trakt knows? or just needs to be excluded?

glensc commented 2 years ago

You could try this branch. it should just ignore them:

theChad6 commented 2 years ago

I'm not sure how to pull a specific branch into docker. I updated today to 0.18.16, but it still seems to be erroring.

glensc commented 2 years ago

did you try googling? 0.18.16 of course does not contain https://github.com/Taxel/PlexTraktSync/pull/777 because it's not even merged.

theChad6 commented 2 years ago

Yes... I'm doing my best since I'm neither a software developer nor a git or docker expert. I just learned how to spell CI/CD. I'm on the uphill of a learning curve, so please be patient with me.
Are you waiting for my test results before merging? It might take me a few days to figure all this out.

glensc commented 7 months ago

Instructions on how to install from PR is in README file.