用于 SEO Youtube 视频的 Web 应用程序,错误消息无权访问请求的对象
Posted
技术标签:
【中文标题】用于 SEO Youtube 视频的 Web 应用程序,错误消息无权访问请求的对象【英文标题】:Web Application for SEO Youtube Videos, err msg don't have permission to access the requested object 【发布时间】:2021-12-31 02:51:57 【问题描述】:编辑:我重新安装了 Xampp 并再次更改了 httpd.conf 文件,结果仍然无缘无故
我正在制作一个 SEO youtube 视频网站,该过程是将链接按下按钮,然后网站将进行分析。 第一阶段我要获取标题、描述、浏览量、点赞等。然后打印这些数据
第二阶段然后使用 Google 的 API 趋势检查它是否格式正确、标题和描述是否良好,然后给他 100 分此外,如果有人可以给我一个建议,或者如果有一个更好的过程来做到这一点(在寻找最佳 SEO 关键字和 API 谷歌趋势方面)
单击按钮后我在嵌入 Youtube 视频 URL 时遇到了问题我收到了这个错误消息我编辑了 httpd.conf,我在每个 <Directory
中添加了这个,但我仍然收到这个错误消息
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
Require all granted
这是我的 php 代码
$input_Url_data = '';
/* store the link of the video in a variable */
$input_Url_data = $_GET['url'] ;
echo $input_Url_data ;
echo '<span> <?php echo $input_Url_data ; ?></span>';
$id_position= '';
/* get the Video ID when the user click the button and make sure it's GET */
if($_SERVER['REQUEST_METHOD'] == "GET" and isset($_GET['submit']))
/* triming the link to get the id */
echo "</br >" ;
echo $input_Url_data . "Button clicked" ;
$id_position = strstr($input_Url_data,"=");
$id_position = trim($id_position, "=" );
/* embed the the link by the id */
echo '<iframe src="<?php echo "https://www.youtube.com/embed". $id_position ; ?> "title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>' ;
这是来自 xampp localhost 的网站
【问题讨论】:
【参考方案1】:你可以试试这个?
echo '<iframe src="<?php echo "https://www.youtube.com/embed/". $id_position ; ?> "title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>' ;
【讨论】:
您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center。 同样的结果,问题是服务器拒绝在 html 中使用任何 php 变量,我对 httpd.conf 文件进行了更改,同样的错误信息【参考方案2】:问题不在于 xampp,但经过很多文章后,我找到了一种嵌入 Youtube 视频的方法,该方法在属性中使用退格,我什至不知道为什么,但它正在工作
echo "<iframe position=\"center\"allow=\"accelerometer\"; gyroscope; width=\"420\" height=\"315\" src=\"http://www.youtube.com/embed/$ytcode\" frameborder=\"0\" allowfullscreen></iframe>";
【讨论】:
以上是关于用于 SEO Youtube 视频的 Web 应用程序,错误消息无权访问请求的对象的主要内容,如果未能解决你的问题,请参考以下文章
iOS 应用程序可以使用 youtube 加载 web 视图吗?
HTML 中的“href”值,用于在 Android 上的 youtube 应用程序或市场(Google Play)中打开视频