add-ons / plugin.video.vrt.nu

Kodi add-on to watch content from VRT MAX
https://www.facebook.com/groups/kodivlaanderen
GNU General Public License v3.0
110 stars 20 forks source link

Restore /play/url entrypoint #1064

Closed tatankat closed 1 year ago

tatankat commented 1 year ago

The castkodi browser extension (https://github.com/regseb/castkodi) uses the plugin://plugin.video.vrt.nu/play/url route to play vrt max videos from the browser. This is currently broken and I understand this is removed with webscraping. Currently the website is using following graphql query to play the video. The value of the variable pageId is constructed the same way as the url, so the value can be constructed from the url, by adding ".model.json" to the uri.

{"query":"query VideoPage($pageId: ID!) {\n  page(id: $pageId) {\n    ... on EpisodePage {\n      id\n      title\n      seoTitle\n      seoDescription\n      seoImage {\n        __typename\n        id: objectId\n        focalPoint\n        alt\n        templateUrl\n      }\n      trackingData {\n        data\n        perTrigger {\n          trigger\n          data\n          template {\n            id\n            __typename\n          }\n          __typename\n        }\n        __typename\n      }\n      components {\n        __typename\n        ... on IComponent {\n          componentType\n          __typename\n        }\n      }\n      episode {\n        id\n        title\n        whatsonId\n        brand\n        brandLogos {\n          type\n          width\n          height\n          primary\n          mono\n          __typename\n        }\n        logo\n        primaryMeta {\n          ...metaFragment\n          __typename\n        }\n        secondaryMeta {\n          ...metaFragment\n          __typename\n        }\n        image {\n          ...image\n          __typename\n        }\n        durationRaw\n        durationValue\n        durationSeconds\n        onTimeRaw\n        offTimeRaw\n        ageRaw\n        regionRaw\n        announcementValue\n        name\n        permalink\n        episodeNumberRaw\n        episodeNumberValue\n        subtitle\n        richDescription {\n          __typename\n          html\n        }\n        program {\n          id\n          link\n          __typename\n        }\n        watchAction {\n          streamId\n          videoId\n          episodeId\n          avodUrl\n          resumePoint\n          __typename\n        }\n        shareAction {\n          title\n          description\n          image {\n            templateUrl\n            __typename\n          }\n          url\n          __typename\n        }\n        favoriteAction {\n          id\n          title\n          favorite\n          programWhatsonId\n          programUrl\n          __typename\n        }\n        __typename\n      }\n      __typename\n    }\n    __typename\n  }\n}\n\nfragment metaFragment on MetaDataItem {\n  type\n  value\n  shortValue\n  longValue\n}\n\nfragment image on Image {\n  id: objectId\n  alt\n  focalPoint\n  objectId\n  templateUrl\n}\n","operationName":"VideoPage","variables":{"pageId":"/vrtnu/a-z/find-me-in-paris/1-vlaams/find-me-in-paris-s1-vlaamsa25.model.json"}}

So I think it is relatively easy to restore the functionality in the kodi addon. What do you think? Maybe the construction of the pageId variable should be done by the route client, but I think at least the query should be done in the addon as it is already executing other queries and it creates an easy interface to play vrt videos on kodi.

PS: The fix for programs menus works like a charm, thanks. Menus were broken and one of the reasons to use the browser extension is that it most of the time still worked when menus are broken in de kodi addon.

mediaminister commented 1 year ago

Thanks for reporting this. Using the model.json method it was very easy to get the stream ids from the json file. The new implementation works for live and on demand urls: For instance: https://www.vrt.be/vrtmax/livestream/video/een/ https://www.vrt.be/vrtmax/livestream/video/canvas/ https://www.vrt.be/vrtmax/a-z/vrt-nws-journaal/2022/vrt-nws-journaal-vrt-nws-journaal-19u-20221014/

Test packages: Kodi 19 Matrix: plugin.video.vrt.nu-2.5.18+matrix.1-play_url-eabb5e4.zip Kodi 18 Leia: plugin.video.vrt.nu-2.5.18-play_url-eabb5e4.zip

tatankat commented 1 year ago

Yep, it works. Thanks for implementing this!