【问题标题】:Youtube storyboard script - bigger thumbnail?Youtube 故事板脚本 - 更大的缩略图?
【发布时间】:2016-03-10 12:47:38
【问题描述】:

http://www.labnol.org/internet/print-youtube-video/28217/

javascript:(function(){a=ytplayer.config.args.storyboard_spec;if(!a){alert("Sorry we cannot process this YouTube video. Could you please try another one");exit();}b=a.split("|");base=b[0].split("$")[0] "2/M";c=b[3].split("#");sigh=c[c.length-1];var imgs="";t=ytplayer.config.args.length_seconds;n=Math.ceil(c[2]/(c[3]*c[4]));for(i=0;i<n;i  ){imgs ="<PICTURE='" base i ".jpg?sigh=" sigh "'><br/>";}var title=ytplayer.config.args.title;msg="<body style='background-color:#444;color:#eee;margin:20px auto;width:90%;text-align:center'><h2>TITLE</h2><div>IMAGES</div><br/><em><a href='http://labnol.org/?p=28217' style='text-decoration:none;color:#fff;font-style:bold'>Printed using the YouTube bookmarklet.</a></em></body>";msg=msg.replace("TITLE",title).replace("IMAGES",imgs).replace(/PICTURE/g,"img src");var labnol=window.open();labnol.document.open();labnol.document.write(msg);labnol.document.close();})();

1 - 我不知道如何使用此脚本获得更大的缩略图,可能是 youtube 有限的图像质量/分辨率框架,所以此代码无法获得更大的版本?

2 - 一些新视频 90-120 分钟 + 需要几天才能显示完整的视频缩略图,是真的吗?

谢谢

