User:Vanderven.se martijn/feed-entries-with-post-type-video

I follow a lot of streamers on Twitch. My voice can be heard in multiple Mixer streams. I like many channels on YouTube. To support those artists I follow (“subscribe”, etc.) their channels within those silos. But I consume the actual content by subscribing to their Atom feeds (YouTube has some weird mapping for this) in my reader.

In swoops Telia and takes away my internet. Now I move a lot of video content aside in my reader. They sit there, waiting for me to leech off of someone else’s internet to be watched or downloaded.

But why can’t I have my reader sort out all video posts by itself? That would save me time. And maybe I can then also create something that automatically downloads things. So how do I know which posts are video posts? A beautiful use-case for ’s post type discovery!

If the post has a "video" property with a valid URL, Then it is a video post.

But how do I detect a  property? I first thought I should create a converter from YouTube (their Atom, API, oEmbed, Schema.org, …) to h-feed. But as far as I could find a  property is always a URL to a video file in microformats. Outsourcing video hosting to specialised silos (almost) always means there is no video file to link to.

 ( Aside: this can have loads of reasons. Sometimes because of rights management (EME?). YouTube has separate audio and video streams for in-browser muxing (hello DASH!). Twitch offers what is basically a playlist of small video files instead of one giant file for their long live streams for faster seeking and loading. Etc.)

The next feed format I looked at (also on the list from post type discovery) is jf2. This offers an interesting example, where the  property can be more descriptive than just the URL:

""

By a happy accident Microsub, “a standardized way for clients to consume and interact with feeds”, also builds on jf2! So not only have I found a feed format that (in its current draft iteration) supports video posts, but it can also be served by the server over an interoperable format to readers implementing the draft Microsub specification.

I am now planning to link the video through its embeddable URL, as almost every video silo has one of those. I will then set the  to. A reader can use this to know that it should load the video in an  instead of   element. Much like how it might learn in the future that certain types cannot be rendered by a browser at all and might skip them completely instead of forcing it into a  element.

 ( Aside: another example of a video file that will not work in browser  elements is FLV. The web (and Newgrounds especially) is full of this video format.)

Looking closely at what data can be scraped from a YouTube video post permalink, I discovered the people at Google had exactly the same idea! They leverage the Open Graph protocol’s structured properties by setting the following  elements:

So now I am teaching XRay to extract jf2 compatible entries from YouTube URLs. I am hoping for an output akin to the following:

Wish me luck~

Other formats

 * points out that -URLs in microformats could parse resource type as well.
 * JSON Feed’s attachments also support defining the linked resource’s type in a  property.
 * found a POSSE’d tweet from a video post where the video is hosted on YouTube but still got embedded in the tweet thanks to the Twitter Card Player Card markup.
 * The Twitter card markup lets you set an HTML file as  that will be embedded in Twitter. Additionally   may be specified to point to the actual streamable resource, but can be omitted in case a silo video player is being embedded. The nested property format is very much like OGP. From Adlerweb: &lt;meta name="twitter:card" content="player">&#10;&lt;meta name="twitter:player" content="https://www.youtube.com/embed/SmpG4biWRew">&#10;&lt;meta name="twitter:player:stream:content_type" content="video/mp4; codecs="avc1.42E01E1, mp4a.40.2"">&#10;&lt;meta name="twitter:player:width" content="435">&#10;&lt;meta name="twitter:player:height" content="251">
 * found a POSSE’d tweet from a video post where the video is hosted on YouTube but still got embedded in the tweet thanks to the Twitter Card Player Card markup.
 * The Twitter card markup lets you set an HTML file as  that will be embedded in Twitter. Additionally   may be specified to point to the actual streamable resource, but can be omitted in case a silo video player is being embedded. The nested property format is very much like OGP. From Adlerweb: &lt;meta name="twitter:card" content="player">&#10;&lt;meta name="twitter:player" content="https://www.youtube.com/embed/SmpG4biWRew">&#10;&lt;meta name="twitter:player:stream:content_type" content="video/mp4; codecs="avc1.42E01E1, mp4a.40.2"">&#10;&lt;meta name="twitter:player:width" content="435">&#10;&lt;meta name="twitter:player:height" content="251">
 * The Twitter card markup lets you set an HTML file as  that will be embedded in Twitter. Additionally   may be specified to point to the actual streamable resource, but can be omitted in case a silo video player is being embedded. The nested property format is very much like OGP. From Adlerweb: &lt;meta name="twitter:card" content="player">&#10;&lt;meta name="twitter:player" content="https://www.youtube.com/embed/SmpG4biWRew">&#10;&lt;meta name="twitter:player:stream:content_type" content="video/mp4; codecs="avc1.42E01E1, mp4a.40.2"">&#10;&lt;meta name="twitter:player:width" content="435">&#10;&lt;meta name="twitter:player:height" content="251">
 * The Twitter card markup lets you set an HTML file as  that will be embedded in Twitter. Additionally   may be specified to point to the actual streamable resource, but can be omitted in case a silo video player is being embedded. The nested property format is very much like OGP. From Adlerweb: &lt;meta name="twitter:card" content="player">&#10;&lt;meta name="twitter:player" content="https://www.youtube.com/embed/SmpG4biWRew">&#10;&lt;meta name="twitter:player:stream:content_type" content="video/mp4; codecs="avc1.42E01E1, mp4a.40.2"">&#10;&lt;meta name="twitter:player:width" content="435">&#10;&lt;meta name="twitter:player:height" content="251">
 * The Twitter card markup lets you set an HTML file as  that will be embedded in Twitter. Additionally   may be specified to point to the actual streamable resource, but can be omitted in case a silo video player is being embedded. The nested property format is very much like OGP. From Adlerweb: &lt;meta name="twitter:card" content="player">&#10;&lt;meta name="twitter:player" content="https://www.youtube.com/embed/SmpG4biWRew">&#10;&lt;meta name="twitter:player:stream:content_type" content="video/mp4; codecs="avc1.42E01E1, mp4a.40.2"">&#10;&lt;meta name="twitter:player:width" content="435">&#10;&lt;meta name="twitter:player:height" content="251">