Hacker News .hnnew | past | comments | ask | show | jobs | submitlogin

Actually their API already returns that information. I think this was it: http://code.google.com/apis/youtube/2.0/reference.html#youtu...


Is there a way to access this information when browsing? An extension, perhaps?

I'm an embedded developer, so please forgive my ignorance if this is a foolish question.


Not completely straightforward, but you could do something like this if you have curl and libxml2 installed:

    curl -s https://gdata.youtube.com/feeds/api/videos/oHg5SJYRHA0?v=2 | xmllint --format - | grep media:restriction
The 'oHg5SJYRHA0' part is the video ID from the URL for the video.


Thanks. I updated the post and credited you. I posted this example (a Vevo video):

curl -s https://gdata.youtube.com/feeds/api/videos/eAfyFTzZDMM?v=2 | xmllint --format - | grep media:restriction

shows:

<media:restriction type="country" relationship="allow">BD BE BF BG BA BB WF BM BN BO BH BI BJ BT JM BW WS BR BS BY BZ RU RW RS TL RE TM TJ RO TK GW GU GT GR GQ GP GY GF GE GD GB GA SV GN GM GL GI GH OM TN IL JO HR HT HU HK HN VE PR PS PW PT PY IQ PA PF PG PE PK PN PL PM ZM EH EE EG ZA EC IT VN SB ET SO ZW SA ES ER ME MD MG MA MC UZ MM ML MO MN MH MK MU MT MW MV MQ MP MS MR UG MY MX VU FR SH FI FJ FK FM FO NI NL NO NA NC NE NG NP NR NU CK CI CH CO CN CM CL CA CG CF CD CZ CY CR CV CU SZ SY KG KE SR KI KH KN KM ST SK KR SI KP KW SN SM SL SC KZ KY SG SE SD DO DM DJ DK VG YE DZ US UY YT LB LC LA TV TW TT TR LK LI LV TO LT LU LR LS TF TG TD TC LY VA VC AE AD AG AF AI IS IR AM AL AO AN AQ AR AU AT IO IN TZ AZ IE UA QA MZ</media:restriction>



Much cleaner. Thanks for the tip!


Made this: http://home.iitb.ac.in/~mayank.singhal/site/javascripts/Yout...

Well, this is my first chrome extension. So please pardon me if it has some really n00bish code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: