Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Dịch vụ Content ID của YouTube cho phép bạn sử dụng YouTube Content ID API trong Apps Script. API này cho phép nhà phát triển tương tác trực tiếp với hệ thống quản lý quyền Content ID của YouTube.
Là đối tác của YouTube, bạn có thể sử dụng API này để tạo và quản lý tài sản, quyền sở hữu và chiến dịch của mình.
Tài liệu tham khảo
Để biết thông tin chi tiết về dịch vụ này, hãy xem tài liệu tham khảo cho YouTube Content ID API công khai. Giống như tất cả các dịch vụ nâng cao trong Apps Script, dịch vụ YouTube Content ID nâng cao sử dụng cùng các đối tượng, phương thức và tham số như API công khai. Để biết thêm thông tin, hãy xem bài viết Cách xác định chữ ký phương thức.
/** * 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('Claim created on video %s: %s',videoId,claimInserted);}catch(e){console.log('Failed to create claim on video %s, error: %s',videoId,e.message);}}
Cập nhật quyền sở hữu
Hàm này cập nhật quyền sở hữu của bạn đối với một tài sản hiện có.
/** * 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('Ownership updated on asset %s: %s',assetId,updatedOwnership);}catch(e){console.log('Ownership update failed on asset %s, error: %s',assetId,e.message);}}
Huỷ bỏ thông báo xác nhận quyền sở hữu
Hàm này sẽ giải phóng một thông báo xác nhận quyền sở hữu hiện có mà bạn có đối với một video.
/** * 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 %s was released: %s',claimId,claimReleased);}catch(e){console.log('Failed to release claim %s, error: %s',claimId,e.message);}}
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-08-31 UTC."],[[["\u003cp\u003eThe YouTube Content ID API allows YouTube partners to manage their copyrighted content and rights through Apps Script.\u003c/p\u003e\n"],["\u003cp\u003eThis advanced service requires prior enabling and is exclusively available to YouTube content partners via the Google Developers Console.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use the API to automate tasks like claiming videos, updating asset ownership, and releasing claims, streamlining content management workflows.\u003c/p\u003e\n"],["\u003cp\u003eThe provided sample code demonstrates how to utilize the YouTube Content ID API for these tasks, offering practical examples for implementation.\u003c/p\u003e\n"],["\u003cp\u003eRefer to the reference documentation and YouTube API support guide for detailed information and troubleshooting assistance.\u003c/p\u003e\n"]]],[],null,[]]