2013-01-04 10 views
1

我开发一个WordPress插件视频列表管理器来获得优酷视频缩略图:http://wordpress.org/extend/plugins/video-list-manager/如何使用PHP

我不知道,如果优酷支持我们获得优酷视频缩略图。我想添加VEOH到我的插件和我需要的是: 1.嵌入链接(是) 2.缩略图(否)

请帮帮我!

谢谢

+1

你应该告诉你已经尝试过的东西。在此期间,这应有助于: http://www.veoh.com/rest/v2/doc.html – kennypu

回答

1

如果您有指向视频的链接,例如http://www.veoh.com/watch/abcdef123456首先需要使用API​​方法veoh.video.findByPermalink来获取视频ID:

http://www.veoh.com/rest/v2/execute.xml?method=veoh.video.findByPermalink 
             &permalink=abcdef123456 
             &apiKey=12345678-1234-... 

你会得到这个结构的XML:

<rsp> 
    <videoList offset="0" items="1" numItems="1"> 
    <video videoId="12345" ... > 
    ... 

随着该视频ID然后可以使用API​​方法veoh.video.getVideoThumbnails该视频的获取缩略图:

http://www.veoh.com/rest/v2/execute.xml?method=veoh.video.getVideoThumbnails 
             &videoId=12345 
             &apiKey=12345678-1234-... 

你会得到这个结构的XML:

<rsp> 
    <thumbList offset="0" items="33" numItems="10"> 
    <thumbnail lowResImage="http://....jpg" highResImage="http://....jpg"> 
    </thumbnail> 
    <thumbnail lowResImage="http://....jpg" highResImage="http://....jpg"> 
    </thumbnail> 
    ... 

该API非常易于使用,完整的方法列表请参阅documentation

+0

我是不是可以有资格成为优酷的合作伙伴。所以,我不能有API密钥。 :( –

+0

你不需要的API秘密此方法...只是说仍然不会帮你的插件,我想 – AndreKR

+0

谢谢,反正所以我将优酷忽略并找到了一些其他的视频网站。! | –