本文介绍了我如何将 YouTube 喜欢和不喜欢以及比例从 YouTube 导入到 Google 表格中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将 YouTube 喜欢和不喜欢的视频从视频导入 Google 表格?
How would I import YouTube likes and dislikes from a video onto Google Sheets?
推荐答案
TITLE:
=IMPORTXML("https://www.youtube.com/watch?v=MkgR0SxmMKo","//*[@id='eow-title']")
=REGEXEXTRACT(QUERY(ARRAY_CONSTRAIN(IMPORTDATA(A12), 500, 1),
"where Col1 contains '/title'", 0), ">(.+)<")
=VALUE(REGEXREPLACE(TEXT(IMPORTXML("https://www.youtube.com/watch?v=MkgR0SxmMKo",
"//*[contains(@class, 'watch-view-count')]"),0)," view(s)?",""))
持续时间:
=SUBSTITUTE(REGEXREPLACE(IMPORTXML("https://www.youtube.com/watch?v=MkgR0SxmMKo","//*[@itemprop='duration']/@content"),"PT|S",""),"M",":")
喜欢:
=IF(ISNA(IMPORTXML("https://www.youtube.com/watch?v=MkgR0SxmMKo","(//*[contains(@class,'like-button-renderer-like-button')])[1]"))=TRUE,0,
IMPORTXML("https://www.youtube.com/watch?v=MkgR0SxmMKo","(//*[contains(@class,'like-button-renderer-like-button')])[1]"))
不喜欢:
=IF(ISNA(IMPORTXML("https://www.youtube.com/watch?v=MkgR0SxmMKo","(//*[contains(@class,'like-button-renderer-dislike-button')])[1]"))=TRUE,0,
IMPORTXML("https://www.youtube.com/watch?v=MkgR0SxmMKo","(//*[contains(@class,'like-button-renderer-dislike-button')])[1]"))
已上传:
=REGEXREPLACE(IMPORTXML("https://www.youtube.com/watch?v=MkgR0SxmMKo",
"//*[contains(@class, 'watch-time-text')]"),"((Uploaded)|(Published)|(Streamed live)) on ","")
订阅:
=IFERROR(MID(QUERY(IMPORTXML("https://www.youtube.com/channel/"&A1,
"//div[@class='primary-header-actions']"), "select Col1"), 31, 20), )
=INDEX(IMPORTHTML("https://www.youtube.com/channel/UC7_gcs09iThXybpVgjHZ_7g","list",1),1,1)
频道 ID:
=ARRAYFORMULA(REGEXREPLACE(QUERY(SUBSTITUTE(ARRAY_CONSTRAIN(
IMPORTDATA(https://www.youtube.com/watch?v=rckrnYw5sOA), 3000, 1), """", ""),
"where Col1 contains '<meta itemprop=channelId content='"),
"<meta itemprop=channelId content=|>", ""))
更新:
频道名称 (07/07/2021):
=REGEXEXTRACT(QUERY(FLATTEN(IMPORTDATA(A4)),
"where Col1 contains '\x22channelName\x22:\x22'", 0), ":\\x22(.+)\\x22$")
视频标题 (08/08/2021)
=REGEXEXTRACT(QUERY(FLATTEN(IMPORTDATA(A1)),
"where Col1 starts with 'title:""'", 0), """(.*)""")
这篇关于我如何将 YouTube 喜欢和不喜欢以及比例从 YouTube 导入到 Google 表格中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!