|
| 1 | +name: Facebook |
| 2 | +homepage: https://www.facebook.com/ |
| 3 | +tags: social |
| 4 | +host: |
| 5 | + - facebook.com |
| 6 | + - fb.watch |
| 7 | +example: |
| 8 | + - https://www.facebook.com/MetaforDevelopers/posts/451016937058647 |
| 9 | + - https://www.facebook.com/watch/?v=224353158889229 |
| 10 | + - https://fb.watch/3zYsXdnxjf/ |
| 11 | + - https://www.facebook.com/reel/873906321076441 |
| 12 | +extract: |
| 13 | + - "@facebook.com/.*?(?:fbid=|/permalink/|\\?v=)(?'id'\\d+)@" |
| 14 | + - "@facebook.com/(?'user'[.\\w]+)/(?'type'[pv])(?:ost|ideo)s?/(?:[-%.\\w]+/)?(?'id'\\d+)\\b@" |
| 15 | + - "@facebook.com/video/(?=post|video)(?'type'[pv])@" |
| 16 | + - "@facebook.com/events/(?'id'\\d+)\\b(?!/permalink)@" |
| 17 | + - "@facebook.com/watch/?(?'type'[pv])=@" |
| 18 | + - "@facebook.com/groups/[^/]*/(?'type'p)osts/(?'id'\\d+)@" |
| 19 | + - "@facebook.com/(?'user'[.\\w]+)/posts/pfbid(?'pfbid'\\w+)@" |
| 20 | + - "@facebook.com/permalink.php?story_fbid=(?:(?'id'\\d+)|pfbid(?'pfbid'\\w+))&id=(?'page_id'\\d+)@" |
| 21 | + - "@facebook.com/(?'type'r)eel/(?'id'\\d+)@" |
| 22 | +scrape: |
| 23 | + - extract: "@facebook.com/(?'user'[.\\w]+)/(?'type'[pv])\\w+/(?'id'\\d+)(?!\\w)@" |
| 24 | + header: "User-agent: PHP (not Mozilla)" |
| 25 | + match: "@facebook.com/[.\\w]+/posts/pfbid@" |
| 26 | + url: https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2F{@user}%2Fposts%2Fpfbid{@pfbid} |
| 27 | + - extract: "@story_fbid=(?'id'\\d+)@" |
| 28 | + header: "User-agent: PHP (not Mozilla)" |
| 29 | + match: "@facebook.com/permalink.php?story_fbid=pfbid(?'pfbid'\\w+)&id=(?'page_id'\\d+)@" |
| 30 | + url: https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fpermalink.php%3Fstory_fbid%3Dpfbid{@pfbid}%26id%3D{@page_id} |
| 31 | + - extract: |
| 32 | + - "@facebook.com/watch/?(?'type'v)=(?'id'\\d+)@" |
| 33 | + - "@facebook.com/(?'user'[.\\w]+)/(?'type'v)ideos/(?'id'\\d+)@" |
| 34 | + header: "User-agent: PHP (not Mozilla)" |
| 35 | + match: "@fb.watch/.@" |
| 36 | + - extract: |
| 37 | + - "@facebook.com/\\w+/(?'user'[.\\w]+)/permalink/(?'id'\\d+)(?!\\w)@" |
| 38 | + - "@og:url[^>]+facebook.com/(?'user'[.\\w]+)/(?'type'[pv])(?:ost|ideo)s?/(?:[-\\w%]+/)?(?'id'\\d+)\\b@" |
| 39 | + header: "User-agent: PHP (not Mozilla)" |
| 40 | + match: "@facebook.com/share/[pv]/\\w@" |
| 41 | +iframe: |
| 42 | + data-s9e-livepreview-ignore-attrs: style |
| 43 | + onload: let c=new MessageChannel;c.port1.onmessage=e=>this.style.height=e.data+'px';this.contentWindow.postMessage('s9e:init','*',[c.port2]) |
| 44 | + src: https://s9e.github.io/iframe/2/facebook.min.html#<xsl:choose><xsl:when test="@user"><xsl:value-of select="@user"/>/<xsl:choose><xsl:when test="@type='r'or@type='v'">video</xsl:when><xsl:otherwise>post</xsl:otherwise></xsl:choose>s/<xsl:choose><xsl:when test="@id"><xsl:value-of select="@id"/></xsl:when><xsl:otherwise>pfbid<xsl:value-of select="@pfbid"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="@id"><xsl:value-of select="@type"/><xsl:value-of select="@id"/></xsl:when><xsl:otherwise>pfbid<xsl:value-of select="@pfbid"/></xsl:otherwise></xsl:choose> |
| 45 | +amp: |
| 46 | + custom-element: "amp-facebook" |
| 47 | + src: "https://cdn.ampproject.org/v0/amp-facebook-0.1.js" |
| 48 | + template: <amp-facebook layout="responsive" width="640" height="360"><xsl:if test="starts-with(@type,'v')"><xsl:attribute name="data-embed-as">video</xsl:attribute></xsl:if><xsl:attribute name="data-href">https://www.facebook.com/<xsl:choose><xsl:when test="@user"><xsl:value-of select="@user"/></xsl:when><xsl:otherwise>user</xsl:otherwise></xsl:choose>/<xsl:choose><xsl:when test="starts-with(@type,'v')">video</xsl:when><xsl:otherwise>post</xsl:otherwise></xsl:choose>s/<xsl:value-of select="@id"/></xsl:attribute></amp-facebook> |
| 49 | +attributes: [] |
| 50 | +tracking_policy: https://www.facebook.com/help/1896641480634370 |
0 commit comments