php获取YouTube视频信息的方法

本文实例讲述了php获取YouTube视频信息的方法。分享给大家供大家参考。具体分析如下:

YouTube的视频地址格式
https://www.youtube.com/watch?v=[VIDEO_ID]
例子:https://www.youtube.com/watch?v=psvkyf3PzjE

代码如下:

//根据video id 获取YouTube视频信息 
function getYouTubeInfo($video_id){ 
    $content = file_get_contents("http://youtube.com/get_video_info?video_id=" . $video_id);   
    parse_str($content, $ytarr); 
    return $ytarr; 

 
$video_id = 'psvkyf3PzjE';   
$ytinfo = getYouTubeInfo($video_id); 
 
echo '<meta http-equiv="content-type" content="text/html;charset=utf-8">'; 
echo '<p><strong>'.$ytinfo['title'].'</strong></p>';     // 标题 
echo '<p><img src="'.$ytinfo['thumbnail_url'].'"></p>';  // 缩略图 
echo '<p><img src="'.$ytinfo['iurlmq'].'"></p>';         // 中图 
echo '<p><img src="'.$ytinfo['iurl'].'"></p>';           // 大图 
 
echo '<pre>'; 
print_r($ytinfo); 
echo '</pre>';

输出如下图所示:

更多信息如下:

代码如下:

Array 

    [ttsurl] => http://www.youtube.com/api/timedtext?v=psvkyf3PzjE&expire=1405449775&asr_langs=fr%2Cpt%2Cnl%2Ces%2Cit%2Cde%2Cen%2Cja%2Cru%2Cko&caps=asr&sparams=asr_langs%2Ccaps%2Cv%2Cexpire&signature=20784B16B4F6C4CF09E27D1267B033EE39ECAD7F.2815379028207B479B0DFC818804EE8B07EFDA96&key=yttt1&hl=zh_HK 
    [hl] => zh_HK 
    [iv_load_policy] => 1 
    [length_seconds] => 151 
    [adsense_video_doc_id] => yt_psvkyf3PzjE 
    [iv_allow_in_place_switch] => 1 
    [plid] => AAT-OeiZGx1hsKAp 
    [title] => 10 Amazing Practical Jokes 
    [ptchn] => vGMGQC8gNkd4gwxSbABIlw 
    [sw] => 1.0 
    [pyv_in_related_cafe_experiment_id] =>  
    [ad_device] => 1 
    [rmktPingThreshold] => 0 
    [use_cipher_signature] => False 
    [account_playback_token] => QUFFLUhqay1iUzhSU0V5RUZreHlFb3JDcUx3eVJOSnVRd3xBQ3Jtc0trVHRiY1RxejNPNmt4ZHlUS0dNSzgzOUFTOW5Pd05mN2kxenNaWU12UGxzWExRVzlFZG1vdmxFRDZpNXBfVUQzdGpYbEZNbXZ3SG9PX0VucHlaQmJxWEtJbWNUVk9qYTFiUi03NGpJNU5pbkNhaXdMOA== 
    [storyboard_spec] => http://i1.ytimg.com/sb/psvkyf3PzjE/storyboard3_L$L/$N.jpg|48#27#100#10#10#0#default#U1k21Pz8pIncmT1q3DRcxfHAX-M|61#45#77#10#10#2000#M$M#djvTKb0T1vNlFvNsZg1Fk4Os2D4|123#90#77#5#5#2000#M$M#dQFZyMyJWsgSI4imKk7swh2iyFs 
    [ad_module] => http://s.ytimg.com/yts/swfbin/player-vflo5lBXw/ad.swf 
    [ptk] => Quirkology%2Buser 
    [tag_for_child_directed] => False 
    [ad_host] => ca-host-pub-8542631585713003 
    [gut_tag] => /4061/ytunknown/main 
    [track_embed] => 1 
    [iurl] => http://i1.ytimg.com/vi/psvkyf3PzjE/hqdefault.jpg 
    [has_cc] => True 
    [ytfocEnabled] => 1 
    [aid] => P82cR0jfshg 
    [view_count] => 8955678 
    [enablecsi] => 1 
    [csi_page_type] => embed 
    [idpj] => -5 
    [pltype] => content 
    [instream_long] => False 
    [timestamp] => 1405424575 
    [ad_eurl] => http://www.youtube.com/video/psvkyf3PzjE 
    [video_verticals] => [3, 33, 211, 539, 937] 
    [no_get_video_log] => 1 
    [c] => WEB 
    [avg_rating] => 4.87036008516 
    [afv_ad_tag] => http://googleads.g.doubleclick.net/pagead/ads?ad_type=text_image_flash&client=ca-pub-6219811747049371&description_url=http%3A%2F%2Fwww.youtube.com%2Fvideo%2Fpsvkyf3PzjE&hl=zh&host=ca-host-pub-8542631585713003&ht_id=5437415&loeid=903802,908561,941365,950844&url=http%3A%2F%2Fwww.youtube.com%2Fvideo%2Fpsvkyf3PzjE&ytdevice=1&yt_pt=APb3F2872adH7YS_TG-YymJq9di8wBzQOkAnXpMipeVU0r2mlfwTVxN2ctKxFVKaIS9T_PkpW7O6oZvyWyekRhSFs5-Xzi1EEjEdzSCExqO2Qsixwq_0z3S2l94eYc-nkda4brbMiPCR4F7WprSp&channel=yt_mpvid_OeTh0jm40F5BmeEA%2Byt_cid_7379%2Byt_no_ap%2Bytdevice_1%2Bafv_user_id_vGMGQC8gNkd4gwxSbABIlw%2Bafv_user_quirkology%2Bytel_embedded%2Bytps_default%2BVertical_8%2BVertical_33%2BVertical_36%2BVertical_211%2BVertical_539%2BVertical_613%2BVertical_937%2Bafv_overlay%2Binvideo_overlay_480x70_cat27 
    [iurlsd] => http://i1.ytimg.com/vi/psvkyf3PzjE/sddefault.jpg 
    [loeid] => 903802,908561,941365,950844 
    [afv] => True 
    [cafe_experiment_id] =>  
    [dashmpd] => http://manifest.googlevideo.com/api/manifest/dash/upn/f2nEB_KIghU/id/o-AKm8X5p-waOfjKuduWXVRoaCAHWLVisXWk4acX1jqKuq/signature/C73E49120EA6BB8825C670AF1EF28837D096D227.01BF67F4E38FC40D5DA612E8ACC2CB7F3D9DF11E/mws/yes/ipbits/0/sparams/as%2Cid%2Cip%2Cipbits%2Citag%2Cplayback_host%2Csource%2Cexpire/as/fmp4_audio_clear%2Cwebm_audio_clear%2Cfmp4_sd_hd_clear%2Cwebm_sd_hd_clear/mt/1405424547/fexp/902408%2C903802%2C908561%2C924213%2C924217%2C924222%2C930008%2C934024%2C934030%2C936927%2C941365%2C950844/itag/0/expire/1405447200/ip/114.142.144.2/sver/3/key/yt5/ms/au/mv/m/source/youtube/playback_host/r1---sn-i3b7rn7k.googlevideo.com 
    [as_launched_in_country] => 1 
    [iv_invideo_url] => http://www.youtube.com/annotations_invideo?cap_hist=1&cta=2&video_id=psvkyf3PzjE 
    [cc_asr] => 1 
    [eventid] => vxPFU4bgLozf4QL30oGQDQ 
    [advideo] => 1 
    [allow_embed] => 1 
    [adaptive_fmts] => bitrate=710675&itag=135&clen=10059819&lmt=1389170366021025&index=708-1075&type=video%2Fmp4%3B+codecs%3D%22avc1.4d401e%22&url=http%3A%2F%2Fr1---sn-i3b7rn7k.googlevideo.com%2Fvideoplayback%3Fdur%3D150.760%26id%3Do-AKm8X5p-waOfjKuduWXVRoaCAHWLVisXWk4acX1jqKuq%26expire%3D1405447200%26upn%3DKGNUK6LuT04%26ipbits%3D0%26sparams%3Dclen%252Cdur%252Cgir%252Cid%252Cip%252Cipbits%252Citag%252Clmt%252Csource%252Cupn%252Cexpire%26signature%3D1FC574CD991CDEF7E9D62CB4EC70C7C856FABA92.92A7C9A24C6C6CD77DDE8C8EB55E7CC698104DB0%26mt%3D1405424547%26fexp%3D902408%252C903802%252C908561%252C924213%252C924217%252C924222%252C930008%252C934024%252C934030%252C936927%252C941365%252C950844%26mv%3Dm%26itag%3D135%26clen%3D10059819%26ip%3D114.142.144.2%26lmt%3D1389170366021025%26mws%3Dyes%26key%3Dyt5%26ms%3Dau%26sver%3D3%26source%3Dyoutube%26gir%3Dyes&size=640x480&init=0-707,bitrate=719185&itag=244&clen=8795903&lmt=1392713279627232&index=235-701&type=video%2Fwebm%3B+codecs%3D%22vp9%22&url=http%3A%2F%2Fr1---sn-i3b7rn7k.googlevideo.com%2Fvideoplayback%3Fdur%3D150.760%26id%3Do-AKm8X5p-waOfjKuduWXVRoaCAHWLVisXWk4acX1jqKuq%26expire%3D1405447200%26upn%3DKGNUK6LuT04%26ipbits%3D0%26sparams%3Dclen%252Cdur%252Cgir%252Cid%252Cip%252Cipbits%252Citag%252Clmt%252Csource%252Cupn%252Cexpire%26signature%3DCB83B580452CC79901DA1B97EAFC4D124B62A535.F5BF4A6FBC4A46459B0F0B5AA6686C1414B113DB%26mt%3D1405424547%26fexp%3D902408%252C903802%252C908561%252C924213%252C924217%252C924222%252C930008%252C934024%252C934030%252C936927%252C941365%252C950844%26mv%3Dm%26itag%3D244%26clen%3D8795903%26ip%3D114.142.144.2%26lmt%3D1392713279627232%26mws%3Dyes%26key%3Dyt5%26ms%3Dau%26sver%3D3%26source%3Dyoutube%26gir%3Dyes&size=640x480&init=0-234,bitrate=347320&itag=134&clen=4755047&lmt=1389170359494796&index=710-1077&type=video%2Fmp4%3B+codecs%3D%22avc1.4d4015%22&url=http%3A%2F%2Fr1---sn-i3b7rn7k.googlevideo.com%2Fvideoplayback%3Fdur%3D150.760%26id%3Do-AKm8X5p-waOfjKuduWXVRoaCAHWLVisXWk4acX1jqKuq%26expire%3D1405447200%26upn%3DKGNUK6LuT04%26ipbits%3D0%26sparams%3Dclen%252Cdur%252Cgir%252Cid%252Cip%252Cipbits%252Citag%252Clmt%252Csource%252Cupn%252Cexpire%26signature%3D82A00C177F27F482B817C4431FEB9D24645D21A4.AD08DC1266CCE14473E5D9E79FD2B1FB9B12D2FF%26mt%3D1405424547%26fexp%3D902408%252C903802%252C908561%252C924213%252C924217%252C924222%252C930008%252C934024%252C934030%252C936927%252C941365%252C950844%26mv%3Dm%26itag%3D134%26clen%3D4755047%26ip%3D114.142.144.2%26lmt%3D1389170359494796%26mws%3Dyes%26key%3Dyt5%26ms%3Dau%26sver%3D3%26source%3Dyoutube%26gir%3Dyes&size=480x360&init=0-709,bitrate=325398&itag=243&clen=4386565&lmt=1392713345140443&index=235-700&type=video%2Fwebm%3B+codecs%3D%22vp9%22&url=http%3A%2F%2Fr1---sn-i3b7rn7k.googlevideo.com%2Fvideoplayback%3Fdur%3D150.760%26id%3Do-AKm8X5p-waOfjKuduWXVRoaCAHWLVisXWk4acX1jqKuq%26expire%3D1405447200%26upn%3DKGNUK6LuT04%26ipbits%3D0%26sparams%3Dclen%252Cdur%252Cgir%252Cid%252Cip%252Cipbits%252Citag%252Clmt%252Csource%252Cupn%252Cexpire%26signature%3DE24784C8417B49A8CB5BBCBEA146693F5BE99174.2CC63D490027D3F8089C00E599E0512A535BC9C4%26mt%3D1405424547%26fexp%3D902408%252C903802%252C908561%252C924213%252C924217%252C924222%252C930008%252C934024%252C934030%252C936927%252C941365%252C950844%26mv%3Dm%26itag%3D243%26clen%3D4386565%26ip%3D114.142.144.2%26lmt%3D1392713345140443%26mws%3Dyes%26key%3Dyt5%26ms%3Dau%26sver%3D3%26source%3Dyoutube%26gir%3Dyes&size=480x360&init=0-234,bitrate=267465&itag=133&clen=4562407&lmt=1389170356479745&index=673-1040&type=video%2Fmp4%3B+codecs%3D%22avc1.4d400d%22&url=http%3A%2F%2Fr1---sn-i3b7rn7k.googlevideo.com%2Fvideoplayback%3Fdur%3D150.760%26id%3Do-AKm8X5p-waOfjKuduWXVRoaCAHWLVisXWk4acX1jqKuq%26expire%3D1405447200%26upn%3DKGNUK6LuT04%26ipbits%3D0%26sparams%3Dclen%252Cdur%252Cgir%252Cid%252Cip%252Cipbits%252Citag%252Clmt%252Csource%252Cupn%252Cexpire%26signature%3DB3FB29C48F433326830973BB96CB44D1369BC103.1D5F72E076804DEFEAAC26ED846B82FAC182D82F%26mt%3D1405424547%26fexp%3D902408%252C903802%252C908561%252C924213%252C924217%252C924222%252C930008%252C934024%252C934030%252C936927%252C941365%252C950844%26mv%3Dm%26itag%3D133%26clen%3D4562407%26ip%3D114.142.144.2%26lmt%3D1389170356479745%26mws%3Dyes%26key%3Dyt5%26ms%3Dau%26sver%3D3%26source%3Dyoutube%26gir%3Dyes&size=320x240&init=0-672,bitrate=172413&itag=242&clen=2341546&lmt=1392713258254559&index=234-699&type=video%2Fwebm%3B+codecs%3D%22vp9%22&url=http%3A%2F%2Fr1---sn-i3b7rn7k.googlevideo.com%2Fvideoplayback%3Fdur%3D150.760%26id%3Do-AKm8X5p-waOfjKuduWXVRoaCAHWLVisXWk4acX1jqKuq%26expire%3D1405447200%26upn%3DKGNUK6LuT04%26ipbits%3D0%26sparams%3Dclen%252Cdur%252Cgir%252Cid%252Cip%252Cipbits%252Citag%252Clmt%252Csource%252Cupn%252Cexpire%26signature%3DCCA8C5F28250D7A5D4F09849A9FEE00723637F69.786B79CC0735041DB55BF9F81A89EA3FC0421754%26mt%3D1405424547%26fexp%3D902408%252C903802%252C908561%252C924213%252C924217%252C924222%252C930008%252C934024%252C934030%252C936927%252C941365%252C950844%26mv%3Dm%26itag%3D242%26clen%3D2341546%26ip%3D114.142.144.2%26lmt%3D1392713258254559%26mws%3Dyes%26key%3Dyt5%26ms%3Dau%26sver%3D3%26source%3Dyoutube%26gir%3Dyes&size=320x240&init=0-233,bitrate=111638&itag=160&clen=2044016&lmt=1389170357716230&index=672-1039&type=video%2Fmp4%3B+codecs%3D%22avc1.4d400c%22&url=http%3A%2F%2Fr1---sn-i3b7rn7k.googlevideo.com%2Fvideoplayback%3Fdur%3D150.760%26id%3Do-AKm8X5p-waOfjKuduWXVRoaCAHWLVisXWk4acX1jqKuq%26expire%3D1405447200%26upn%3DKGNUK6LuT04%26ipbits%3D0%26sparams%3Dclen%252Cdur%252Cgir%252Cid%252Cip%252Cipbits%252Citag%252Clmt%252Csource%252Cupn%252Cexpire%26signature%3D12D3F657364F94D535996A1CFE7C41797CB7958B.EBDF1D5F7EA15E99101D8468C8F3C3BAC609D097%26mt%3D1405424547%26fexp%3D902408%252C903802%252C908561%252C924213%252C924217%252C924222%252C930008%252C934024%252C934030%252C936927%252C941365%252C950844%26mv%3Dm%26itag%3D160%26clen%3D2044016%26ip%3D114.142.144.2%26lmt%3D1389170357716230%26mws%3Dyes%26key%3Dyt5%26ms%3Dau%26sver%3D3%26source%3Dyoutube%26gir%3Dyes&size=192x144&init=0-671,bitrate=128037&itag=140&clen=2396685&lmt=1389170356479565&index=592-815&type=audio%2Fmp4%3B+codecs%3D%22mp4a.40.2%22&url=http%3A%2F%2Fr1---sn-i3b7rn7k.googlevideo.com%2Fvideoplayback%3Fdur%3D150.860%26id%3Do-AKm8X5p-waOfjKuduWXVRoaCAHWLVisXWk4acX1jqKuq%26expire%3D1405447200%26upn%3DKGNUK6LuT04%26ipbits%3D0%26sparams%3Dclen%252Cdur%252Cgir%252Cid%252Cip%252Cipbits%252Citag%252Clmt%252Csource%252Cupn%252Cexpire%26signature%3DD4D185CE90BE2AED0DFF29AFF51F8FD31F7E038F.78F7D90CFEE7B73FF1BB863DDDCDDEF9AC88BE99%26mt%3D1405424547%26fexp%3D902408%252C903802%252C908561%252C924213%252C924217%252C924222%252C930008%252C934024%252C934030%252C936927%252C941365%252C950844%26mv%3Dm%26itag%3D140%26clen%3D2396685%26ip%3D114.142.144.2%26lmt%3D1389170356479565%26mws%3Dyes%26key%3Dyt5%26ms%3Dau%26sver%3D3%26source%3Dyoutube%26gir%3Dyes&init=0-591,bitrate=140964&itag=171&clen=2440463&lmt=1392713197841716&index=4452-4720&type=audio%2Fwebm%3B+codecs%3D%22vorbis%22&url=http%3A%2F%2Fr1---sn-i3b7rn7k.googlevideo.com%2Fvideoplayback%3Fdur%3D150.792%26id%3Do-AKm8X5p-waOfjKuduWXVRoaCAHWLVisXWk4acX1jqKuq%26expire%3D1405447200%26upn%3DKGNUK6LuT04%26ipbits%3D0%26sparams%3Dclen%252Cdur%252Cgir%252Cid%252Cip%252Cipbits%252Citag%252Clmt%252Csource%252Cupn%252Cexpire%26signature%3D99AC6494636CD4657F2665413AF44C603D69A03F.EFAA5D2D5B358C4B89285A852DA73601855B2268%26mt%3D1405424547%26fexp%3D902408%252C903802%252C908561%252C924213%252C924217%252C924222%252C930008%252C934024%252C934030%252C936927%252C941365%252C950844%26mv%3Dm%26itag%3D171%26clen%3D2440463%26ip%3D114.142.144.2%26lmt%3D1392713197841716%26mws%3Dyes%26key%3Dyt5%26ms%3Dau%26sver%3D3%26source%3Dyoutube%26gir%3Dyes&init=0-4451 
    [cc_font] => Arial Unicode MS, arial, verdana, _sans 
    [ad_video_pub_id] => ca-pub-6219811747049371 
    [watermark] => ,http://s.ytimg.com/yts/img/watermark/youtube_watermark-vflHX6b6E.png,http://s.ytimg.com/yts/img/watermark/youtube_hd_watermark-vflAzLcD6.png 
    [iurlmq] => http://i1.ytimg.com/vi/psvkyf3PzjE/mqdefault.jpg 
    [ad_flags] => 0 
    [iv3_module] => 1 
    [ldpj] => -14 
    [sffb] => True 
    [vid] => psvkyf3PzjE 
    [ad_host_tier] => 5437415 
    [cid] => 7379 
    [status] => ok 
    [thumbnail_url] => http://i1.ytimg.com/vi/psvkyf3PzjE/default.jpg 
    [muted] => 0 
    [iv_module] => http://s.ytimg.com/yts/swfbin/player-vflq0-BLs/iv_module.swf 
    [oid] => 5ktxztP0i_DArnZizBrNwg 
    [fexp] => 902408,903802,908561,924213,924217,924222,930008,934024,934030,941365,950844 
    [subtitles_xlb] => http://s.ytimg.com/yts/xlbbin/subtitles-strings-zh_HK-vflo2gkEm.xlb 
    [mpvid] => OeTh0jm40F5BmeEA 
    [midroll_prefetch_size] => 1 
    [shortform] => True 
    [token] => vjVQa1PpcFMd5fXZSBDDaOaa__9y5Uc-2YlgFz_9NsQ= 
    [vq] => auto 
    [keywords] => quirkology,jokes,magic,psychology,bets 
    [yt_pt] => APb3F2872adH7YS_TG-YymJq9di8wBzQOkAnXpMipeVU0r2mlfwTVxN2ctKxFVKaIS9T_PkpW7O6oZvyWyekRhSFs5-Xzi1EEjEdzSCExqO2Qsixwq_0z3S2l94eYc-nkda4brbMiPCR4F7WprSp 
    [url_encoded_fmt_stream_map] => type=video%2Fwebm%3B+codecs%3D%22vp8.0%2C+vorbis%22&url=http%3A%2F%2Fr1---sn-i3b7rn7k.googlevideo.com%2Fvideoplayback%3Fratebypass%3Dyes%26id%3Do-AKm8X5p-waOfjKuduWXVRoaCAHWLVisXWk4acX1jqKuq%26signature%3D941D46796D45C0C4D55AE0AD13A98ACF13AD1400.AACED8AB6CD15C1917DCAC1823A28AAB7B436645%26upn%3DAuQPXQuMv_8%26ipbits%3D0%26sparams%3Did%252Cip%252Cipbits%252Citag%252Cratebypass%252Csource%252Cupn%252Cexpire%26mt%3D1405424547%26fexp%3D902408%252C903802%252C908561%252C924213%252C924217%252C924222%252C930008%252C934024%252C934030%252C936927%252C941365%252C950844%26itag%3D43%26expire%3D1405447200%26ip%3D114.142.144.2%26sver%3D3%26mws%3Dyes%26key%3Dyt5%26ms%3Dau%26source%3Dyoutube%26mv%3Dm&itag=43&fallback_host=tc.v12.cache3.googlevideo.com&quality=medium,type=video%2Fmp4%3B+codecs%3D%22avc1.42001E%2C+mp4a.40.2%22&url=http%3A%2F%2Fr1---sn-i3b7rn7k.googlevideo.com%2Fvideoplayback%3Fratebypass%3Dyes%26id%3Do-AKm8X5p-waOfjKuduWXVRoaCAHWLVisXWk4acX1jqKuq%26signature%3D1DCA7FA6814DE080DF58799C1399F84564599F6E.1090D46786189F24EC82F0F03B367091DEE5CB6F%26upn%3DAuQPXQuMv_8%26ipbits%3D0%26sparams%3Did%252Cip%252Cipbits%252Citag%252Cratebypass%252Csource%252Cupn%252Cexpire%26mt%3D1405424547%26fexp%3D902408%252C903802%252C908561%252C924213%252C924217%252C924222%252C930008%252C934024%252C934030%252C936927%252C941365%252C950844%26itag%3D18%26expire%3D1405447200%26ip%3D114.142.144.2%26sver%3D3%26mws%3Dyes%26key%3Dyt5%26ms%3Dau%26source%3Dyoutube%26mv%3Dm&itag=18&fallback_host=tc.v18.cache7.googlevideo.com&quality=medium,type=video%2Fx-flv&url=http%3A%2F%2Fr1---sn-i3b7rn7k.googlevideo.com%2Fvideoplayback%3Fid%3Do-AKm8X5p-waOfjKuduWXVRoaCAHWLVisXWk4acX1jqKuq%26signature%3DD9BF21D3A338BF65EF25DCF1C48B5AF04A6FDA51.9F85C4F76C002380D384F8033E0EFC1F64AFED39%26upn%3DAuQPXQuMv_8%26ipbits%3D0%26sparams%3Did%252Cip%252Cipbits%252Citag%252Csource%252Cupn%252Cexpire%26mt%3D1405424547%26fexp%3D902408%252C903802%252C908561%252C924213%252C924217%252C924222%252C930008%252C934024%252C934030%252C936927%252C941365%252C950844%26itag%3D5%26expire%3D1405447200%26ip%3D114.142.144.2%26sver%3D3%26mws%3Dyes%26key%3Dyt5%26ms%3Dau%26source%3Dyoutube%26mv%3Dm&itag=5&fallback_host=tc.v11.cache2.googlevideo.com&quality=small,type=video%2F3gpp%3B+codecs%3D%22mp4v.20.3%2C+mp4a.40.2%22&url=http%3A%2F%2Fr1---sn-i3b7rn7k.googlevideo.com%2Fvideoplayback%3Fid%3Do-AKm8X5p-waOfjKuduWXVRoaCAHWLVisXWk4acX1jqKuq%26signature%3D0C5C8DDB1B491981847A8C423C1300CDA80BF34E.C699529D9EC6A7D579CB237330697044C514E552%26upn%3DAuQPXQuMv_8%26ipbits%3D0%26sparams%3Did%252Cip%252Cipbits%252Citag%252Csource%252Cupn%252Cexpire%26mt%3D1405424547%26fexp%3D902408%252C903802%252C908561%252C924213%252C924217%252C924222%252C930008%252C934024%252C934030%252C936927%252C941365%252C950844%26itag%3D36%26expire%3D1405447200%26ip%3D114.142.144.2%26sver%3D3%26mws%3Dyes%26key%3Dyt5%26ms%3Dau%26source%3Dyoutube%26mv%3Dm&itag=36&fallback_host=tc.v14.cache4.googlevideo.com&quality=small,type=video%2F3gpp%3B+codecs%3D%22mp4v.20.3%2C+mp4a.40.2%22&url=http%3A%2F%2Fr1---sn-i3b7rn7k.googlevideo.com%2Fvideoplayback%3Fid%3Do-AKm8X5p-waOfjKuduWXVRoaCAHWLVisXWk4acX1jqKuq%26signature%3D4B5A255CDCC9EC7738277722223E8317017FC8FF.6AD06552C98EDA94D0AC50E170F1DFAB93ED2914%26upn%3DAuQPXQuMv_8%26ipbits%3D0%26sparams%3Did%252Cip%252Cipbits%252Citag%252Csource%252Cupn%252Cexpire%26mt%3D1405424547%26fexp%3D902408%252C903802%252C908561%252C924213%252C924217%252C924222%252C930008%252C934024%252C934030%252C936927%252C941365%252C950844%26itag%3D17%26expire%3D1405447200%26ip%3D114.142.144.2%26sver%3D3%26mws%3Dyes%26key%3Dyt5%26ms%3Dau%26source%3Dyoutube%26mv%3Dm&itag=17&fallback_host=tc.v3.cache7.googlevideo.com&quality=small 
    [excluded_ads] => 3=1_1,1_2_1,1_3,2_2_1,2_3 
    [allow_ratings] => 1 
    [allow_html5_ads] => 1 
    [cc3_module] => 1 
    [ad_logging_flag] => 1 
    [focEnabled] => 1 
    [tmi] => 1 
    [cut_ad_for_ypc] => False 
    [author] => Quirkology 
    [dash] => 1 
    [allowed_ads] => [8, 1, 2, 10, 0] 
    [iurlhq] => http://i1.ytimg.com/vi/psvkyf3PzjE/hqdefault.jpg 
    [cc_module] => http://s.ytimg.com/yts/swfbin/player-vflq0-BLs/subtitle_module.swf 
    [host_language] => zh 
    [midroll_freqcap] => 420.0 
    [uid] => vGMGQC8gNkd4gwxSbABIlw 
    [fmt_list] => 43/640x360/99/0/0,18/640x360/9/0/115,5/320x240/7/0/0,36/320x240/99/1/0,17/176x144/99/1/0 
    [baseUrl] => http://googleads.g.doubleclick.net/pagead/viewthroughconversion/962985656/ 
    [ad_channel_code_overlay] => yt_mpvid_OeTh0jm40F5BmeEA,yt_cid_7379,yt_no_ap,ytdevice_1,afv_user_id_vGMGQC8gNkd4gwxSbABIlw,afv_user_quirkology,ytel_embedded,ytps_default,Vertical_8,Vertical_33,Vertical_36,Vertical_211,Vertical_539,Vertical_613,Vertical_937,afv_overlay,invideo_overlay_480x70_cat27 
    [video_id] => psvkyf3PzjE 
)

