捕獲和轉換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.4.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")