0

我正在使用 TweetInvi 在 Twitter 上发布视频。

TwitterCredentials.SetCredentials(token.Token,token.TokenSecret,ConfigurationManager.AppSettings["ConsumerKey"], ConfigurationManager. AppSettings["ConsumerSecret"]);

var filePath = string.Format("{0}content\\participant\\video\\{1}.{2}", Request.PhysicalApplicationPath, p.video, "mp4");
byte[] file1 =System.IO.File.ReadAllBytes(filePath);

var tweet =  Tweetinvi.Tweet.CreateTweet(message);
tweet.AddMedia(file1, "video");            
var success = tweet.Publish();

推文发布成功。但视频文件丢失。我在媒体上使用了来自 tweetinvi twwet 的代码

提前致谢。

4

1 回答 1

2

Twitter 正在使用一种新的视频上传机制。Tweetinvi 尚未发布此功能,但它将在我今天发布的 Tweetinvi 0.9.8.2 中提供,其中包含此特定功能。

同时,请按照此链接中的说明进行操作(将标记阅读为已回答的解决方案)。


更新 :

您现在可以通过 Tweetinvi 0.9.8.2 使用 VideoUploader。不幸的是,nuget 存在一些问题,因此您现在必须指定版本:

安装包 TweetinviAPI -版本 0.9.8.2

这是一个代码示例:

var binary = File.ReadAllBytes(@"C:\video.mp4");
var media = VideoUploader.UploadVideo(binary);
var tweet = Tweet.CreateTweet("hello" + Guid.NewGuid());
tweet.AddMedia(media);
var success = tweet.Publish();

干杯,林维

于 2015-06-30T12:20:44.587 回答