【從學員練習影片觀察到一個關於 TDD 的有趣現象】
極速開發的課後練習作業,雖說重點是放在極速開發要學習的技巧與刻意練習的模型,但開發的方式、順序也是刻意安排成類似 TDD 的進行方式,來讓生產力最大化(TDD 本來就是幫助開發的,不是幫助測試的)
我從2位第一次上我課的學員(當然就是 #極速開發,代表他們沒上過#單元測試 跟 #TDD與持續重構),雖然他們是照著示範影片、上課教學用 TDD 在寫整個 tennis 的過程,但從他們執行測試的時間點就可以發現:
「他是用測試來驗證 production code 的正確性」,即使他先寫了測試,也不先執行,沒有看到紅燈,每次都等到 production code 寫完了,應該要綠燈時,才執行測試。
而其他上過 TDD 課的同學 ,或是上過單元測試的同學,知道測試是用來描述情境,如果現在「加入的這個情境是新的需求或需求異動,代表目前 production code 還不支援這個情境,執行測試跑出的紅燈,就是等等 production code 要完成的 #目標」
test-frist 從來都只是 TDD 其中一個小小的衍生產物,而不是全貌。TDD, 測試驅動開發 從來都是一種開發方法,而不是測試方法。
總有些人老愛把 TDD 拿來跟測試相提並論,就總是喜歡把 test-first 當作靶子打,覺得違反人性跟直覺,覺得先寫測試在很多情況下是浪費時間或是不 work,可能拿來跟一堆測試的方法論相提並論,或總是只拿回歸測試的效益來當作 TDD 的整體。抑或是陷入 isolation unit test 與 integration test (其實就是非 isolation 等級、有實際依賴的自動測試)之爭。
```
註:TDD 事實上是可以不是單元測試等級的。
```
要比較正確看待 TDD 的角度,首先要知道它是幫助開發的、它是一種開發方式(當然不是唯一一種,甚至也不會是最好的一種,因為根本沒有最好,只有剛好)
接著要了解 TDD 可能用 IPO 模型還比較貼切,input-process-output,在你開發任何功能之前,你總要先想過這件事。而先想這件事,才是 TDD 的最基本精神。
接著是怎麼把你想好的東西,變成可執行的 spec,我們只是用測試程式來「描述」你腦袋中的「IPO模型」,把 process 的過程當作一個黑箱子。
而這個 IPO 模型在結合成「使用情境」,就會帶來「高易用性 API 的好處」,只有在一開始就先想好怎麼給別人用,最後才會好用。所謂的一開始想好,指的不是預先設計一堆 class,而是 input/output 想清楚期待(一般會結合實例化需求,搭配 Given/When/Then 的 gherkin style 來把前置條件、資料、前提想好,當發生什麼事,應該是怎樣的結果),然後描述它。在紅燈定義清楚目標,綠燈完成 input/output 關係且沒弄壞前面的所有情境後,來針對 process 進行重構(事實上 Kent Beck 的 TDD by Example 更多是用 refactor 來 #完成 process。
```
註:所謂的 output 不一定只有回傳值,包含外部依賴狀態、資料的改變,甚至顆粒度小一點,針對物件導向設計的話,物件內部狀態的改變也算,只是物件內部狀態改變,驗證點要嘛是拿得到內部狀態,要嘛就是要驗證物件哪個行為會因這個內部狀態而有所不同。
```
## 戰 TDD 之前該先做好的功課
要戰 TDD,是不是至少要把 Kent Beck 的 TDD by Example 看完?
要戰 TDD,請不要拿它跟測試方法論來比,那只是一下就被人看破手腳。因為它是個開發方法論。
要戰 TDD,請不要把它的好處只限縮在跟回歸測試、自動測試的比較,因為那只是它的衍生好處,當你試過在白海報紙上 TDD 就懂,TDD 是在釐清你的思緒的同時,又可以以終為始,確保你在 production code 的每一個動作都是為了滿足某個期待的情境。
要戰 TDD,請不要去把 單元測試、整合測試捲進來,那是測試的顆粒度,那是測試的分類,TDD 從來都不是只能限於單元測試。
要戰 TDD,請不要在那邊戰他是 bottom-up ,是直接從程式/class 的角度出發,事實上 TDD 既不是 bottom-up, 也不是 top-down, (書裡面就有講這件事咩),實務上的 TDD 結合倫敦派(GOOS)跟芝加哥派(Classic TDD),會更像 Outside-In 的進行方式,先定義好驗收情境,接著從最外部(也就是使用者看得到的部份)一路把依賴往另一邊的系統邊界推,直到推到系統以外的依賴資源(persistence 或 external API/service)
```
註: ATDD by Example 中 ATDD by Example, Kent Beck 寫的序最後的一段話。
Kent Beck:
「就像我曾說過的,TDD的一個缺點是,它可能會退化為一種用來滿足開發人員需求的編程技能。某些開發人員從更廣泛的角度來看待TDD,輕易在他們測試的不同抽象級別間跳躍。然而在ATDD中不存在歧義,這是一種加強與非編程人員溝通的技術。我們之間良好的協作關係,以及作為這種關係基礎的溝通,能夠使軟件開發更有效率。採用ATDD是向著溝通更清晰這個目標邁進的重要一步,而此書是一本全面又平易近人的入門讀物。」
```
要戰 TDD,請不要只關注在 test-frist,因為他只是用 test 來幫助你 think-first,不要邊寫邊想。然後不要過份依賴或相信你腦袋的能力,把你想好的東西具體化出來,最好可以被直接執行,最好除了你以外每個人執行出來的結果都會一樣(不管是對的,還是錯的)
要戰 TDD, 請不要把論點放在見樹不見林,如果你有看 TDD by Example 的 Part 1, Part 2 那兩個加起來共 24 個章節,就知道一開始就得把當下想到的全貌紀錄在一個「紙本」的 backlog (所謂的紙本,只是要講這並不依賴於任何工具)
而這個需求輪廓的全貌,會隨著你逐漸完成一部分一部分的情境,設計逐漸浮現後,而隨時跟著增減調整。
但不代表 TDD 就是先想到一個測試案例,就直接先幹下去了,那根本是亂搞。
以上這些,都還不是在列 TDD 的好處,而是針對那些從來沒搞懂 TDD 但又愛戰 TDD 的人一點提醒,你戰的很可能是「你誤解的 TDD」。
TDD 還有許多實務上的用途,列上我在譯者序中的一小段:
>> 測試驅動開發(Test-Driven Development, TDD)!一種以測試為開發輔助、以測試來描述需求情境、以測試來當作目標、以測試來表達期望、以測試來驗證疑問、以測試來實驗學習、以測試來溝通協作、以測試來協助設計高易用性 API 的「開發方法」。
譯者序有開放給大家看,請見:https://tdd.best/book/tdd-by-example/
拜託,要戰之前去看一下祖師爺 Kent Beck 對 TDD 的原始見解:https://www.tenlong.com.tw/products/9789864345618?list_name=srh
如果你想正確的使用 TDD 來幫助你在實務上產生許多的價值,帶來許多的好處,尤其是需求釐清、持續重構、小步快跑的部份,最好理解的培訓課就在這:https://tdd.best/courses/classic-tdd-by-example-video-training/
最後我想講一段話:
TDD 從來都不該被導入到團隊中,但它是一種很好的自我鍛鍊與學習的方式,也是一種能用很低的成本來帶來很多好處的開發方法(見下方註腳),然而它也不是適用所有的情況,但它可以讓『完美』變成一個動詞,而非不變的形容詞。
```
註:
Kent Beck 在 DHH 靠腰:《TDD is Dead》 之後寫的一篇反串文:《RIP TDD》
https://www.facebook.com/notes/1063422864115918/
我幾年前的簡易翻譯,通常也是 TDD 可以幫助你解決的問題,如下:
- Over-engineering (過度設計)
- API feedback (改善API的設計與可用性)
- Logic errors (想的跟寫的不一樣,寫的跟需求不一樣)
- Documentation (寫跟維護文件是痛苦的)
- Feeling overwhelmed (找不到切入點)
- Separate interface from implementation thinking (抽象設計)
- Agreement (確保已修正問題的證據)
- Anxiety (改東壞西的擔心受怕)
```
很久沒對 TDD 發表這種長篇大論了,因為不理解、不想理解、不同角度理解的人居多,能真的到各自的塔上用不同角度來看原義,以及實務上用它來幫助解決的問題有哪些的人,真的太少。
大部分人只想針對這個詞彙來攻訐以博得流量跟吸引目光,而不是想著「我可以用它來幫助我什麼」
問題跟需求是中性的,解決問題跟滿足需求的手段與方式有千萬種,不會只有一種,也不會有所謂的對錯,多點角度去了解不同的方法、方式,然後融會貫通,發揮綜效,在實務上用最少的成本與風險來產生最大的價值,這才是真正的目標。
導入敏捷不該是目標,導入 TDD 也不該是目標,目標永遠都是在實務上產生價值、解決問題、滿足需求。
同時也有327部Youtube影片,追蹤數超過11萬的網紅Frugal Outdoors & Camping,也在其Youtube影片中提到,Kisah ke-2 pengalaman misteri sewaktu bercamping di muara sungai yang sunyi, jauh dari penempatan manusia pada tahun 2018. Jom Follow/Like Social Med...
「api video」的推薦目錄:
- 關於api video 在 91 敏捷開發之路 Facebook 的最佳貼文
- 關於api video 在 Facebook 的最佳貼文
- 關於api video 在 Facebook 的精選貼文
- 關於api video 在 Frugal Outdoors & Camping Youtube 的最佳貼文
- 關於api video 在 David Teo Youtube 的最讚貼文
- 關於api video 在 DESTINASI TV Youtube 的最佳貼文
- 關於api video 在 Videos | YouTube Data API | Google Developers 的評價
- 關於api video 在 Graph API Video - Facebook for Developers 的評價
- 關於api video 在 What is an API? - YouTube 的評價
- 關於api video 在 api.video - GitHub 的評價
- 關於api video 在 Top 10 Best Video APIs: YouTube, Twitch, Netflix - Rakuten ... 的評價
- 關於api video 在 YouTube API to fetch all videos on a channel - Stack Overflow 的評價
- 關於api video 在 YouTube API to fetch all videos on a channel - Stack Overflow 的評價
- 關於api video 在 Fetch video details on Youtube using API v3 in PHP - Stackify 的評價
api video 在 Facebook 的最佳貼文
Video ni lalu kat timeline pagi ni .. ingat tadi si Naim Daniel bukan rupanya @firdausrasid_
Teringat dulu2 main lompat getah
Main bet tali bet .. tapi adik ni power giler dia punya step..
acik tengok jer ler ..nak lompat rupe itu idok ler
Terfollow tampa sengaja tak kenal pun tapi cam best .. All the best mana tahu satu hari nanti jadi artis budak ni 😃
Selamat Hari Merdeka 🌸
Hahaha dulu2 merdeka siap booking hotel kat depan klcc nak tengok bunga api kat atas kepala punya pasal .. Sekarang duduk di rumah ek jaga S O P
api video 在 Facebook 的精選貼文
"Cik Hamka, betul ke hukumnya berdosa jika post gambar makanan?, sebab kesian pada orang miskin sebab tak mampu beli makanan?”
Jawapan, korang boleh pilih mana satu:
A) Takde siapa paksa korang follow, like, share. Wall FB dan IG ada tingkap, tuan rumah buka tingkap korang pun intai, nampak makanan lazat korang pun dengki tak nak bersyukur dengan nikmat yang ada apahal pulak tukang post yang berdosa?. Adohai...
Jika mampu beli smartphone, mesti mampu beli makanan. Sebab harga smartphone lagi mahal dari sepinggan makanan. Lagipu patut Syukur tengok kawan post gambar makanan bermakna kawan korang tak lapar, korang nak ada kawan post gambar terbaring kurung kering lalat pebuh mulut?
C) Jika post gambar makanan berdosa, habis berdosa semua KFC, Pizza, Mc D yang mana waktu kita tengok berita update covid 19 sekali keluar ayam goreng rangup berasap. Wajib dah buang TV ada iklan jika korang hati tisu mudah dengki tengok nikmat orang lain yang dilebihkan.
D) Benda boleh skroll, boleh unfollow, boleh skip buat apa nak kecoh?. Yang salah post gambar makanan dan tak bersyukur dengan rezeki itu memang nak kena kecam.
E) Zaman nabi ada orang sengaja asapkan dapur agar jiran jiran sangka dia sedang memasak maka tak perlulah jiran susah hati nak kena sedekah ke tak?Jadi jika ada orang post gambar makanan dan dia gembira dengan makanan tu, alhamdulillah. Dia orang senang jadi kita tak perlu bantu dia. Alhamdulillah
F) Di musim PKP ni ada mak mertua risau anak cucu makan apalah tu? Terus saya up gambar makanan terus mak mertua lega dan bersyukur ada menantu yang pandai jaga anak cucu.
G) Ada yang kongsi resepi dan itulah tanda syukur, saling berkongsi resepi. Saya ada post youtube cara buat teh tarik tersedap bersama telur separuh masak. Ramai yang email personal berterima kasih dapat buat teh untuk suami tersayang yang dah lama rindu mengeteh lalu terubat rindunya melalui tip dari video saya. Ini ada beberapa video saya kongsi:
Cara mudah buat Teh Tarik tersedap: https://youtu.be/I10NuF_BKCA
Cara mudah masak ketupat Sotong gaya Terengganu: https://youtu.be/SEGdKSDo0Rk
Cara mudah masak Ketap lemak cili Api: https://youtu.be/3NNs_DMahh0
Cara mudah masak Laksa Terengganu kuah lemak https://youtu.be/cChzw8TGtfQ
Cara mudah makan nasi goreng bersudu keropok: https://youtu.be/tbOwK0oQUJM
Cara mudah masa telur separuh masak: https://youtu.be/O4g0vC5n5lo
Cara mudah siang ikan tanpa pisau:
https://youtu.be/N6v3Ta5WXHs
H) NGO share gambar bagi orang miskin makan pun kena kecam, apa lagi kau pos gambar sedang makan, akan ada yang kecam, maka ingatalah Nabi pun kena kecam, maka jika hati tisu janganlah main FB.
I) Jika kawan kita pos makanan lazat atau makan durian, dan dia ada hutang kita sejumlah wang bolehlah kita komen: Wah.. sedap makan mewah., hutang bila nak bayar?
J) Semua di atas.
Ps: Rujuk gambar: Semua tu saya masak sendiri, bagi bini rehat sekali sekala apa salahnya?, resepi kambing perap, ayam masak kunyit, milo ais. Perghhhh, Alhamdulillah masih wujud suami yang memasak untuk bini di dunia ini, lambat lagilah nak kiamat, mak mertua, sila like dan kagum dari jauh akan menantu awak ni.
Woha!
api video 在 Frugal Outdoors & Camping Youtube 的最佳貼文
Kisah ke-2 pengalaman misteri sewaktu bercamping di muara sungai yang sunyi, jauh dari penempatan manusia pada tahun 2018.
Jom Follow/Like Social Media F.O.C:
Di Facebook: https://web.facebook.com/FCampM/
Di Intagram: https://www.instagram.com/frugal_outdoors_camping/?hl=en
Kedai Shopee F.O.C https://shopee.com.my/sham_foc?categoryId=130&itemId=3873836477
Untuk Business/Review/send me your product deal via email frugaloutdoorchannel@gmail.com
FAQ (soalan popular & jawapan)
1) Q: Tent yg FOC pakai sekarang
A: Naturehike Cloud Up 2 (https://shopee.com.my/Naturehike-Cloud-Up-2-Person-Tent-Free-Standing-Ultralight-Camping-Tent-i.129217730.2134224500)
2) Q: Flysheet yg FOC pakai sekarang
A: Hisea 3x3 meter (tak dijual lagi sekarang,company stop production)
3) Q: Guna kamera apa
A: Canon 200D (kit lens & canon 50mm + GoPro Hero 6 & 7)
4) Q: Guna motor apa
A: Bajaj/Modenas V15 (dah modi@custom,kos RM3200+) (DAH JUAL)
5) Q: Tak takut hantu ke
A: Ajaran Islam tak suruh takut hantu,percaya wujud je geng hehe
6) Q: Pernah kena ganggu/jumpa hantu?
A: Ada 2 kisah misteri sahaja(dah di ceritakan dalam video lepas), selain dari itu tiada pengalaman lain @ jumpa hantu depan2.
7) Q: Boleh join?
A: Tak janji boleh (tak plan trip biasa last minit suka2 hati je on)
8) Q: Macam tengok arah Kiblat
A: Ada jual kompas Kiblat atau boleh guna aplikasi di HP
9) Q: Macam mana berak/kencing
A: Tempat xda toilet guna konsep korek&kambus,cuci guna air sungai/laut
10) Q: Nama alat nyalakan api gores-gores tu apa
A: Ferro Rod (https://shopee.com.my/Ferro-Rod-Fire-Starter-F.O.C-i.283444682.6744637782)
11) Q: Kasut boot yang digunakan
A: Altama Maritime Assault Mid Cut (https://www.facebook.com/Original-SWAT-Malaysia-192432156259)
12) Q: Seluar outdoor yang dipakai
A: Mahameru Survival Soul (Indonesia) xda jual kat Malaysia.
13) Q: Abg ni solat tak??
A: Kalau tak solat,tak ingat Tuhan kau ingat aku berani ke camping sorang-sorang tu hihi ( tak semua benda nak kena tunjuk kan)
14) Q: Harga kayak biru FOC
A: RM1000,model basic S.O.T kayak,seller MAG,boleh ke group ni kalau nk beli https://www.facebook.com/groups/2474750919427088/?ref=bookmarks
#campingmalaysia #horrorstory #wildcamping
api video 在 David Teo Youtube 的最讚貼文
tular rakaman video memaparkan seorang anggota bomba ditumbuk oleh seorang lelaki ketika sedang menjalankan kerja-kerja pemadaman kebakaran sebuah rumah di Lawas, Sarawak
KECANGGIHAN KERETA API KELAJUAN TINGGI DI CHINA.
https://youtu.be/3kGJwSAN9hs
AKHIRNYA MH370 DITEMUI
https://youtu.be/eYkEA3YECXs
LANGKAH MENGGUNAKAN HAND SANITIZER DENGAN BETUL
https://youtu.be/IJ0yIKCbpqY
SIMPTOM COVID-19 YANG ANDA PERLU TAHU!!
https://youtu.be/0cNpZOSmy5A
GEMPA BUMI MENGGEGARKAN KEPULAUAN MALUKU, INDONESIA!
https://youtu.be/yYYiEDprugE
#InfoKini #Kurung #IsteriAnak #IsuSemasa #trending #viral
====================================================
Subscribe Youtube DavidTeo : https://www.youtube.com/user/davidteoMETROWEALTH
Instagram : https://www.instagram.com/davidteo99
Facebook : https://www.facebook.com/davidteo99
SILA LIKE, COMMENT, SUBSCRIBE, & SHARE.
Copyright By / Hakcipta Terpelihara : MIG Pictures.Sdn.Bhd
api video 在 DESTINASI TV Youtube 的最佳貼文
Restoran House of Patin Lipis menampilkan udang galah masak lemak sebagai menu yang dipilih. Dikatakan sebagai menu tradisi di bandar Lipis, Pahang dan kini dibawa datang ke bandar Kuala Lumpur.
?Lokasi 2 » House of Patin Lipis / https://instagram.com/lipis.dikl
5, Jalan Liew Weng Chee Off Jalan Yap Kwan Seng, Kuala Lumpur
☎️ Telefon » 03-21817845
#destinasitv #houseoflipis #asmr
Bermula pada tahun 2017, Destinasi TV melihat budaya kulinari dan darmawisata sebagai pintu kepada sejarah, tradisi dan evolusi masyarakat tempatan.
Merupakan sebahagian dari Kumpulan Manggis (https://manggis.group), Destinasi TV menghasilkan siri video digital yang menghiburkan, mendidik dan berkualiti tinggi untuk tayangan umum secara percuma di platform seperti Youtube, Facebook, Instagram, IFlix dan Dim Sum.
Destinasi TV terkenal dengan siri video digital seperti “Mat Salleh Cari Makan”, “Kembara Ramadan Rhys”, “Pilihan Terbaik”, “Sembang Bros”, “The Nasi Lemak Show”, dan “Trek Artisan”.
api video 在 Graph API Video - Facebook for Developers 的推薦與評價
Graph API Video. ... Graph API · Overview · Get Started · Guides · Server-Sent Events · Changelog · Features Reference · Permissions Reference · Reference. ... <看更多>
api video 在 Videos | YouTube Data API | Google Developers 的推薦與評價
All videos uploaded via the
videos.insert
endpoint from unverified API projects created after 28 July 2020 will be restricted to private
viewing mode. To lift this restriction, each API project must
undergo an audit to verify
compliance with the Terms of
Service. Please see the API
Revision History for more details.
A
video
resource represents a YouTube video.Methods
The API supports the following methods for
getRatingvideos
resources:Retrieves the ratings that the authorized user gave to a list of specified videos.
Try it now. list
Returns a list of videos that match the API request parameters.
Try it now. insert
Uploads a video to YouTube and optionally sets the video's metadata.
update
Updates a video's metadata.
Try it now. delete
Deletes a YouTube video.
Try it now. rate
Add a like or dislike rating to a video or remove a rating from a video.
Try it now. reportAbuse
Report a video for containing abusive content.
Try it now.
Resource representation
The following JSON structure shows the format of a
videos
resource:Properties
The following table defines the properties that appear in this resource:
Properties
kind
string
Identifies the API resource's type. The value will be
youtube#video
.etag
etag
The Etag of this resource.
id
string
The ID that YouTube uses to uniquely identify the video.
snippet
object
The
snippet
object contains basic details about the video, such as its title, description, and category.snippet.publishedAt
datetime
The date and time that the video was published. Note that this time might be different than the time that the video was uploaded. For example, if a video is uploaded as a private video and then made public at a later time, this property will specify the time that the video was made public.
There are a couple of special cases: If a video is uploaded as a private video and the video metadata is retrieved by the channel owner, then the property value specifies the date and time that the video was uploaded. If a video is uploaded as an unlisted video, the property value also specifies the date and time that the video was uploaded. In this case, anyone who knows the video's unique video ID can retrieve the video metadata. The value is specified in ISO 8601 format.
snippet.channelId
string
The ID that YouTube uses to uniquely identify the channel that the video was uploaded to.
snippet.title
string
The video's title. The property value has a maximum length of 100 characters and may contain all valid UTF-8 characters except < and >. You must set a value for this property if you call the
videos.update
method and are updating thesnippet
part of avideo
resource.snippet.description
string
The video's description. The property value has a maximum length of 5000 bytes and may contain all valid UTF-8 characters except < and >.
snippet.thumbnails
object
A map of thumbnail images associated with the video. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail.
snippet.thumbnails.(key)
object
Valid key values are:
default
– The default thumbnail image. The default thumbnail for a video – or a resource that refers to a video, such as a playlist item or search result – is 120px wide and 90px tall. The default thumbnail for a channel is 88px wide and 88px tall.medium
– A higher resolution version of the thumbnail image. For a video (or a resource that refers to a video), this image is 320px wide and 180px tall. For a channel, this image is 240px wide and 240px tall.high
– A high resolution version of the thumbnail image. For a video (or a resource that refers to a video), this image is 480px wide and 360px tall. For a channel, this image is 800px wide and 800px tall.standard
– An even higher resolution version of the thumbnail image than thehigh
resolution image. This image is available for some videos and other resources that refer to videos, like playlist items or search results. This image is 640px wide and 480px tall.maxres
– The highest resolution version of the thumbnail image. This image size is available for some videos and other resources that refer to videos, like playlist items or search results. This image is 1280px wide and 720px tall.snippet.thumbnails.(key).url
string
The image's URL.
snippet.thumbnails.(key).width
unsigned integer
The image's width.
snippet.thumbnails.(key).height
unsigned integer
The image's height.
snippet.channelTitle
string
Channel title for the channel that the video belongs to.
snippet.tags[]
list
A list of keyword tags associated with the video. Tags may contain spaces. The property value has a maximum length of 500 characters. Note the following rules regarding the way the character limit is calculated: The property value is a list, and commas between items in the list count toward the limit. If a tag contains a space, the API server handles the tag value as though it were wrapped in quotation marks, and the quotation marks count toward the character limit. So, for the purposes of character limits, the tag Foo-Baz contains seven characters, but the tag Foo Baz contains nine characters.
snippet.categoryId
string
The YouTube video category associated with the video. You must set a value for this property if you call the
videos.update
method and are updating thesnippet
part of avideo
resource.snippet.liveBroadcastContent
string
Indicates if the video is an upcoming/active live broadcast. Or it's "none" if the video is not an upcoming/active live broadcast.
Valid values for this property are:
live
none
upcoming
snippet.defaultLanguage
string
The language of the text in the
video
resource'ssnippet.title
andsnippet.description
properties.snippet.localized
object
The
snippet.localized
object contains either a localized title and description for the video or the title in the default language for the video's metadata. Localized text is returned in the resource snippet if thevideos.list
request used thehl
parameter to specify a language for which localized text should be returned and localized text is available in that language. Metadata for the default language is returned if anhl
parameter value is not specified or a value is specified but localized metadata is not available for the specified language. The property contains a read-only value. Use thelocalizations
object to add, update, or delete localized titles.snippet.localized.title
string
The localized video title.
snippet.localized.description
string
The localized video description.
snippet.defaultAudioLanguage
string
The
default_audio_language
property specifies the language spoken in the video's default audio track.contentDetails
object
The
contentDetails
object contains information about the video content, including the length of the video and an indication of whether captions are available for the video.contentDetails.duration
string
The length of the video. The property value is an ISO 8601 duration. For example, for a video that is at least one minute long and less than one hour long, the duration is in the format
PT#M#S
, in which the lettersPT
indicate that the value specifies a period of time, and the lettersM
andS
refer to length in minutes and seconds, respectively. The#
characters preceding theM
andS
letters are both integers that specify the number of minutes (or seconds) of the video. For example, a value ofPT15M33S
indicates that the video is 15 minutes and 33 seconds long.If the video is at least one hour long, the duration is in the format
PT#H#M#S
, in which the#
preceding the letterH
specifies the length of the video in hours and all of the other details are the same as described above. If the video is at least one day long, the lettersP
andT
are separated, and the value's format isP#DT#H#M#S
. Please refer to the ISO 8601 specification for complete details.contentDetails.dimension
string
Indicates whether the video is available in 3D or in 2D.
contentDetails.definition
string
Indicates whether the video is available in high definition (
HD
) or only in standard definition.Valid values for this property are:
hd
sd
contentDetails.caption
string
Indicates whether captions are available for the video.
Valid values for this property are:
false
true
contentDetails.licensedContent
boolean
Indicates whether the video represents licensed content, which means that the content was uploaded to a channel linked to a YouTube content partner and then claimed by that partner.
contentDetails.regionRestriction
object
The
regionRestriction
object contains information about the countries where a video is (or is not) viewable. The object will contain either thecontentDetails.regionRestriction.allowed
property or thecontentDetails.regionRestriction.blocked
property.contentDetails.regionRestriction.allowed[]
list
A list of region codes that identify countries where the video is viewable. If this property is present and a country is not listed in its value, then the video is blocked from appearing in that country. If this property is present and contains an empty list, the video is blocked in all countries.
contentDetails.regionRestriction.blocked[]
list
A list of region codes that identify countries where the video is blocked. If this property is present and a country is not listed in its value, then the video is viewable in that country. If this property is present and contains an empty list, the video is viewable in all countries.
contentDetails.contentRating
object
Specifies the ratings that the video received under various rating schemes.
contentDetails.contentRating.acbRating
string
The video's Australian Classification Board (ACB) or Australian Communications and Media Authority (ACMA) rating. ACMA ratings are used to classify children's television programming.
Valid values for this property are:
acbC
– Programs that have been given aC
classification by the Australian Communications and Media Authority. These programs are intended for children (other than preschool children) who are younger than 14 years of age.acbE
– EacbG
– GacbM
– MacbMa15plus
– MA15+acbP
– Programs that have been given aP
classification by the Australian Communications and Media Authority. These programs are intended for preschool children.acbPg
– PGacbR18plus
– R18+acbUnrated
contentDetails.contentRating.agcomRating
string
The video's rating from Italy's Autorità per le Garanzie nelle Comunicazioni (AGCOM).
Valid values for this property are:
agcomT
– TagcomUnrated
agcomVm14
– VM14agcomVm18
– VM18contentDetails.contentRating.anatelRating
string
The video's Anatel (Asociación Nacional de Televisión) rating for Chilean television.
Valid values for this property are:
anatelA
– AanatelF
– FanatelI
– IanatelI10
– I-10anatelI12
– I-12anatelI7
– I-7anatelR
– RanatelUnrated
contentDetails.contentRating.bbfcRating
string
The video's British Board of Film Classification (BBFC) rating.
Valid values for this property are:
bbfc12
– 12bbfc12a
– 12Abbfc15
– 15bbfc18
– 18bbfcPg
– PGbbfcR18
– R18bbfcU
– UbbfcUnrated
contentDetails.contentRating.bfvcRating
string
The video's rating from Thailand's Board of Film and Video Censors.
Valid values for this property are:
bfvc13
– 13bfvc15
– 15bfvc18
– 18bfvc20
– 20bfvcB
– BbfvcE
– EbfvcG
– GbfvcUnrated
contentDetails.contentRating.bmukkRating
string
The video's rating from the Austrian Board of Media Classification (Bundesministerium für Unterricht, Kunst und Kultur).
Valid values for this property are:
bmukk10
– 10+bmukk12
– 12+bmukk14
– 14+bmukk16
– 16+bmukk6
– 6+bmukk8
– 8+bmukkAa
– UnrestrictedbmukkUnrated
contentDetails.contentRating.catvRating
string
Rating system for Canadian TV - Canadian TV Classification System The video's rating from the Canadian Radio-Television and Telecommunications Commission (CRTC) for Canadian English-language broadcasts. For more information, see the Canadian Broadcast Standards Council website.
Valid values for this property are:
catv14plus
– 14+catv18plus
– 18+catvC
– CcatvC8
– C8catvG
– GcatvPg
– PGcatvUnrated
contentDetails.contentRating.catvfrRating
string
The video's rating from the Canadian Radio-Television and Telecommunications Commission (CRTC) for Canadian French-language broadcasts. For more information, see the Canadian Broadcast Standards Council website.
Valid values for this property are:
catvfr13plus
– 13+catvfr16plus
– 16+catvfr18plus
– 18+catvfr8plus
– 8+catvfrG
– GcatvfrUnrated
contentDetails.contentRating.cbfcRating
string
The video's Central Board of Film Certification (CBFC - India) rating.
Valid values for this property are:
cbfcA
– AcbfcS
– ScbfcU
– UcbfcUnrated
cbfcUA
– U/AcbfcUA7plus
– U/AcbfcUA13plus
– U/AcbfcUA16plus
– U/AcontentDetails.contentRating.cccRating
string
The video's Consejo de Calificación Cinematográfica (Chile) rating.
Valid values for this property are:
ccc14
– 14+ccc18
– 18+ccc18s
– 18+ - contenido pornográficoccc18v
– 18+ - contenido excesivamente violentoccc6
– 6+ - Inconveniente para menores de 7 añoscccTe
– Todo espectadorcccUnrated
contentDetails.contentRating.cceRating
string
The video's rating from Portugal's Comissão de Classificação de Espect´culos.
Valid values for this property are:
cceM12
– 12cceM14
– 14cceM16
– 16cceM18
– 18cceM4
– 4cceM6
– 6cceUnrated
contentDetails.contentRating.chfilmRating
string
The video's rating in Switzerland.
Valid values for this property are:
chfilm0
– 0chfilm12
– 12chfilm16
– 16chfilm18
– 18chfilm6
– 6chfilmUnrated
contentDetails.contentRating.chvrsRating
string
The video's Canadian Home Video Rating System (CHVRS) rating.
Valid values for this property are:
chvrs14a
– 14Achvrs18a
– 18AchvrsE
– EchvrsG
– GchvrsPg
– PGchvrsR
– RchvrsUnrated
contentDetails.contentRating.cicfRating
string
The video's rating from the Commission de Contrôle des Films (Belgium).
Valid values for this property are:
cicfE
– EcicfKntEna
– KNT/ENAcicfKtEa
– KT/EAcicfUnrated
contentDetails.contentRating.cnaRating
string
The video's rating from Romania's CONSILIUL NATIONAL AL AUDIOVIZUALULUI (CNA).
Valid values for this property are:
cna12
– 12cna15
– 15cna18
– 18cna18plus
– 18+cnaAp
– APcnaUnrated
contentDetails.contentRating.cncRating
string
Rating system in France - Commission de classification cinematographique
Valid values for this property are:
cnc10
– 10cnc12
– 12cnc16
– 16cnc18
– 18cncE
– EcncT
– TcncUnrated
contentDetails.contentRating.csaRating
string
The video's rating from France's Conseil supérieur de l?audiovisuel, which rates broadcast content.
Valid values for this property are:
csa10
– 10csa12
– 12csa16
– 16csa18
– 18csaInterdiction
– InterdictioncsaT
– TcsaUnrated
contentDetails.contentRating.cscfRating
string
The video's rating from Luxembourg's Commission de surveillance de la classification des films (CSCF).
Valid values for this property are:
cscf12
– 12cscf16
– 16cscf18
– 18cscf6
– 6cscf9
– 9cscfA
– AcscfAl
– ALcscfUnrated
contentDetails.contentRating.czfilmRating
string
The video's rating in the Czech Republic.
Valid values for this property are:
czfilm12
– 12czfilm14
– 14czfilm18
– 18czfilmU
– UczfilmUnrated
contentDetails.contentRating.djctqRating
string
The video's Departamento de Justiça, Classificação, Qualificação e Títulos (DJCQT - Brazil) rating.
Valid values for this property are:
djctq10
– 10djctq12
– 12djctq14
– 14djctq16
– 16djctq18
– 18djctqL
– LdjctqUnrated
contentDetails.contentRating.djctqRatingReasons[]
list
Reasons that explain why the video received its DJCQT (Brazil) rating.
contentDetails.contentRating.ecbmctRating
string
Rating system in Turkey - Evaluation and Classification Board of the Ministry of Culture and Tourism
Valid values for this property are:
ecbmct13a
– 13Aecbmct13plus
– 13+ecbmct15a
– 15Aecbmct15plus
– 15+ecbmct18plus
– 18+ecbmct7a
– 7Aecbmct7plus
– 7+ecbmctG
– GecbmctUnrated
ecbmct6a
– 6Aecbmct6plus
– 6+ecbmct10a
– 10Aecbmct10plus
– 10+ecbmct16plus
– 16+contentDetails.contentRating.eefilmRating
string
The video's rating in Estonia.
Valid values for this property are:
eefilmK12
– K-12eefilmK14
– K-14eefilmK16
– K-16eefilmK6
– K-6eefilmL
– LeefilmMs12
– MS-12eefilmMs6
– MS-6eefilmPere
– PereeefilmUnrated
contentDetails.contentRating.egfilmRating
string
The video's rating in Egypt.
Valid values for this property are:
egfilm18
– 18egfilmBn
– BNegfilmGn
– GNegfilmUnrated
contentDetails.contentRating.eirinRating
string
The video's Eirin (映倫) rating. Eirin is the Japanese rating system.
Valid values for this property are:
eirinG
– GeirinPg12
– PG-12eirinR15plus
– R15+eirinR18plus
– R18+eirinUnrated
contentDetails.contentRating.fcbmRating
string
The video's rating from Malaysia's Film Censorship Board.
Valid values for this property are:
fcbm13
– 13fcbm16
– 16fcbm18
– 18fcbm18pa
– 18PAfcbm18pl
– 18PLfcbm18sg
– 18SGfcbm18sx
– 18SXfcbmP12
– P12fcbmP13
– P13fcbmPg13
– PG13fcbmU
– UfcbmUnrated
contentDetails.contentRating.fcoRating
string
The video's rating from Hong Kong's Office for Film, Newspaper and Article Administration.
Valid values for this property are:
fcoI
– IfcoIi
– IIfcoIia
– IIAfcoIib
– IIBfcoIii
– IIIfcoUnrated
contentDetails.contentRating.fmocRating
string
This property has been deprecated as of November 2, 2015. Use the
contentDetails.contentRating.cncRating
property instead.The video's Centre national du cinéma et de l'image animé (French Ministry of Culture) rating.
Valid values for this property are:
fmoc10
– 10fmoc12
– 12fmoc16
– 16fmoc18
– 18fmocE
– EfmocU
– UfmocUnrated
contentDetails.contentRating.fpbRating
string
The video's rating from South Africa's Film and Publication Board.
Valid values for this property are:
fpb10
– 10fpb1012Pg
– 10-12PGfpb13
– 13fpb16
– 16fpb18
– 18fpb79Pg
– 7-9PGfpbA
– AfpbPg
– PGfpbUnrated
fpbX18
– X18fpbXx
– XXcontentDetails.contentRating.fpbRatingReasons[]
list
Reasons that explain why the video received its FPB (South Africa) rating.
contentDetails.contentRating.fskRating
string
The video's Freiwillige Selbstkontrolle der Filmwirtschaft (FSK - Germany) rating.
Valid values for this property are:
fsk0
– FSK 0fsk12
– FSK 12fsk16
– FSK 16fsk18
– FSK 18fsk6
– FSK 6fskUnrated
contentDetails.contentRating.grfilmRating
string
The video's rating in Greece.
Valid values for this property are:
grfilmE
– EgrfilmK
– KgrfilmK12
– K-12grfilmK13
– K-13grfilmK15
– K-15grfilmK17
– K-17grfilmK18
– K-18grfilmUnrated
contentDetails.contentRating.icaaRating
string
The video's Instituto de la Cinematografía y de las Artes Audiovisuales (ICAA - Spain) rating.
Valid values for this property are:
icaa12
– 12icaa13
– 13icaa16
– 16icaa18
– 18icaa7
– 7icaaApta
– APTAicaaUnrated
icaaX
– XcontentDetails.contentRating.ifcoRating
string
The video's Irish Film Classification Office (IFCO - Ireland) rating. See the IFCO website for more information.
Valid values for this property are:
ifco12
– 12ifco12a
– 12Aifco15
– 15ifco15a
– 15Aifco16
– 16ifco18
– 18ifcoG
– GifcoPg
– PGifcoUnrated
contentDetails.contentRating.ilfilmRating
string
The video's rating in Israel.
Valid values for this property are:
ilfilm12
– 12ilfilm16
– 16ilfilm18
– 18ilfilmAa
– AAilfilmUnrated
contentDetails.contentRating.incaaRating
string
The video's INCAA (Instituto Nacional de Cine y Artes Audiovisuales - Argentina) rating.
Valid values for this property are:
incaaAtp
– ATP (Apta para todo publico)incaaC
– X (Solo apta para mayores de 18 años, de exhibición condicionada)incaaSam13
– 13 (Solo apta para mayores de 13 años)incaaSam16
– 16 (Solo apta para mayores de 16 años)incaaSam18
– 18 (Solo apta para mayores de 18 años)incaaUnrated
contentDetails.contentRating.kfcbRating
string
The video's rating from the Kenya Film Classification Board.
Valid values for this property are:
kfcb16plus
– 16kfcbG
– GEkfcbPg
– PGkfcbR
– 18kfcbUnrated
contentDetails.contentRating.kijkwijzerRating
string
voor de Classificatie van Audiovisuele Media (Netherlands).
Valid values for this property are:
kijkwijzer12
– 12kijkwijzer14
– 14kijkwijzer16
– 16kijkwijzer18
– 18kijkwijzer6
– 6kijkwijzer9
– 9kijkwijzerAl
– ALkijkwijzerUnrated
contentDetails.contentRating.kmrbRating
string
The video's Korea Media Rating Board (영상물등급위원회) rating. The KMRB rates videos in South Korea.
Valid values for this property are:
kmrb12plus
– 12세 이상 관람가kmrb15plus
– 15세 이상 관람가kmrbAll
– 전체관람가kmrbR
– 청소년 관람불가kmrbTeenr
kmrbUnrated
contentDetails.contentRating.lsfRating
string
The video's rating from Indonesia's Lembaga Sensor Film.
Valid values for this property are:
lsf13
– 13lsf17
– 17lsf21
– 21lsfA
– AlsfBo
– BOlsfD
– DlsfR
– RlsfSu
– SUlsfUnrated
contentDetails.contentRating.mccaaRating
string
The video's rating from Malta's Film Age-Classification Board.
Valid values for this property are:
mccaa12
– 12mccaa12a
– 12Amccaa14
– 14 - this rating was removed from the new classification structure introduced in 2013.mccaa15
– 15mccaa16
– 16 - this rating was removed from the new classification structure introduced in 2013.mccaa18
– 18mccaaPg
– PGmccaaU
– UmccaaUnrated
contentDetails.contentRating.mccypRating
string
The video's rating from the Danish Film Institute's (Det Danske Filminstitut) Media Council for Children and Young People.
Valid values for this property are:
mccyp11
– 11mccyp15
– 15mccyp7
– 7mccypA
– AmccypUnrated
contentDetails.contentRating.mcstRating
string
The video's rating system for Vietnam - MCST
Valid values for this property are:
mcst0
– 0mcst16plus
– 16+mcstC13
– C13mcstC16
– C16mcstC18
– C18mcstP
– PmcstUnrated
mcstT13
– T13mcstT16
– T16mcstT18
– T18mcstK
– KcontentDetails.contentRating.mdaRating
string
The video's rating from Singapore's Media Development Authority (MDA) and, specifically, it's Board of Film Censors (BFC).
Valid values for this property are:
mdaG
– GmdaM18
– M18mdaNc16
– NC16mdaPg
– PGmdaPg13
– PG13mdaR21
– R21mdaUnrated
contentDetails.contentRating.medietilsynetRating
string
The video's rating from Medietilsynet, the Norwegian Media Authority.
Valid values for this property are:
medietilsynet11
– 11medietilsynet12
– 12medietilsynet15
– 15medietilsynet18
– 18medietilsynet6
– 6medietilsynet7
– 7medietilsynet9
– 9medietilsynetA
– AmedietilsynetUnrated
contentDetails.contentRating.mekuRating
string
The video's rating from Finland's Kansallinen Audiovisuaalinen Instituutti (National Audiovisual Institute).
Valid values for this property are:
meku12
– 12meku16
– 16meku18
– 18meku7
– 7mekuS
– SmekuUnrated
contentDetails.contentRating.mibacRating
string
The video's rating from the Ministero dei Beni e delle Attività Culturali e del Turismo (Italy).
Valid values for this property are:
mibacT
mibacUnrated
mibacVap
mibacVm6
mibacVm12
mibacVm14
mibacVm18
contentDetails.contentRating.mocRating
string
The video's Ministerio de Cultura (Colombia) rating.
Valid values for this property are:
moc12
– 12moc15
– 15moc18
– 18moc7
– 7mocBanned
– BannedmocE
– EmocT
– TmocUnrated
mocX
– XcontentDetails.contentRating.moctwRating
string
The video's rating from Taiwan's Ministry of Culture (文化部).
Valid values for this property are:
moctwG
– GmoctwP
– PmoctwPg
– PGmoctwR
– RmoctwR12
– R-12moctwR15
– R-15moctwUnrated
contentDetails.contentRating.mpaaRating
string
The video's Motion Picture Association of America (MPAA) rating.
Valid values for this property are:
mpaaG
– GmpaaNc17
– NC-17mpaaPg
– PGmpaaPg13
– PG-13mpaaR
– RmpaaUnrated
contentDetails.contentRating.mpaatRating
string
The Motion Picture Association of America's rating for movie trailers and preview.
Valid values for this property are:
mpaatGb
– GB (Green Band - Approved for all audiences)mpaatRb
– RB (Red Band - Recommended for ages 17+)contentDetails.contentRating.mtrcbRating
string
The video's rating from the Movie and Television Review and Classification Board (Philippines).
Valid values for this property are:
mtrcbG
– GmtrcbPg
– PGmtrcbR13
– R-13mtrcbR16
– R-16mtrcbR18
– R-18mtrcbUnrated
mtrcbX
– XcontentDetails.contentRating.nbcRating
string
The video's rating from the Maldives National Bureau of Classification.
Valid values for this property are:
nbc12plus
– 12+nbc15plus
– 15+nbc18plus
– 18+nbc18plusr
– 18+RnbcG
– GnbcPg
– PGnbcPu
– PUnbcUnrated
contentDetails.contentRating.nfrcRating
string
The video's rating from the Bulgarian National Film Center.
Valid values for this property are:
nfrcA
– AnfrcB
– BnfrcC
– CnfrcD
– DnfrcUnrated
nfrcX
– XcontentDetails.contentRating.nfvcbRating
string
The video's rating from Nigeria's National Film and Video Censors Board.
Valid values for this property are:
nfvcb12
– 12nfvcb12a
– 12Anfvcb15
– 15nfvcb18
– 18nfvcbG
– GnfvcbPg
– PGnfvcbRe
– REnfvcbUnrated
contentDetails.contentRating.nkclvRating
string
The video's rating from the Nacionãlais Kino centrs (National Film Centre of Latvia).
Valid values for this property are:
nkclv12plus
– 12+nkclv18plus
– 18+nkclv7plus
– 7+nkclvU
– UnkclvUnrated
contentDetails.contentRating.oflcRating
string
The video's Office of Film and Literature Classification (OFLC - New Zealand) rating.
Valid values for this property are:
oflcG
– GoflcM
– MoflcPg
– PGoflcR13
– R13oflcR15
– R15oflcR16
– R16oflcR18
– R18oflcRp13
– RP13oflcRp16
– RP16oflcUnrated
contentDetails.contentRating.pefilmRating
string
The video's rating in Peru.
Valid values for this property are:
pefilm14
– 14pefilm18
– 18pefilmPg
– PGpefilmPt
– PTpefilmUnrated
contentDetails.contentRating.resorteviolenciaRating
string
The video's rating in Venezuela.
Valid values for this property are:
resorteviolenciaA
– AresorteviolenciaB
– BresorteviolenciaC
– CresorteviolenciaD
– DresorteviolenciaE
– EresorteviolenciaUnrated
contentDetails.contentRating.rtcRating
string
The video's General Directorate of Radio, Television and Cinematography (Mexico) rating.
Valid values for this property are:
rtcA
– ArtcAa
– AArtcB
– BrtcB15
– B15rtcC
– CrtcD
– DrtcUnrated
contentDetails.contentRating.rteRating
string
The video's rating from Ireland's Raidió Teilifís Éireann.
Valid values for this property are:
rteCh
– CHrteGa
– GArteMa
– MArtePs
– PSrteUnrated
contentDetails.contentRating.russiaRating
string
The video's National Film Registry of the Russian Federation (MKRF - Russia) rating.
Valid values for this property are:
russia0
– 0+russia12
– 12+russia16
– 16+russia18
– 18+russia6
– 6+russiaUnrated
contentDetails.contentRating.skfilmRating
string
The video's rating in Slovakia.
Valid values for this property are:
skfilmG
– GskfilmP2
– P2skfilmP5
– P5skfilmP8
– P8skfilmUnrated
contentDetails.contentRating.smaisRating
string
The video's rating in Iceland.
Valid values for this property are:
smais12
– 12smais14
– 14smais16
– 16smais18
– 18smais7
– 7smaisL
– LsmaisUnrated
contentDetails.contentRating.smsaRating
string
The video's rating from Statens medieråd (Sweden's National Media Council).
Valid values for this property are:
smsa11
– 11smsa15
– 15smsa7
– 7smsaA
– All agessmsaUnrated
contentDetails.contentRating.tvpgRating
string
The video's TV Parental Guidelines (TVPG) rating.
Valid values for this property are:
tvpgG
– TV-GtvpgMa
– TV-MAtvpgPg
– TV-PGtvpgUnrated
tvpgY
– TV-YtvpgY7
– TV-Y7tvpgY7Fv
– TV-Y7-FVpg14
– TV-14contentDetails.contentRating.ytRating
string
A rating that YouTube uses to identify age-restricted content.
Valid values for this property are:
ytAgeRestricted
contentDetails.projection
string
Specifies the projection format of the video.
Valid values for this property are:
360
rectangular
contentDetails.hasCustomThumbnail
boolean
Indicates whether the video uploader has provided a custom thumbnail image for the video. This property is only visible to the video uploader.
status
object
The
status
object contains information about the video's uploading, processing, and privacy statuses.status.uploadStatus
string
The status of the uploaded video.
Valid values for this property are:
deleted
failed
processed
rejected
uploaded
status.failureReason
string
This value explains why a video failed to upload. This property is only present if the
uploadStatus
property indicates that the upload failed.Valid values for this property are:
codec
conversion
emptyFile
invalidFile
tooSmall
uploadAborted
status.rejectionReason
string
This value explains why YouTube rejected an uploaded video. This property is only present if the
uploadStatus
property indicates that the upload was rejected.Valid values for this property are:
claim
copyright
duplicate
inappropriate
legal
length
termsOfUse
trademark
uploaderAccountClosed
uploaderAccountSuspended
status.privacyStatus
string
The video's privacy status.
Valid values for this property are:
private
public
unlisted
status.publishAt
datetime
The date and time when the video is scheduled to publish. It can be set only if the privacy status of the video is private. The value is specified in ISO 8601 format. Note the following two additional points about this property's behavior: If you set this property's value when calling the
videos.update
method, you must also set thestatus.privacyStatus
property value toprivate
even if the video is already private. If your request schedules a video to be published at some time in the past, the video will be published right away. As such, the effect of setting thestatus.publishAt
property to a past date and time is the same as of changing the video'sprivacyStatus
fromprivate
topublic
.status.license
string
The video's license.
Valid values for this property are:
creativeCommon
youtube
status.embeddable
boolean
This value indicates whether the video can be embedded on another website.
status.publicStatsViewable
boolean
This value indicates whether the extended video statistics on the video's watch page are publicly viewable. By default, those statistics are viewable, and statistics like a video's viewcount and ratings will still be publicly visible even if this property's value is set to
false
.status.madeForKids
boolean
This value indicates whether the video is designated as child-directed, and it contains the
current "made for kids" status of the video. For example, the status might be determined
based on the value of the
selfDeclaredMadeForKids
property. See theYouTube Help Center for more
information about setting the audience for your channel, videos, or broadcasts.
status.selfDeclaredMadeForKids
boolean
In a
videos.insert
orvideos.update
request, thisproperty allows the channel owner to designate the video as being child-directed. In a
videos.list
request, the propertyvalue is only returned if the channel owner authorized the API request.
status.containsSyntheticMedia
boolean
In a
videos.insert
orvideos.update
request, thisproperty allows the channel owner to disclose that a video contains realistic Altered or
Synthetic (A/S) content. Learn more about
YouTube
policies related to A/S content.
Examples of A/S content include videos that:
Make a real person appear to say or do something they didn't actually say or do
Alter footage of a real event or place
Generate a realistic-looking scene that did not actually occur
statistics
object
The
statistics
object contains statistics about the video.statistics.viewCount
unsigned long
The number of times the video has been viewed.
statistics.likeCount
unsigned long
The number of users who have indicated that they liked the video.
statistics.dislikeCount
unsigned long
statistics.dislikeCount
property wasmade private as of December 13, 2021. This means that the property is included in an API
response only if the API request was authenticated by the video owner. See the
revision history for more information.
The number of users who have indicated that they disliked the video.
statistics.favoriteCount
unsigned long
Note: This property has been deprecated. The deprecation is effective as of August 28, 2015. The property's value is now always set to
0
.statistics.commentCount
unsigned long
The number of comments for the video.
paidProductPlacementDetails
object
The
paidProductPlacementDetails
object contains information about paid product placement in the video.paidProductPlacementDetails.hasPaidProductPlacement
boolean
Set to
true
if the content uses paid product placement. Defaults tofalse
.player
object
The
player
object contains information that you would use to play the video in an embedded player.player.embedHtml
string
An
<iframe>
tag that embeds a player that plays the video.If the API request to retrieve the resource specifies a value for themaxHeight
and/ormaxWidth
parameters, the size of the embedded player is scaled to satisfy themaxHeight
and/ormaxWidth
requirements.If the video's aspect ratio is unknown, the embedded player defaults to a 4:3 format.player.embedHeight
long
The height of the embedded player returned in the
player.embedHtml
property. This property is only returned if the request specified a value for themaxHeight
and/ormaxWidth
parameters and the video's aspect ratio is known.player.embedWidth
long
The width of the embedded player returned in the
player.embedHtml
property. This property is only returned if the request specified a value for themaxHeight
and/ormaxWidth
parameters and the video's aspect ratio is known.topicDetails
object
The
topicDetails
object encapsulates information about topics associated with the video.Important: See the definitions of the
topicDetails.relevantTopicIds[]
andtopicDetails.topicIds[]
properties as well as the revision history for more details about upcoming changes related to topic IDs.topicDetails.topicIds[]
list
Important: This property has been deprecated as of November 10, 2016. The API no longer returns values for this property, and any topics associated with a video are now returned by the
topicDetails.relevantTopicIds[]
property value.topicDetails.relevantTopicIds[]
list
A list of topic IDs that are relevant to the video.
This property has been deprecated as of November 10, 2016. It will be supported until November 10, 2017.
Important: Due to the deprecation of Freebase and the Freebase API, topic IDs started working differently as of February 27, 2017. At that time, YouTube started returning a small set of curated topic IDs.
See topic IDs supported as of February 15, 2017
Topics
Music topics
/m/04rlf
Music (parent topic)
/m/02mscn
Christian music
/m/0ggq0m
Classical music
/m/01lyv
Country
/m/02lkt
Electronic music
/m/0glt670
Hip hop music
/m/05rwpb
Independent music
/m/03_d0
Jazz
/m/028sqc
Music of Asia
/m/0g293
Music of Latin America
/m/064t9
Pop music
/m/06cqb
Reggae
/m/06j6l
Rhythm and blues
/m/06by7
Rock music
/m/0gywn
Soul music
Gaming topics
/m/0bzvm2
Gaming (parent topic)
/m/025zzc
Action game
/m/02ntfj
Action-adventure game
/m/0b1vjn
Casual game
/m/02hygl
Music video game
/m/04q1x3q
Puzzle video game
/m/01sjng
Racing video game
/m/0403l3g
Role-playing video game
/m/021bp2
Simulation video game
/m/022dc6
Sports game
/m/03hf_rm
Strategy video game
Sports topics
/m/06ntj
Sports (parent topic)
/m/0jm_
American football
/m/018jz
Baseball
/m/018w8
Basketball
/m/01cgz
Boxing
/m/09xp_
Cricket
/m/02vx4
Football
/m/037hz
Golf
/m/03tmr
Ice hockey
/m/01h7lh
Mixed martial arts
/m/0410tth
Motorsport
/m/07bs0
Tennis
/m/07_53
Volleyball
Entertainment topics
/m/02jjt
Entertainment (parent topic)
/m/09kqc
Humor
/m/02vxn
Movies
/m/05qjc
Performing arts
/m/066wd
Professional wrestling
/m/0f2f9
TV shows
Lifestyle topics
/m/019_rr
Lifestyle (parent topic)
/m/032tl
Fashion
/m/027x7n
Fitness
/m/02wbm
Food
/m/03glg
Hobby
/m/068hy
Pets
/m/041xxh
Physical attractiveness [Beauty]
/m/07c1v
Technology
/m/07bxq
Tourism
/m/07yv9
Vehicles
Society topics
/m/098wr
Society (parent topic)
/m/09s1f
Business
/m/0kt51
Health
/m/01h6rj
Military
/m/05qt0
Politics
/m/06bvp
Religion
Other topics
/m/01k8wb
Knowledge
topicDetails.topicCategories[]
list
A list of Wikipedia URLs that provide a high-level description of the video's content.
recordingDetails
object
The
recordingDetails
object encapsulates information about the location, date and address where the video was recorded.recordingDetails.locationDescription
string
This property has been deprecated as of June 1, 2017. Please see the deprecation announcement for more details.
The text description of the location where the video was recorded.
recordingDetails.location
object
The geolocation information associated with the video. Note that the child property values identify the location that the video owner wants to associate with the video. The value is editable, searchable on public videos, and might be displayed to users for public videos.
recordingDetails.location.latitude
double
This property has been deprecated as of June 1, 2017. Please see the deprecation announcement for more details.
Latitude in degrees.
recordingDetails.location.longitude
double
This property has been deprecated as of June 1, 2017. Please see the deprecation announcement for more details.
Longitude in degrees.
recordingDetails.location.altitude
double
This property has been deprecated as of July 9, 2018. Please see the deprecation announcement for more details.
Altitude above the reference ellipsoid, in meters.
recordingDetails.recordingDate
datetime
The date and time when the video was recorded. The value is specified in ISO 8601 (
YYYY-MM-DDThh:mm:ss.sssZ
) format.fileDetails
object
The
fileDetails
object encapsulates information about the video file that was uploaded to YouTube, including the file's resolution, duration, audio and video codecs, stream bitrates, and more. This data can only be retrieved by the video owner.The
fileDetails
object will only be returned if theprocessingDetails.fileAvailability
property has a value ofavailable
.fileDetails.fileName
string
The uploaded file's name. This field is present whether a video file or another type of file was uploaded.
fileDetails.fileSize
unsigned long
The uploaded file's size in bytes. This field is present whether a video file or another type of file was uploaded.
fileDetails.fileType
string
The uploaded file's type as detected by YouTube's video processing engine. Currently, YouTube only processes video files, but this field is present whether a video file or another type of file was uploaded.
Valid values for this property are:
archive
– The file is an archive file, such as a .zip archive.audio
– The file is a known audio file type, such as an .mp3 file.document
– The file is a document or text file, such as a MS Word document.image
– The file is an image file, such as a .jpeg image.other
– The file is another non-video file type.project
– The file is a video project file, such as a Microsoft Windows Movie Maker project, that does not contain actual video data.video
– The file is a known video file type, such as an .mp4 file.fileDetails.container
string
The uploaded video file's container format.
fileDetails.videoStreams[]
list
A list of video streams contained in the uploaded video file. Each item in the list contains detailed metadata about a video stream.
fileDetails.videoStreams[].widthPixels
unsigned integer
The encoded video content's width in pixels. You can calculate the video's encoding aspect ratio as
width_pixels
/height_pixels
.fileDetails.videoStreams[].heightPixels
unsigned integer
The encoded video content's height in pixels.
fileDetails.videoStreams[].frameRateFps
double
The video stream's frame rate, in frames per second.
fileDetails.videoStreams[].aspectRatio
double
The video content's display aspect ratio, which specifies the aspect ratio in which the video should be displayed.
fileDetails.videoStreams[].codec
string
The video codec that the stream uses.
fileDetails.videoStreams[].bitrateBps
unsigned long
The video stream's bitrate, in bits per second.
fileDetails.videoStreams[].rotation
string
The amount that YouTube needs to rotate the original source content to properly display the video.
Valid values for this property are:
clockwise
– The video needs to be rotated 90 degrees clockwise.counterClockwise
– The video needs to be rotated 90 degrees counter-clockwise.none
– The video does not need to be rotated.other
– The video needs to be rotated in some other, non-trivial way.upsideDown
– The video needs to be rotated upside down.fileDetails.videoStreams[].vendor
string
A value that uniquely identifies a video vendor. Typically, the value is a four-letter vendor code.
fileDetails.audioStreams[]
list
A list of audio streams contained in the uploaded video file. Each item in the list contains detailed metadata about an audio stream.
fileDetails.audioStreams[].channelCount
unsigned integer
The number of audio channels that the stream contains.
fileDetails.audioStreams[].codec
string
The audio codec that the stream uses.
fileDetails.audioStreams[].bitrateBps
unsigned long
The audio stream's bitrate, in bits per second.
fileDetails.audioStreams[].vendor
string
A value that uniquely identifies a video vendor. Typically, the value is a four-letter vendor code.
fileDetails.durationMs
unsigned long
The length of the uploaded video in milliseconds.
fileDetails.bitrateBps
unsigned long
The uploaded video file's combined (video and audio) bitrate in bits per second.
fileDetails.creationTime
string
The date and time when the uploaded video file was created. The value is specified in ISO 8601 format. Currently, the following ISO 8601 formats are supported: Date only:
YYYY-MM-DD
Naive time:YYYY-MM-DDTHH:MM:SS
Time with timezone:YYYY-MM-DDTHH:MM:SS+HH:MM
processingDetails
object
The
processingDetails
object encapsulates information about YouTube's progress in processing the uploaded video file. The properties in the object identify the current processing status and an estimate of the time remaining until YouTube finishes processing the video. This part also indicates whether different types of data or content, such as file details or thumbnail images, are available for the video.The
processingProgress
object is designed to be polled so that the video uploaded can track the progress that YouTube has made in processing the uploaded video file. This data can only be retrieved by the video owner.processingDetails.processingStatus
string
The video's processing status. This value indicates whether YouTube was able to process the video or if the video is still being processed.
Valid values for this property are:
failed
– Video processing has failed. See ProcessingFailureReason.processing
– Video is currently being processed. See ProcessingProgress.succeeded
– Video has been successfully processed.terminated
– Processing information is no longer available.processingDetails.processingProgress
object
The
processingProgress
object contains information about the progress YouTube has made in processing the video. The values are really only relevant if the video's processing status isprocessing
.processingDetails.processingProgress.partsTotal
unsigned long
An estimate of the total number of parts that need to be processed for the video. The number may be updated with more precise estimates while YouTube processes the video.
processingDetails.processingProgress.partsProcessed
unsigned long
The number of parts of the video that YouTube has already processed. You can estimate the percentage of the video that YouTube has already processed by calculating:
100 * parts_processed / parts_total
Note that since the estimated number of parts could increase without a corresponding increase in the number of parts that have already been processed, it is possible that the calculated progress could periodically decrease while YouTube processes a video.
processingDetails.processingProgress.timeLeftMs
unsigned long
An estimate of the amount of time, in millseconds, that YouTube needs to finish processing the video.
processingDetails.processingFailureReason
string
The reason that YouTube failed to process the video. This property will only have a value if the
processingStatus
property's value isfailed
.Valid values for this property are:
other
– Some other processing component has failed.streamingFailed
– Video could not be sent to streamers.transcodeFailed
– Content transcoding has failed.uploadFailed
– File delivery has failed.processingDetails.fileDetailsAvailability
string
This value indicates whether file details are available for the uploaded video. You can retrieve a video's file details by requesting the
fileDetails
part in yourvideos.list()
request.processingDetails.processingIssuesAvailability
string
This value indicates whether the video processing engine has generated suggestions that might improve YouTube's ability to process the the video, warnings that explain video processing problems, or errors that cause video processing problems. You can retrieve these suggestions by requesting the
suggestions
part in yourvideos.list()
request.processingDetails.tagSuggestionsAvailability
string
This value indicates whether keyword (tag) suggestions are available for the video. Tags can be added to a video's metadata to make it easier for other users to find the video. You can retrieve these suggestions by requesting the
suggestions
part in yourvideos.list()
request.processingDetails.editorSuggestionsAvailability
string
This value indicates whether video editing suggestions, which might improve video quality or the playback experience, are available for the video. You can retrieve these suggestions by requesting the
suggestions
part in yourvideos.list()
request.processingDetails.thumbnailsAvailability
string
This value indicates whether thumbnail images have been generated for the video.
suggestions
object
The
suggestions
object encapsulates suggestions that identify opportunities to improve the video quality or the metadata for the uploaded video. This data can only be retrieved by the video owner.The
suggestions
object will only be returned if theprocessingDetails.tagSuggestionsAvailability
property or theprocessingDetails.editorSuggestionsAvailability
property has a value ofavailable
.suggestions.processingErrors[]
list
A list of errors that will prevent YouTube from successfully processing the uploaded video. These errors indicate that, regardless of the video's current processing status, eventually, that status will almost certainly be
failed
.Valid values for this property are:
archiveFile
– An archive file (e.g., a ZIP archive).audioFile
– File contains audio only (e.g., an MP3 file).docFile
– Document or text file (e.g., MS Word document).imageFile
– Image file (e.g., a JPEG image).notAVideoFile
– Other non-video file.projectFile
– Movie project file (e.g., Microsoft Windows Movie Maker project).suggestions.processingWarnings[]
list
A list of reasons why YouTube may have difficulty transcoding the uploaded video or that might result in an erroneous transcoding. These warnings are generated before YouTube actually processes the uploaded video file. In addition, they identify issues that do not necessarily indicate that video processing will fail but that still might cause problems such as sync issues, video artifacts, or a missing audio track.
Valid values for this property are:
hasEditlist
– Edit lists are not currently supported.inconsistentResolution
– Conflicting container and stream resolutions.problematicAudioCodec
– Audio codec that is known to cause problems was used.problematicVideoCodec
– Video codec that is known to cause problems was used.unknownAudioCodec
– Unrecognized audio codec, transcoding is likely to fail.unknownContainer
– Unrecognized file format, transcoding is likely to fail.unknownVideoCodec
– Unrecognized video codec, transcoding is likely to fail.suggestions.processingHints[]
list
A list of suggestions that may improve YouTube's ability to process the video.
Valid values for this property are:
nonStreamableMov
– The MP4 file is not streamable, this will slow down the processing.sendBestQualityVideo
– Probably a better quality version of the video exists.suggestions.tagSuggestions[]
list
A list of keyword tags that could be added to the video's metadata to increase the likelihood that users will locate your video when searching or browsing on YouTube.
suggestions.tagSuggestions[].tag
string
The keyword tag suggested for the video.
suggestions.tagSuggestions[].categoryRestricts[]
list
A set of video categories for which the tag is relevant. You can use this information to display appropriate tag suggestions based on the video category that the video uploader associates with the video. By default, tag suggestions are relevant for all categories if there are no restricts defined for the keyword.
suggestions.editorSuggestions[]
list
A list of video editing operations that might improve the video quality or playback experience of the uploaded video.
Valid values for this property are:
audioQuietAudioSwap
– The audio track appears silent and could be swapped with a better quality one.videoAutoLevels
– Picture brightness levels seem off and could be corrected.videoCrop
– Margins (mattes) detected around the picture could be cropped.videoStabilize
– The video appears shaky and could be stabilized.liveStreamingDetails
object
The
liveStreamingDetails
object contains metadata about a live video broadcast. The object will only be present in avideo
resource if the video is an upcoming, live, or completed live broadcast.liveStreamingDetails.actualStartTime
datetime
The time that the broadcast actually started. The value is specified in ISO 8601 format. This value will not be available until the broadcast begins.
liveStreamingDetails.actualEndTime
datetime
The time that the broadcast actually ended. The value is specified in ISO 8601 format. This value will not be available until the broadcast is over.
liveStreamingDetails.scheduledStartTime
datetime
The time that the broadcast is scheduled to begin. The value is specified in ISO 8601 format.
liveStreamingDetails.scheduledEndTime
datetime
The time that the broadcast is scheduled to end. The value is specified in ISO 8601 format. If the value is empty or the property is not present, then the broadcast is scheduled to continue indefinitely.
liveStreamingDetails.concurrentViewers
unsigned long
The number of viewers currently watching the broadcast. The property and its value will be
present if the broadcast has current viewers and the broadcast owner has not hidden the
viewcount for the video. Note that YouTube stops tracking the number of concurrent viewers
for a broadcast when the broadcast ends. So, this property would not identify the number of
viewers watching an archived video of a live broadcast that already ended.
differ from the processed, despammed concurrent viewer counts available through YouTube
Analytics. Learn more about live streaming metrics in the
YouTube Help Center.
liveStreamingDetails.activeLiveChatId
string
The ID of the currently active live chat attached to this video. This field is filled only if the video is a currently live broadcast that has live chat. Once the broadcast transitions to complete this field will be removed and the live chat closed down. For persistent broadcasts that live chat id will no longer be tied to this video but rather to the new video being displayed at the persistent page.
localizations
object
The
localizations
object contains translations of the video's metadata.localizations.(key)
object
The language of the localized text associated with the key value. The value is a string that contains a BCP-47 language code.
localizations.(key).title
string
The localized video title.
localizations.(key).description
string
The localized video description.
... <看更多>