تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تتيح لك خدمة YouTube Content ID استخدام
YouTube Content ID API في Apps Script. تتيح واجهة برمجة التطبيقات هذه للمطوّرين التفاعل
مباشرةً مع نظام إدارة الحقوق في Content ID على YouTube.
بصفتك شريكًا في YouTube، يمكنك استخدام واجهة برمجة التطبيقات لإنشاء مواد العرض والمطالبات والحملات وإدارتها.
مراجع
للحصول على معلومات تفصيلية عن هذه الخدمة، يُرجى الاطّلاع على
مستندات المرجع لواجهة برمجة التطبيقات المتاحة للجميع YouTube Content ID API. مثل
جميع الخدمات المتقدّمة في Apps Script، تستخدم الخدمة المتقدّمة في Content ID على YouTube العناصر وال methods والمَعلمات نفسها المستخدَمة في واجهة برمجة التطبيقات المتاحة للجميع. لمزيد من المعلومات، اطّلِع على كيفية تحديد توقيعات الطرق.
للإبلاغ عن المشاكل والعثور على دعم آخر، يُرجى الاطّلاع على
دليل دعم YouTube API.
نموذج التعليمات البرمجية
يستخدِم نموذج الرمز البرمجي أدناه الإصدار 1 من YouTube Content ID API.
المطالبة بملكية الفيديو
تنشئ هذه الدالة مطالبة بملكية الفيديو التي حمّلها أحد الشركاء باستخدام مادة العرض وقواعد
السياسة المحدّدة.
/** * This function creates a partner-uploaded claim on a video with the specified * asset and policy rules. * @see https://developers.google.com/youtube/partner/docs/v1/claims/insert */functionclaimYourVideoWithMonetizePolicy(){// The ID of the content owner that you are acting on behalf of.constonBehalfOfContentOwner='replaceWithYourContentOwnerID';// A YouTube video ID to claim. In this example, the video must be uploaded// to one of your onBehalfOfContentOwner's linked channels.constvideoId='replaceWithYourVideoID';constassetId='replaceWithYourAssetID';constclaimToInsert={'videoId':videoId,'assetId':assetId,'contentType':'audiovisual',// Set the claim policy to monetize. You can also specify a policy ID here// instead of policy rules.// For details, please refer to the YouTube Content ID API Policies// documentation:// https://developers.google.com/youtube/partner/docs/v1/policies'policy':{'rules':[{'action':'monetize'}]}};try{constclaimInserted=YouTubeContentId.Claims.insert(claimToInsert,{'onBehalfOfContentOwner':onBehalfOfContentOwner});console.log('Claimcreatedonvideo%s:%s',videoId,claimInserted);}catch(e){console.log('Failedtocreateclaimonvideo%s,error:%s',videoId,e.message);}}
/** * This function updates your onBehalfOfContentOwner's ownership on an existing * asset. * @see https://developers.google.com/youtube/partner/docs/v1/ownership/update */functionupdateAssetOwnership(){// The ID of the content owner that you are acting on behalf of.constonBehalfOfContentOwner='replaceWithYourContentOwnerID';// Replace values with your asset idconstassetId='replaceWithYourAssetID';// The new ownership here would replace your existing ownership on the asset.constmyAssetOwnership={'general':[{'ratio':100,'owner':onBehalfOfContentOwner,'type':'include','territories':['US','CA']}]};try{constupdatedOwnership=YouTubeContentId.Ownership.update(myAssetOwnership,assetId,{'onBehalfOfContentOwner':onBehalfOfContentOwner});console.log('Ownershipupdatedonasset%s:%s',assetId,updatedOwnership);}catch(e){console.log('Ownershipupdatefailedonasset%s,error:%s',assetId,e.message);}}
سحب مطالبة
تؤدي هذه الدالة إلى إلغاء مطالبة حالية قدّمتها بملكية فيديو.
/** * This function releases an existing claim your onBehalfOfContentOwner has * on a video. * @see https://developers.google.com/youtube/partner/docs/v1/claims/patch */functionreleaseClaim(){// The ID of the content owner that you are acting on behalf of.constonBehalfOfContentOwner='replaceWithYourContentOwnerID';// The ID of the claim to be released.constclaimId='replaceWithYourClaimID';// To release the claim, change the resource's status to inactive.constclaimToBeReleased={'status':'inactive'};try{constclaimReleased=YouTubeContentId.Claims.patch(claimToBeReleased,claimId,{'onBehalfOfContentOwner':onBehalfOfContentOwner});console.log('Claim%swasreleased:%s',claimId,claimReleased);}catch(e){console.log('Failedtoreleaseclaim%s,error:%s',claimId,e.message);}}
تاريخ التعديل الأخير: 2024-12-21 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2024-12-21 (حسب التوقيت العالمي المتفَّق عليه)"],[[["The YouTube Content ID API allows YouTube partners to manage their copyrighted content and rights through Apps Script."],["This advanced service requires prior enabling and is exclusively available to YouTube content partners via the Google Developers Console."],["Developers can use the API to automate tasks like claiming videos, updating asset ownership, and releasing claims, streamlining content management workflows."],["The provided sample code demonstrates how to utilize the YouTube Content ID API for these tasks, offering practical examples for implementation."],["Refer to the reference documentation and YouTube API support guide for detailed information and troubleshooting assistance."]]],[]]