希望本文所述对大家的php程序设计有所帮助。

(0)

相关推荐

  • JS实现从连接中获取youtube的key实例

    本文实例讲述了JS从连接中获取youtube的key的方法.分享给大家供大家参考.具体分析如下: 这段代码演示了从字符串中截取子字符串的方法 // Example link: // <a id="myLink" href="http://www.youtube.com/watch?v=cyRqR56aCKc&feature=PlayList&p=00000000000&index=0&playnext=1">Youtube

  • JavaScript 键盘event.keyCode值列表大全

    网上收集的KeyCode值方便大家查找: keycode 8 = BackSpace BackSpace keycode 9 = Tab Tab keycode 12 = Clear keycode 13 = Enter keycode 16 = Shift_L keycode 17 = Control_L keycode 18 = Alt_L keycode 19 = Pause keycode 20 = Caps_Lock keycode 27 = Escape Escape keycode

  • JavaScript获取网页中第一个链接ID的方法

    本文实例讲述了JavaScript获取网页中第一个链接ID的方法.分享给大家供大家参考.具体如下: 下面的JS代码通过document.links获得网页中的所有超级链接数组,然后获得第一个链接的ID属性 <!DOCTYPE html> <html> <body> <h1>sharejs.com</h1> <img src ="planets.gif" width="145" height="

  • javascript 同时在IE和FireFox获取KeyCode的代码

    HTML 复制代码 代码如下: <input type="password" name="psw" id="loginpsw" onkeypress="submit1(event)"/> Javascript 复制代码 代码如下: function submit1(e){ var isie = (document.all) ? true : false;//判断是IE内核还是Mozilla var key; if

  • javascript 对象数组根据对象object key的值排序

    有个js对象数组 var ary=[{id:1,name:"b"},{id:2,name:"b"}] 需求是根据name 或者 id的值来排序,这里有个风骚的函数 函数定义: 复制代码 代码如下: function keysrt(key,desc) {   return function(a,b){     return desc ? ~~(a[key] < b[key]) : ~~(a[key] > b[key]);   } } 使用: 复制代码 代码

  • javascript使用switch case实现动态改变超级链接文字及地址

    代码很简单,我这里就不多废话了,小伙伴们直接看源码吧. 复制代码 代码如下: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="te

  • 删除Javascript Object中间的key

    这个也不会,回家种田去吧你 复制代码 代码如下: delete thisIsObject[key] or delete thisIsObject.key 顺便我们来谈谈delete的用法 几个礼拜前, 我有了个机会去翻阅Stoyan Stefanov的 Object-Oriented Javascript 一书. 这本书在亚马逊上拥有很高的评价(12篇评论, 5颗星), 所以我很好奇地想看看它到底是不是那么值得推荐的一本书, 于是我开始阅读函数的那章. 我非常欣赏这本书解释事物的方式, 例子们被

  • JavaScript判断一个URL链接是否有效的实现方法

    引言 有一个通讯录系统, 同时部署在几台服务器上, 但是主页上有个通讯录的链接, 链接到这个系统. 问题是, 有时候链接指向的服务器出故障, 于是希望在这个服务器出故障(服务不可用)的情况下, 能指向其他服务器的链接. 解决方案一: XMLHTTP方案 以下代码摘自[2]中meizz的回帖: 复制代码 代码如下: <script language= "javascript"> function getURL(url) { var xmlhttp = new ActiveXO

  • javascript自动给文本url地址增加链接的方法分享

    URL地址自动添加的实现其实就是那么点内容:检测与替换. 检测 "检测"就是检测文字(字符串)内部是否有符合http地址的内容,显然,这需要用到正则表达式进行验证,这个工作前端和后台都可以做,这里,只讲前端的方法,使用JavaScript实现. 验证HTTP地址的正则表达式如下(可能有疏漏或是不准确之处,欢迎指正): 复制代码 代码如下: var reg = /(http://|https://)((w|=|?|.|/|&|-)+)/g; 前一部分匹配http或是https开头

  • php获取YouTube视频信息的方法

    本文实例讲述了php获取YouTube视频信息的方法.分享给大家供大家参考.具体分析如下: YouTube的视频地址格式 https://www.youtube.com/watch?v=[VIDEO_ID] 例子:https://www.youtube.com/watch?v=psvkyf3PzjE 复制代码 代码如下: //根据video id 获取YouTube视频信息  function getYouTubeInfo($video_id){      $content = file_get

  • python获取图片颜色信息的方法

    本文实例讲述了python获取图片颜色信息的方法.分享给大家供大家参考.具体分析如下: python的pil模块可以从图片获得图片每个像素点的颜色信息,下面的代码演示了如何获取图片所有点的颜色信息和每种颜色的数量. from PIL import Image image = Image.open("jb51.gif") image.getcolors() 返回结果如下 复制代码 代码如下: ..., (44, (72, 64, 55, 255)), (32, (231, 208, 14

  • php获取apk包信息的方法

    有时候在使用php上传安卓apk包的时候,我们需要获取安卓apk包内的信息,本文以实例形式讲述了php获取apk包信息的方法.具体实现方法如下: <?php /*解析安卓apk包中的压缩XML文件,还原和读取XML内容 依赖功能:需要PHP的ZIP包函数支持.*/ include('./Apkparser.php'); $appObj = new Apkparser(); $targetFile = a.apk;//apk所在的路径地址 $res = $appObj->open($target

  • 在Linux与Windows上获取当前堆栈信息的方法

    在编写稳定可靠的软件服务时经常用到输出堆栈信息,以便用户/开发者获取准确的运行信息.常用在日志输出,错误报告,异常检测. 在Linux有比较简便的函数获取堆栈信息: #include <stdio.h> #include <execinfo.h> #include <signal.h> #include <stdlib.h> #include <unistd.h> void handler(int sig) { void *array[5]; s

  • Android开发之在程序中时时获取logcat日志信息的方法(附demo源码下载)

    本文实例讲述了Android开发之在程序中时时获取logcat日志信息的方法.分享给大家供大家参考,具体如下: 今天分享一个在软件开发中很实用的例子,也是这几天在通宵加班中我使用的一个小例子, 在程序中监听Log信息. 为什么说它实用?原因是Android的开发厂商各种修改之后手机和手机之间以后存在很多差异.比如说魅族M9手机 开发中如果项目中涉及到访问手机系统的地方,例如访问系统短信库,M9手机它会提示一个dialog框 让用户自己去选择 访问还是不访问.这样就给开发适配带来了巨大的麻烦.本来

  • C#获取文件相关信息的方法

    本文实例讲述了C#获取文件相关信息的方法.分享给大家供大家参考.具体分析如下: C#可以通过FileInfo类可以获得指定文件的信息,包含文件的名字,大小等. FileInfo fi = new FileInfo(@"C:\file.txt"); if(fi.Exists) { Console.WriteLine("Filename : {0}",fi.Name); Console.WriteLine("Path : {0}",fi.FullNa

  • php微信公众开发之获取周边酒店信息的方法

    本文实例讲述了php微信公众开发之获取周边酒店信息的方法.分享给大家供大家参考.具体分析如下: 关注微信公众之后发送回复地理位置信息,即可回复周边附近的酒店信息列表,下面我就来给各位介绍利用php是怎么实现这个功能,希望全子对大家有帮助.代码如下: 复制代码 代码如下: <?php  //将提交过来的信息接收 $signature = $_GET['signature'];  $timestamp = $_GET['timestamp'];  $nonce = $_GET['nonce'];  

  • python获取mp3文件信息的方法

    本文实例讲述了python获取mp3文件信息的方法.分享给大家供大家参考.具体如下: 将代码生成.py文件放在目录下运行,可以获取该目录的所有mp3文件的信息,需要使用ID3库 import os, sys from ID3 import * files = os.listdir(os.getcwd()) for f in files: x = os.path.splitext(f) if x[1] == '.mp3': n = x[0].split(' - ') author = n[0] t

  • linux平台使用Python制作BT种子并获取BT种子信息的方法

    本文实例讲述了linux平台使用Python制作BT种子并获取BT种子信息的方法.分享给大家供大家参考,具体如下: 最近研究了一下linux BT服务器环境的搭建,需要在linux下制作BT种子并获取BT种子信息,整理了一下这个过程: 制作BT种子软件本站下载地址. 安装: [root@localhost src]# tar zxf mktorrent-1.0.tar.gz [root@localhost src]# cd mktorrent-1.0 [root@localhost mktorr

  • C#实现获取mp3 Tag信息的方法

    本文实例讲述了C#实现获取mp3 Tag信息的方法.分享给大家供大家参考,具体如下: using System; using System.Collections.Generic; using System.Text; using System.IO; namespace Foxer_Player_1._1 { public struct Mp3Info { public string identify; //TAG,三个字节 public string Title; //歌曲名,30个字节 p

随机推荐