gpt4 book ai didi

javascript - 如何通过 iMacros 获取当前的 YouTube ID?

转载 作者:行者123 更新时间:2023-11-29 15:28:40 26 4
gpt4 key购买 nike

我想获取当前观看的 YouTube 视频 ID 并通过 iMacros 保存到 CSV,但它什么也得不到。这是JS代码:

var videoid;
videoid ="CODE:";
videoid +="URL GOTO=https://www.youtube.com/watch?v=DBNYwxDZ_pA"+"\n";
videoid +="ADD !EXTRACT {{!URLCURRENT}}"+"\n";
videoid +="SET !VAR1 EVAL(\"var s=\"{{!URLCURRENT}}\"; s.match((?<=watch\\?v=|/videos/|embed\\/)[^#\\&\\?]*);s[0]; \")"+"\n";
videoid +="ADD !EXTRACT {{!VAR1}}"+"\n";
videoid +="SAVEAS TYPE=EXTRACT FOLDER=* FILE=url.csv"+"\n";

最佳答案

尝试这样的事情:

var videoid = "URL GOTO=https://www.youtube.com/watch?v=DBNYwxDZ_pA" + "\n";
videoid += "SET !EXTRACT {{!URLCURRENT}}" + "\n";
videoid += 'SET !EXTRACT EVAL("\'{{!EXTRACT}}\'.match(/v=(.{11})/)[1];")' + "\n";
videoid += "SAVEAS TYPE=EXTRACT FOLDER=* FILE=url.csv" + "\n";
iimPlayCode(videoid);

关于javascript - 如何通过 iMacros 获取当前的 YouTube ID?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36830305/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com