zmfirst

www.gamestar.de Video embeds

Oct 6th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. ### VIDEO EMBEDS ###
  2. $video: $body//a[@data-label="video" and @data-action="open"]/../..
  3. @set_attr(class, "include-video"): $video
  4. $video: $body//*[has-class("include-video")]
  5.  
  6. @set_attr(poster, "./self::a/img/@src"): $video//a
  7. @set_attrs(src, @data-lbx-id, data-type, "inline-video"): $video//a
  8. @replace("(\\d+)", "/videos/embed,$1.html"): $video//a/@src
  9. <iframe>: $video//a[@src]
  10. <figcaption>: $video//*[has-class("bu")]
  11. <figure>: $video
  12.  
  13. @inline: $body//iframe[@data-type="inline-video"]
  14. $frame: $@
  15. @remove: $frame//head
  16. @remove: $frame//body/*[not(./self::script[contains(.,"file")])]
  17. $frame: $frame//script
  18. @match("\"sources\":([^\\]]+\\])", 1)
  19. @json_to_xml: $frame
  20. $frame: $@
  21. @set_attr(src, .//item[count(./default)=1]/file): $frame
  22. @remove: $frame/*
  23. <video>: $frame
  24.  
  25. ### /VIDEO EMBEDS ###
Add Comment
Please, Sign In to add comment