jikeLivePhoto

即刻查看livephoto的动态视频

  1. // ==UserScript==
  2. // @name jikeLivePhoto
  3. // @namespace http://jaxer.cc/
  4. // @description 即刻查看livephoto的动态视频
  5. // @version 2024-05-11
  6. // @author jaxer
  7. // @match https://m.okjike.com/originalPosts/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=okjike.com
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. document.addEventListener('DOMContentLoaded', function() {
  17. let json = document.getElementById("__NEXT_DATA__").innerText
  18. let data = JSON.parse(json)
  19. let postPic = data.props.pageProps.post.pictures
  20. postPic.forEach(p=>{
  21. if(p.livePhoto){
  22. console.log(p.livePhoto, p.livePhoto.videoUrl)
  23.  
  24. const warpElement = document.querySelector('.post-wrap');
  25. const newVideo = document.createElement('video');
  26.  
  27. // 设置视频的属性
  28. newVideo.src = p.livePhoto.videoUrl; // 替换为实际的视频URL
  29. newVideo.controls = true; // 添加控制条
  30. newVideo.autoplay = false; // 是否自动播放,默认为 false
  31. newVideo.loop = false; // 是否循环播放,默认为 false
  32. newVideo.muted = true; // 是否静音,默认为 false
  33. newVideo.style.width ="100%"
  34.  
  35. // 将 <video> 元素添加到 warp 元素的末尾
  36. warpElement.appendChild(newVideo);
  37. }
  38.  
  39. })
  40. });
  41.  
  42.  
  43. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址