捕获和转换Web的工具

YouTube影片已被移除,有年龄限制或在其拍摄国家/地区不可用

将YouTube视频转换为GIF动画时,可能会发生此错误,并且表示该视频由于年龄限制,已被删除或从错误的国家/地区观看而无法转换。 尽管对于已删除的视频无法采取任何措施,但还有其他两个错误的解决方案。

解决年龄限制错误

要观看有年龄限制的视频,您需要使用已确认年龄的YouTube帐户。 为此,您应该登录YouTube并在浏览器中打开开发人员工具,通常方法是按F12,然后找到该网页的Cookie。 然后确定YouTube的会话Cookie,当前称为 SID SSID。 然后使用以下代码将这些Cookie的名称,域名和值添加到GrabzIt中: 自定义Cookie页面,最好在以后长时间使用到期日期,以确保不会删除会话cookie。 请注意,此操作需要您自担风险,根据我们的规定,我们不承担任何责任 条款和条件.

解决错误的国家/地区错误

您可以通过在请求转换为仅限一个国家/地区的视频的转换时指定其他国家/地区代码来绕过此问题。

目前一个 国家可以设置为美国,英国或新加坡,下面是为我们的每个API库设置国家/地区的示例。

GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
AnimationOptions options = new AnimationOptions();
options.Country = Country.US;
grabzIt.URLToAnimation("https://www.youtube.com/watch?v=a1Y73sPHKxw", options);
grabzIt.Save("http://www.mywebsite.com/Home/Handler");
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
AnimationOptions options = new AnimationOptions();
options.setCountry(Country.UNITEDSTATES);
grabzIt.URLToAnimation("https://www.youtube.com/watch?v=a1Y73sPHKxw", options);
grabzIt.Save("http://www.mywebsite.com/handler");
<script src="https://cdn.jsdelivr.net/npm/@grabzit/js@3.3.7/grabzit.min.js"></script>
<script>
GrabzIt("Sign in to view your Application Key").ConvertURL("https://www.youtube.com/watch?v=a1Y73sPHKxw", 
{"format":"gif", "country":"US"}).Create();
</script>
var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");
client.url_to_animation("https://www.youtube.com/watch?v=a1Y73sPHKxw", {"country":"US"});
client.save("http://www.example.com/handler", function (error, id){
    if (error != null){
        throw error;
    }
});
$grabzIt = GrabzItClient->new("Sign in to view your Application Key", "Sign in to view your Application Secret");
$options = GrabzItAnimationOptions->new();
$options->country("US");
$grabzIt->URLToAnimation("https://www.youtube.com/watch?v=a1Y73sPHKxw", $options);
$grabzIt->Save("http://www.mywebsite.com/handler.pl");
$grabzIt = new \GrabzIt\GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
$options = new \GrabzIt\GrabzItAnimationOptions();
$options->setCountry("US");
$grabzIt->URLToAnimation("https://www.youtube.com/watch?v=a1Y73sPHKxw", $options);
$grabzIt->Save("http://www.mywebsite.com/handler.php");
grabzIt = GrabzItClient.GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret")
options = GrabzItAnimationOptions.GrabzItAnimationOptions()
options.country = "US"
grabzIt.URLToAnimation("https://www.youtube.com/watch?v=a1Y73sPHKxw", options)
grabzIt.Save("http://www.mywebsite.com/handler.py")
grabzIt = GrabzIt::Client.new("Sign in to view your Application Key", "Sign in to view your Application Secret")
options = GrabzIt::AnimationOptions.new()
options.country = "US"
grabzIt.url_to_animation("https://www.youtube.com/watch?v=a1Y73sPHKxw", options)
grabzIt.save("http://www.mywebsite.com/handler/index")