Steve0x2a / DLimiter

利用Webhooks,平衡下载器PT上传和外网视频播放的限速器
40 stars 10 forks source link

解析plex的webhook失败 #8

Open samir2015dzh opened 1 year ago

samir2015dzh commented 1 year ago

2023-02-07 13:59:51 - DLimiter - ERROR - 20 解析Plex webhooks错误:'Session',context:{'payload': ['{"event":"media.resume","user":true,"owner":true,"Account":{"id":185190476,"thumb":"https://plex.tv/users/65e6b75c55973fa7/avatar?c=1674766970","title":"samir2013dzh"},"Server":{"title":"AlexStation","uuid":"582eb5245bc0916d672bd5b0c9739f3bb89a25e0"},"Player":{"local":false,"publicAddress":"10.7.7.7","title":"BigAlex","uuid":"u4nb8m1l0pag9jzz2h83ki1r"},"Metadata":{"librarySectionType":"show","ratingKey":"3060","key":"/library/metadata/3060","parentRatingKey":"3057","grandparentRatingKey":"3056","guid":"plex://episode/633eed8f5ca1ba323833a737","parentGuid":"plex://season/60300df481821b002c1b07ab","grandparentGuid":"plex://show/60300df381821b002c1b07a8","type":"episode","title":"火速增员","grandparentKey":"/library/metadata/3056","parentKey":"/library/metadata/3057","librarySectionTitle":"动漫","librarySectionID":3,"librarySectionKey":"/library/sections/3","grandparentTitle":"孤独摇滚!","parentTitle":"Season 1","originalTitle":"Bocchi the Rock!","contentRating":"TV-14","summary":"预想中的“经过打工沟通能力急速成长”并没有实现,一里依然无法和同学自然地交谈,这一天也是在学校独自吃午饭。想起当时虹夏为了找新成员向自己搭话的样子,她决定向听说能弹吉他又受欢迎的阳光女生喜多伸出橄榄枝,然而......","index":3,"parentIndex":1,"audienceRating":8.0,"viewOffset":367000,"lastViewedAt":1675749337,"year":2022,"thumb":"/library/metadata/3060/thumb/1670273392","art":"/library/metadata/3056/art/1672087301","parentThumb":"/library/metadata/3057/thumb/1669185450","grandparentThumb":"/library/metadata/3056/thumb/1672087301","grandparentArt":"/library/metadata/3056/art/1672087301","duration":1440000,"originallyAvailableAt":"2022-10-23","addedAt":1669038936,"updatedAt":1670273392,"audienceRatingImage":"themoviedb://image.rating","Director":[{"id":11007,"filter":"director=11007","tag":"Yuusuke Yamamoto"}],"Writer":[{"id":10997,"filter":"writer=10997","tag":"Erika Yoshida"}],"Producer":[{"id":11008,"filter":"producer=11008","tag":"Sho Someno"}],"Guid":[{"id":"imdb://tt22797994"},{"id":"tmdb://3989994"},{"id":"tvdb://9390696"}],"Rating":[{"image":"themoviedb://image.rating","value":8.0,"type":"audience"}],"Role":[{"id":7246,"filter":"actor=7246","tag":"Maaya Uchida","tagKey":"5d776a4296b655001fde8a47","role":"Seika Ijichi (voice)","thumb":"https://metadata-static.plex.tv/e/people/ecc9a4fda200da37b6dea6371b21416e.jpg"},{"id":8200,"filter":"actor=8200","tag":"Misaki Watada","tagKey":"5d9c07fa02391c001f57dad6","role":"Futari Gotoh (voice)","thumb":"https://metadata-static.plex.tv/people/5d9c07fa02391c001f57dad6.jpg"},{"id":10982,"filter":"actor=10982","tag":"Hinaki Yano","tagKey":"5f5d60d98edf4c0042ac05a9","role":"Kita\'s Friend (voice)","thumb":"https://metadata-static.plex.tv/a/people/acfa85d0b910ced52bf0c937da61cf74.jpg"},{"id":10983,"filter":"actor=10983","tag":"Yume Miyamoto","tagKey":"6325c9fd31a6256f7eca208e","role":"Kita\'s Friend (voice)","thumb":"https://metadata-static.plex.tv/6/people/6d3f12f341ab7aed6bab734745e20076.jpg"},{"id":7502,"filter":"actor=7502","tag":"Natsumi Kawaida","tagKey":"5f406af402101b0040fde974","role":"Student (voice)","thumb":"https://metadata-static.plex.tv/3/people/3508de5926c805f5bb0974b6edc7897a.jpg"},{"id":10702,"filter":"actor=10702","tag":"Megumi Yamaguchi","tagKey":"5d9f35236fc551001ef808e6","role":"Student (voice)","thumb":"https://metadata-static.plex.tv/7/people/757cd17bb68129e87f024b280f585828.jpg"},{"id":7496,"filter":"actor=7496","tag":"Yohei Azakami","tagKey":"5f4030f703883a0040b50b88","role":"Student (voice)","thumb":"https://metadata-static.plex.tv/c/people/c7b91df98b2cf039e9ccb27f25f69a18.jpg"},{"id":7777,"filter":"actor=7777","tag":"Kotori Koiwai","tagKey":"5d776d4aad5437001f7d2451","role":"PA-san / Jimihen (voice)","thumb":"https://metadata-static.plex.tv/5/people/5d5773dd3d50b778e23a12bb6162e9c5.jpg"}]}}']} 2023-02-07 13:59:51 - DLimiter - ERROR - 104 Event not successful 2023-02-07 14:00:26 - DLimiter - ERROR - 20 解析Plex webhooks错误:'Session',context:{'payload': ['{"event":"media.pause","user":true,"owner":true,"Account":{"id":185190476,"thumb":"https://plex.tv/users/65e6b75c55973fa7/avatar?c=1674766970","title":"samir2013dzh"},"Server":{"title":"AlexStation","uuid":"582eb5245bc0916d672bd5b0c9739f3bb89a25e0"},"Player":{"local":false,"publicAddress":"10.7.7.7","title":"BigAlex","uuid":"u4nb8m1l0pag9jzz2h83ki1r"},"Metadata":{"librarySectionType":"show","ratingKey":"3060","key":"/library/metadata/3060","parentRatingKey":"3057","grandparentRatingKey":"3056","guid":"plex://episode/633eed8f5ca1ba323833a737","parentGuid":"plex://season/60300df481821b002c1b07ab","grandparentGuid":"plex://show/60300df381821b002c1b07a8","type":"episode","title":"火速增员","grandparentKey":"/library/metadata/3056","parentKey":"/library/metadata/3057","librarySectionTitle":"动漫","librarySectionID":3,"librarySectionKey":"/library/sections/3","grandparentTitle":"孤独摇滚!","parentTitle":"Season 1","originalTitle":"Bocchi the Rock!","contentRating":"TV-14","summary":"预想中的“经过打工沟通能力急速成长”并没有实现,一里依然无法和同学自然地交谈,这一天也是在学校独自吃午饭。想起当时虹夏为了找新成员向自己搭话的样子,她决定向听说能弹吉他又受欢迎的阳光女生喜多伸出橄榄枝,然而......","index":3,"parentIndex":1,"audienceRating":8.0,"viewOffset":402000,"lastViewedAt":1675749626,"year":2022,"thumb":"/library/metadata/3060/thumb/1670273392","art":"/library/metadata/3056/art/1672087301","parentThumb":"/library/metadata/3057/thumb/1669185450","grandparentThumb":"/library/metadata/3056/thumb/1672087301","grandparentArt":"/library/metadata/3056/art/1672087301","duration":1440000,"originallyAvailableAt":"2022-10-23","addedAt":1669038936,"updatedAt":1670273392,"audienceRatingImage":"themoviedb://image.rating","Director":[{"id":11007,"filter":"director=11007","tag":"Yuusuke Yamamoto"}],"Writer":[{"id":10997,"filter":"writer=10997","tag":"Erika Yoshida"}],"Producer":[{"id":11008,"filter":"producer=11008","tag":"Sho Someno"}],"Guid":[{"id":"imdb://tt22797994"},{"id":"tmdb://3989994"},{"id":"tvdb://9390696"}],"Rating":[{"image":"themoviedb://image.rating","value":8.0,"type":"audience"}],"Role":[{"id":7246,"filter":"actor=7246","tag":"Maaya Uchida","tagKey":"5d776a4296b655001fde8a47","role":"Seika Ijichi (voice)","thumb":"https://metadata-static.plex.tv/e/people/ecc9a4fda200da37b6dea6371b21416e.jpg"},{"id":8200,"filter":"actor=8200","tag":"Misaki Watada","tagKey":"5d9c07fa02391c001f57dad6","role":"Futari Gotoh (voice)","thumb":"https://metadata-static.plex.tv/people/5d9c07fa02391c001f57dad6.jpg"},{"id":10982,"filter":"actor=10982","tag":"Hinaki Yano","tagKey":"5f5d60d98edf4c0042ac05a9","role":"Kita\'s Friend (voice)","thumb":"https://metadata-static.plex.tv/a/people/acfa85d0b910ced52bf0c937da61cf74.jpg"},{"id":10983,"filter":"actor=10983","tag":"Yume Miyamoto","tagKey":"6325c9fd31a6256f7eca208e","role":"Kita\'s Friend (voice)","thumb":"https://metadata-static.plex.tv/6/people/6d3f12f341ab7aed6bab734745e20076.jpg"},{"id":7502,"filter":"actor=7502","tag":"Natsumi Kawaida","tagKey":"5f406af402101b0040fde974","role":"Student (voice)","thumb":"https://metadata-static.plex.tv/3/people/3508de5926c805f5bb0974b6edc7897a.jpg"},{"id":10702,"filter":"actor=10702","tag":"Megumi Yamaguchi","tagKey":"5d9f35236fc551001ef808e6","role":"Student (voice)","thumb":"https://metadata-static.plex.tv/7/people/757cd17bb68129e87f024b280f585828.jpg"},{"id":7496,"filter":"actor=7496","tag":"Yohei Azakami","tagKey":"5f4030f703883a0040b50b88","role":"Student (voice)","thumb":"https://metadata-static.plex.tv/c/people/c7b91df98b2cf039e9ccb27f25f69a18.jpg"},{"id":7777,"filter":"actor=7777","tag":"Kotori Koiwai","tagKey":"5d776d4aad5437001f7d2451","role":"PA-san / Jimihen (voice)","thumb":"https://metadata-static.plex.tv/5/people/5d5773dd3d50b778e23a12bb6162e9c5.jpg"}]}}']} 2023-02-07 14:00:26 - DLimiter - ERROR - 104 Event not successful

Steve0x2a commented 1 year ago

理论上不影响,这个事件并不会触发限速和取消,后续我改一下错误处理,无视这些事件即可。

Steve0x2a commented 1 year ago

@samir2015dzh 或者播放和暂停可以正常使用吗,因为这个事件不是我们所需要的事件(我们只需要监听开始和停止)

samir2015dzh commented 1 year ago

@Steve0x2a emmmm没改之前播放暂停是没办法正常触发限速的,现在已经可以了

samir2015dzh commented 1 year ago

emmmm好像plex的入库它也会监听到,后面可以把这些无关的webhook报错直接不显示嘛

Steve0x2a commented 1 year ago

暂停理论上现在是不限速的,至于其他事件,后续我改一下,非触发事件不报错即可。