mdhiggins / PlexAutoSkip

Automatically skip content in Plex
MIT License
205 stars 11 forks source link

Chapter Skipping #25

Closed Speedbird757 closed 2 years ago

Speedbird757 commented 2 years ago

I’m having an issue with custom chapter skip definitions. Auto skip doesn’t seem to work for chapters that have multiple words in the title, i.e. using “c:Previously On”. Any idea how to fix this?

mdhiggins commented 2 years ago

No reason a space should matter, can you post the XML data for the media file in question and some logs from a relevant playback session where it's not working?

XML data can be pulled from Plex Web, go to that Movie/Episode and hit "More > Get Info > View XML"

image

Speedbird757 commented 2 years ago

Here's the XML data:

<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="55" librarySectionTitle="Fantasy" librarySectionUUID="0dce8dc7-93f8-4c2b-ad91-5182e2989678" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1661911541">
<Video ratingKey="32840" key="/library/metadata/32840" parentRatingKey="32839" grandparentRatingKey="32762" guid="plex://episode/5fbe1738a749bc002ea4ebc0" parentGuid="plex://season/602e67e01d3358002c411faa" grandparentGuid="plex://show/5d9c086c46115600200aa2fe" type="episode" title="Winterfell" grandparentKey="/library/metadata/32762" parentKey="/library/metadata/32839" librarySectionTitle="Fantasy" librarySectionID="55" librarySectionKey="/library/sections/55" grandparentTitle="Game of Thrones" parentTitle="Season 8" contentRating="TV-MA" summary="Arriving at Winterfell, Jon and Daenerys struggle to unite a divided North. Jon Snow gets some big news." index="1" parentIndex="8" audienceRating="7.4" skipCount="2" thumb="/library/metadata/32840/thumb/1663694930" art="/library/metadata/32762/art/1662319926" parentThumb="/library/metadata/32839/thumb/1662319932" grandparentThumb="/library/metadata/32762/thumb/1662319926" grandparentArt="/library/metadata/32762/art/1662319926" grandparentTheme="/library/metadata/32762/theme/1662319926" duration="3345346" originallyAvailableAt="2019-04-14" addedAt="1662319930" updatedAt="1663694930" audienceRatingImage="themoviedb://image.rating" chapterSource="media">
<Media id="54204" duration="3345346" bitrate="4160" width="1920" height="1080" aspectRatio="1.78" audioChannels="6" audioCodec="ac3" videoCodec="h264" videoResolution="1080" container="mp4" videoFrameRate="24p" optimizedForStreaming="0" has64bitOffsets="0" videoProfile="high">
<Part accessible="1" exists="1" id="55207" key="/library/parts/55207/1663691508/file.mp4" duration="3345346" file="/Volumes/Plex Extended/TV Extended/Fantasy/Game of Thrones/Season 8/Game of Thrones - S08E01 - Winterfell.mp4" size="1741608763" container="mp4" deepAnalysisVersion="6" has64bitOffsets="0" optimizedForStreaming="0" requiredBandwidths="10186,6552,5901,5901,5901,5901,5901,5901" videoProfile="high">
<Stream id="146151" streamType="1" default="1" codec="h264" index="0" bitrate="3776" bitDepth="8" chromaLocation="left" chromaSubsampling="4:2:0" codedHeight="1088" codedWidth="1920" colorPrimaries="bt709" colorRange="tv" colorSpace="bt709" colorTrc="bt709" frameRate="23.976" hasScalingMatrix="0" height="1080" level="41" profile="high" refFrames="4" requiredBandwidths="9807,6168,5525,5525,5525,5525,5525,5525" streamIdentifier="1" width="1920" displayTitle="1080p (H.264)" extendedDisplayTitle="1080p (H.264)"></Stream>
<Stream id="146152" streamType="2" selected="1" default="1" codec="ac3" index="1" channels="6" bitrate="384" language="English" languageTag="en" languageCode="eng" audioChannelLayout="5.1(side)" requiredBandwidths="384,384,384,384,384,384,384,384" samplingRate="48000" streamIdentifier="2" displayTitle="English (AC3 5.1)" extendedDisplayTitle="English (AC3 5.1)"></Stream>
<Stream id="146153" streamType="3" default="1" codec="mov_text" index="2" bitrate="0" language="English" languageTag="en" languageCode="eng" requiredBandwidths="1,1,1,1,1,1,1,1" streamIdentifier="3" displayTitle="English (MOV_TEXT)" extendedDisplayTitle="English (MOV_TEXT)"></Stream>
</Part>
</Media>
<Director id="44803" filter="director=44803" tag="David Nutter"/>
<Writer id="44764" filter="writer=44764" tag="Dave Hill"/>
<Producer id="57742" filter="producer=57742" tag="Oliver Butler"/>
<Producer id="57743" filter="producer=57743" tag="Dave Hill"/>
<Guid id="imdb://tt5924366"/>
<Guid id="tmdb://1551825"/>
<Guid id="tvdb://7117386"/>
<Rating image="themoviedb://image.rating" value="7.4" type="audience"/>
<Role id="57639" filter="actor=57639" tag="Alfie Allen" tagKey="5d77682e5af944001f1f8599" role="Theon Greyjoy" thumb="https://metadata-static.plex.tv/5/people/5d567ebbd55fc974be635404d3cbd12c.jpg"/>
<Role id="44835" filter="actor=44835" tag="Bella Ramsey" tagKey="5d776c8d96b655001fe346ba" role="Lyanna Mormont" thumb="https://metadata-static.plex.tv/f/people/f7c24abd3c6d7415b43f96e40f8747f3.jpg"/>
<Role id="40995" filter="actor=40995" tag="Rupert Vansittart" tagKey="5d776825eb5d26001f1dd171" role="Yohn Royce" thumb="https://metadata-static.plex.tv/people/5d776825eb5d26001f1dd171.jpg"/>
<Role id="44837" filter="actor=44837" tag="Pilou Asbæk" tagKey="5d77683e999c64001ec312c5" role="Euron Greyjoy" thumb="https://metadata-static.plex.tv/6/people/6056bea651b8c4213fe7bcad3ea1f0d5.jpg"/>
<Role id="44741" filter="actor=44741" tag="Anton Lesser" tagKey="5d77682a961905001eb9200e" role="Qyburn" thumb="https://metadata-static.plex.tv/people/5d77682a961905001eb9200e.jpg"/>
<Role id="44826" filter="actor=44826" tag="Hafþór Júlíus Björnsson" tagKey="5d776b2b96b655001fe06c19" role="Gregor Clegane" thumb="https://metadata-static.plex.tv/people/5d776b2b96b655001fe06c19.jpg"/>
<Role id="57739" filter="actor=57739" tag="Gemma Whelan" tagKey="5d77683254f42c001f8c3c13" role="Yara Greyjoy" thumb="https://metadata-static.plex.tv/people/5d77683254f42c001f8c3c13.jpg"/>
<Role id="57638" filter="actor=57638" tag="Iain Glen" tagKey="5d77682a3c3c2a001fbcbd57" role="Jorah Mormont" thumb="https://metadata-static.plex.tv/e/people/e8561a2fe99773156ac1eed1b25a4d2a.jpg"/>
<Role id="44715" filter="actor=44715" tag="Ben Crompton" tagKey="5d77683554c0f0001f303900" role="Eddison Tollett" thumb="https://metadata-static.plex.tv/1/people/10c60a1632819fd41d2e37bc6ef8ed9e.jpg"/>
<Role id="44716" filter="actor=44716" tag="Daniel Portman" tagKey="5d77687aeb5d26001f1ecf2c" role="Podrick Payne" thumb="https://metadata-static.plex.tv/4/people/41a9320306c12e072a7ec11378712dbc.jpg"/>
<Role id="42304" filter="actor=42304" tag="Kristofer Hivju" tagKey="5d7768392ec6b5001f6bc8c2" role="Tormund Giantsbane" thumb="https://metadata-static.plex.tv/0/people/0cc0ed9d249673e1cc17fd9468e42f3c.jpg"/>
<Role id="44834" filter="actor=44834" tag="Richard Dormer" tagKey="5d77684085719b001f3a5b98" role="Beric Dondarrion" thumb="https://metadata-static.plex.tv/b/people/bc8d1eb999272316df41f7a3ff63351d.jpg"/>
<Role id="57740" filter="actor=57740" tag="Nathalie Emmanuel" tagKey="5d776993fb0d55001f529fab" role="Missandei" thumb="https://metadata-static.plex.tv/a/people/a4a0e3ef37c3d3353800ebe1b8de2d64.jpg"/>
<Role id="57736" filter="actor=57736" tag="Harry Grasby" tagKey="5e1653ae20b9e6003e3555da" role="Ned Umber" thumb="https://metadata-static.plex.tv/a/people/a3fe697b34948b6084894665c791654c.jpg"/>
<Role id="57737" filter="actor=57737" tag="Lucy Aarden" tagKey="5d776c4bad5437001f7b9cf0" role="Crayah" thumb="https://metadata-static.plex.tv/people/5d776c4bad5437001f7b9cf0.jpg"/>
<Role id="57738" filter="actor=57738" tag="Marina Lawrence-Mahrra" tagKey="5e1653adef1040003f268872" role="Dirah" thumb="https://metadata-static.plex.tv/3/people/3431a33b6ae77f032b3f60d6fea7447f.jpg"/>
<Role id="44848" filter="actor=44848" tag="Staz Nair" tagKey="5d776c0c7a53e9001e7380d2" role="Qhono" thumb="https://metadata-static.plex.tv/c/people/ce7ebe423aaf44b022cae6c25d1839c6.jpg"/>
<Role id="44836" filter="actor=44836" tag="Megan Parkinson" tagKey="5d776c89fb0d55001f58a98d" role="Alys Karstark" thumb="https://image.tmdb.org/t/p/original/caXilGBPQtpF4nZEPUlDb0UfVnL.jpg"/>
<Role id="44842" filter="actor=44842" tag="Richard Rycroft" tagKey="5d7768f996b655001fdc6bf3" role="Maester Wolkan"/>
<Role id="107837" filter="actor=107837" tag="Marc Rissmann" tagKey="6323ec545d7a22f3aca59a04" role="Harry Strickland" thumb="https://metadata-static.plex.tv/7/people/7633c739e7bbb929ae7b1f8543bb247c.jpg"/>
<Role id="48428" filter="actor=48428" tag="Rob McElhenney" tagKey="5d77682ef59e580021897d89" role="Ironborn #1" thumb="https://metadata-static.plex.tv/d/people/d6a98eb48ff83cb32887e0f21e17ae55.jpg"/>
<Role id="107838" filter="actor=107838" tag="Josephine Gillan" tagKey="63209db2ed271a666cf27e1f" role="Marei" thumb="https://metadata-static.plex.tv/2/people/221ea9e1614ea007a63559652c553f6a.jpg"/>
<Chapter id="14791" filter="thumb=14791" tag="Ratings" index="1" startTimeOffset="0" endTimeOffset="3944" thumb="/library/media/54204/chapterImages/1"/>
<Chapter id="14738" filter="thumb=14738" tag="Previously On" index="2" startTimeOffset="3944" endTimeOffset="119944" thumb="/library/media/54204/chapterImages/2"/>
<Chapter id="10155" filter="thumb=10155" tag="Studio Logo" index="3" startTimeOffset="119944" endTimeOffset="125944" thumb="/library/media/54204/chapterImages/3"/>
<Chapter id="14740" filter="thumb=14740" tag="Opening Credits" index="4" startTimeOffset="125944" endTimeOffset="232944" thumb="/library/media/54204/chapterImages/4"/>
<Chapter id="107761" filter="thumb=107761" tag="Arrival in Winterfell" index="5" startTimeOffset="232944" endTimeOffset="586944" thumb="/library/media/54204/chapterImages/5"/>
<Chapter id="107762" filter="thumb=107762" tag="Fight together or die" index="6" startTimeOffset="586944" endTimeOffset="773944" thumb="/library/media/54204/chapterImages/6"/>
<Chapter id="107763" filter="thumb=107763" tag="Sansa sees through the lies" index="7" startTimeOffset="773944" endTimeOffset="936944" thumb="/library/media/54204/chapterImages/7"/>
<Chapter id="107764" filter="thumb=107764" tag="A tearful reunion" index="8" startTimeOffset="936944" endTimeOffset="1065940" thumb="/library/media/54204/chapterImages/8"/>
<Chapter id="107765" filter="thumb=107765" tag="A queen must be earned" index="9" startTimeOffset="1065940" endTimeOffset="1360940" thumb="/library/media/54204/chapterImages/9"/>
<Chapter id="107766" filter="thumb=107766" tag="Cersei asks a favor of Bronn" index="10" startTimeOffset="1360940" endTimeOffset="1525940" thumb="/library/media/54204/chapterImages/10"/>
<Chapter id="107767" filter="thumb=107767" tag="What is dead may never die" index="11" startTimeOffset="1525940" endTimeOffset="1764940" thumb="/library/media/54204/chapterImages/11"/>
<Chapter id="107768" filter="thumb=107768" tag="Hold on to whatever you can" index="12" startTimeOffset="1764940" endTimeOffset="2201940" thumb="/library/media/54204/chapterImages/12"/>
<Chapter id="107769" filter="thumb=107769" tag="A forge for dragonglass" index="13" startTimeOffset="2201940" endTimeOffset="2351940" thumb="/library/media/54204/chapterImages/13"/>
<Chapter id="107770" filter="thumb=107770" tag="Sansa is frustrated with Jon's choice" index="14" startTimeOffset="2351940" endTimeOffset="2463940" thumb="/library/media/54204/chapterImages/14"/>
<Chapter id="107771" filter="thumb=107771" tag="The head of House Tarly" index="15" startTimeOffset="2463940" endTimeOffset="2672940" thumb="/library/media/54204/chapterImages/15"/>
<Chapter id="107772" filter="thumb=107772" tag="It's time for Jon to know the truth" index="16" startTimeOffset="2672940" endTimeOffset="2920940" thumb="/library/media/54204/chapterImages/16"/>
<Chapter id="107773" filter="thumb=107773" tag="A message from the Night King" index="17" startTimeOffset="2920940" endTimeOffset="3148940" thumb="/library/media/54204/chapterImages/17"/>
<Chapter id="86385" filter="thumb=86385" tag="An unexpected visitor" index="18" startTimeOffset="3148940" endTimeOffset="3223940" thumb="/library/media/54204/chapterImages/18"/>
<Chapter id="6876" filter="thumb=6876" tag="End Credits" index="19" startTimeOffset="3223940" endTimeOffset="3303940" thumb="/library/media/54204/chapterImages/19"/>
<Chapter id="14824" filter="thumb=14824" tag="Next Time" index="20" startTimeOffset="3303940" endTimeOffset="3340940" thumb="/library/media/54204/chapterImages/20"/>
<Chapter id="107774" filter="thumb=107774" tag="Inside Game of Thrones" index="21" startTimeOffset="3340940" endTimeOffset="3347740" thumb="/library/media/54204/chapterImages/21"/>
<Marker id="21290" type="intro" startTimeOffset="118476" endTimeOffset="229986">
<Attributes id="21290"/>
</Marker>
<Extras size="0"></Extras>
<Related></Related>
</Video>
</MediaContainer>

And here's the log of it skipping the ratings chapter but not the previously on:

2022-09-21 12:00:35 - __main__ - INFO - Found new session 79 [32840] (Game of Thrones s08e01 - Winterfell) Andrews-Mac-Mini.local|s1z92qxup4lsgus55bff9l3v viewOffset 0 ['Speedbird757'], sessions: 0
2022-09-21 12:00:35 - __main__ - INFO - Found skippable chapter Ratings for media 79 [32840] (Game of Thrones s08e01 - Winterfell) Andrews-Mac-Mini.local|s1z92qxup4lsgus55bff9l3v with range 0-3944 and viewOffset 94
2022-09-21 12:00:35 - __main__ - INFO - Seeking Plex HTPC for Mac player playing 79 [32840] (Game of Thrones s08e01 - Winterfell) Andrews-Mac-Mini.local|s1z92qxup4lsgus55bff9l3v from 94 to 3944
mdhiggins commented 2 years ago

Think I got a fix, you were right it was a space character issue just not in the area I was thinking

68a4230c1cdf1a5a088b031c2e92c76d9c97e828

That should fix it

Speedbird757 commented 2 years ago

That fixed the issue, thank you very much!