【问题讨论】:

    标签: youtube storyboard thumbnails


    【解决方案1】:

    这是美化版的小书签:

    (function() {
      a = ytplayer.config.args.storyboard_spec;
      if (!a) {
        alert("Sorry we cannot process this YouTube video. Could you please try another one");
        exit();
      }
      b = a.split("|");
      base = b[0].split("$")[0] + "2/M";
      c = b[3].split("#");
      sigh = c[c.length - 1];
      var imgs = "";
      t = ytplayer.config.args.length_seconds;
      n = Math.ceil(c[2] / (c[3] * c[4]));
      for (i = 0; i < n; i++) {
        imgs += "<PICTURE='" + base + i + ".jpg?sigh=" + sigh + "'><br/>";
      }
      var title = ytplayer.config.args.title;
      msg = "<body style='background-color:#444;color:#eee;margin:20px auto;width:90%;text-align:center'><h2>TITLE</h2><div>IMAGES</div><br/><em><a href='http://labnol.org/?p=28217' style='text-decoration:none;color:#fff;font-style:bold'>Printed using the YouTube bookmarklet.</a></em></body>";
      msg = msg.replace("TITLE", title).replace("IMAGES", imgs).replace(/PICTURE/g, "img src");
      var labnol = window.open();
      labnol.document.open();
      labnol.document.write(msg);
      labnol.document.close();
    })();
    

    这个页面(部分中文)似乎已经解开了我们可以用来计算 labnol 数学的计算方案: http://rplus.github.io/blog/2014/04/26/youtube-storyboard/

    $L 确定情节提要的大小以及每个“精灵”表的帧数。

    据此计算:

    L=1

    100(10*10),一共135(35多一个)

    L=2

    25(5*5),共135(5个大于10)

    L=3

    9(3*3),一共135(刚好15)

    对于假设的视频:

    b 变量包含两个小尺寸表 (10x10) 和两个较大尺寸的表

    console.log(b)
    ["https://i.ytimg.com/sb/xxx/storyboard3_L$L/$N.jpg",
     "48#27#100#10#10#0#default#XX-LJCqt8cvoKdNR-LktzyCucWU",
     "80#45#242#10#10#10000#M$M#XXtyvKla08ayOvovocCEGBGtgfM", 
     "160#90#242#5#5#10000#M$M#XXNLRJzk9xaC36siHPgNM_ZsIlQ", 
     "320#180#242#3#3#10000#M$M#XXYfUj9jA3iVRkZk4QpfYICc53A"]
    

    在计算c 时,书签作者丢弃了其他三个尺寸,只留下 160px (5x5) 尺寸。

    c = b[3].split("#");
    console.log(c[2], c[3], c[4], c[2]/(c[3]*c[4]));
    242 5 5 9.68
    

    9.68 的上限 = 10。

    如果我们将b[3] 替换为b[4],并将附加到URL 的'2/M' 修复为'3/M',我们将获得更高分辨率的图像。

    用大版本简单替换(有些视频没有大版本,会失败):

    javascript:(function()%7Ba%3Dytplayer.config.args.storyboard_spec%3Bif(!a)%7Balert("Sorry we cannot process this YouTube video. Could you please try another one")%3Bexit()%3B%7Db%3Da.split("%7C")%3Bbase%3Db%5B0%5D.split("%24")%5B0%5D%2B"3/M"%3Bc%3Db%5B4%5D.split("%23")%3Bsigh%3Dc%5Bc.length-1%5D%3Bvar imgs%3D""%3Bt%3Dytplayer.config.args.length_seconds%3Bn%3DMath.ceil(c%5B2%5D/(c%5B3%5D*c%5B4%5D))%3Bfor(i%3D0%3Bi<n%3Bi%2B%2B)%7Bimgs%2B%3D"<PICTURE%3D%27"%2Bbase%2Bi%2B".jpg%3Fsigh%3D"%2Bsigh%2B"%27><br/>"%3B%7Dvar title%3Dytplayer.config.args.title%3Bmsg%3D"<body style%3D%27background-color:%23444%3Bcolor:%23eee%3Bmargin:20px auto%3Bwidth:90%25%3Btext-align:center%27><h2>TITLE</h2><div>IMAGES</div><br/><em><a href%3D%27http://labnol.org/%3Fp%3D28217%27 style%3D%27text-decoration:none%3Bcolor:%23fff%3Bfont-style:bold%27>Printed using the YouTube bookmarklet.</a></em></body>"%3Bmsg%3Dmsg.replace("TITLE",title).replace("IMAGES",imgs).replace(/PICTURE/g,"img src")%3Bvar labnol%3Dwindow.open()%3Blabnol.document.open()%3Blabnol.document.write(msg)%3Blabnol.document.close()%3B%7D)()%3B
    

    使用最大的可用缩略图制作工作表:

    javascript:void%20function(){a=ytplayer.config.args.storyboard_spec,a||(alert(%22Sorry%20we%20cannot%20process%20this%20YouTube%20video.%20Could%20you%20please%20try%20another%20one%22),exit()),b=a.split(%22|%22),sz=b.length-1,base=b[0].split(%22$%22)[0]+(sz-1)+%22/M%22,c=b[sz].split(%22%23%22),sigh=c[c.length-1];var%20e=%22%22;for(t=ytplayer.config.args.length_seconds,n=Math.ceil(c[2]/(c[3]*c[4])),i=0;i%3Cn;i++)e+=%22%3CPICTURE='%22+base+i+%22.jpg%3Fsigh=%22+sigh+%22'%3E%3Cbr/%3E%22;var%20o=ytplayer.config.args.title;msg=%22%3Cbody%20style='background-color:%23444;color:%23eee;margin:20px%20auto;width:90%25;text-align:center'%3E%3Ch2%3ETITLE%3C/h2%3E%3Cdiv%3EIMAGES%3C/div%3E%3Cbr/%3E%3Cem%3E%3Ca%20href='http://labnol.org/%3Fp=28217'%20style='text-decoration:none;color:%23fff;font-style:bold'%3EPrinted%20using%20the%20YouTube%20bookmarklet.%3C/a%3E%3C/em%3E%3C/body%3E%22,msg=msg.replace(%22TITLE%22,o).replace(%22IMAGES%22,e).replace(/PICTURE/g,%22img%20src%22);var%20r=window.open();r.document.open(),r.document.write(msg),r.document.close()}();
    

    更新 这不在书签中,但实时环聊视频故事板隐藏在 ytplayer.config.args.live_storyboard_spec 例如

    "https://i.ytimg.com/sb/xx/storyboard_live_60_3x3_b1/M$M.jpg?sigh=xx3f9uQQKI3j8yTiD2qO7_GynM8#106#60#3#3"
    

    【讨论】:

    • 结果是一样的,但是谢谢.....代码取决于 youtube res.... 我总是下载视频然后使用 4000width、第 10 行第 8 行的 THUMBNAIL ME 3.0 来制作缩略图视频
    猜你喜欢
    • 2012-07-05
    • 1970-01-01
    • 1970-01-01
    • 2012-05-26
    • 2014-02-17
    • 2014-02-25
    • 2011-05-07
    • 2018-09-20
    • 2016-04-18
    相关资源
    最近更新 更多