youtube api upload video java - google-app-engine

I have an IOS app which uploads video directly to youtube. by using the below mediastream sourrce,
MediaStreamSource ms = new MediaStreamSource(inputStream, VIDEO_FILE_FORMAT);
ms.setName(title);
newEntry.setMediaSource(ms);
VideoEntry createdEntry = service.insert(new URL("http://uploads.gdata.youtube.com/feeds/api/users/default/uploads"), newEntry);
Recently it started failing by throwing an exception as below.
Throwable: No longer available
com.google.gdata.util.NoLongerAvailableException: No longer available
http://schemas.google.com/g/2005'>GDataNoLongerAvailableExceptionNo longer available
at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:629)
at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:564)
at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:560)
at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:538)
at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:536)
at com.google.gdata.client.media.MediaService.insert(MediaService.java:399)
Any Idea what is gone wrong. we are passing the Developer Key and and the user credentials

Related

Webview missing from Chrome

We have an embedded microApp that is setup on a thirdparty website (Saba) that is designed to pass a session token to our Application. We are initiating a User login by presenting them an embedded browser session using WebView2 in our wpf application. Then after a successful login the microApp on the Saba homepage passes back a session token. This appears to be where the application is hanging, waiting for the valid session token to be returned.
This had been working great up until the last 24 hrs, when we are experience hangs on logging in. It appears that trying to access webview via the console/inspector from Edge doesn't work either. "window.chrome.webview" shows undefined.
We are actively scouring any reference we can find to see if there is information about webview support being deprecated or moved but we haven't yet. If anyone has any ideas or resources of where we may be able to find some answer that would be much appreciated.

Get webTorrent to play .mp4 file stored in AWS private s3 bucket

I am using reactjs and flask. After getting the torrent of .mp4 file stored in private s3 bucket, I am trying to displayand play it in browser using webtorrent.
But the video content is not loading
This is a follow up question to Load and play 1 GB .mp4 in reactjs, stored in private s3 bucket. For now, the s3 bucket is public. Because private file was throwing error.
Code for reference - https://codepen.io/drngke/pen/abNGbEg
const magnet = 'https://datavocal.s3.amazonaws.com/s3outputx.mp4.torrent'
const client = new WebTorrent()
client.add(magnet, (torrent) => {
console.log(torrent.files)
torrent.files[0].appendTo('body')
});
client.on("error", (err) => console.log(err))
I'm not sure if this will work.
From the webtorrent docs:
To make BitTorrent work over WebRTC (which is the only P2P transport that works on the web) we made some protocol changes. Therefore, a browser-based WebTorrent client or "web peer" can only connect to other clients that support WebTorrent/WebRTC.
And further:
To seed files to web peers, use a client that supports WebTorrent, e.g. WebTorrent Desktop, a desktop client with a familiar UI that can connect to web peers, webtorrent-hybrid, a command line program, or Instant.io, a website.
So I'm guessing S3 would have to support WebTorrent/WebRTC which I don't think it will.
If my understanding of the above diagram is correct, you could run a hybrid client in between S3 and your web-peers, however you'd then need to host the hybrid somewhere which kind of makes S3 redundant in that setup.

How to troubleshoot "Value cannot be null. Parameter name: baseUri"

I need help diagnosing this error. Others get it on various platforms (youtube, for example) but seems not solved for most of them. For those who do report success, their solutions haven't work for me.
I'm using Google Drive API and I receive this error when attempting to upload to Google Drive.
My code was working fine for a long time; suddenly, I get this error. After research, I determined that I haven't reached a quota, and that these API are enabled:
Debuglet Controller API
Drive API
Google Cloud Dataflow API
Google Cloud Dataproc API
Google Cloud Deployment Manager API
Google Cloud Deployment Manager V2 API
Google Cloud Storage
Google Cloud Storage JSON API
Google Compute Engine Autoscaler API
Google Compute Engine Instance Group Manager API
Google Compute Engine Instance Group Updater API
Google Compute Engine Instance Groups API
Google Container Engine API
Google Machine Learning API
Here's my code:
string fileName = #"c:\temp\MyPicture.jpg";
string fileTitle = #"TEST-DELETE-ME.jpg";
string fileDescription = #"Test file name";
string fileType = "image/jpeg";
string parentId = "zmzmzmzmzmzmzmzmzmz";
Google.Apis.Drive.v2.DriveService service = (Google.Apis.Drive.v2.DriveService)Service;
Google.Apis.Drive.v2.Data.File body = new Google.Apis.Drive.v2.Data.File();
body.Title = fileTitle;
body.Description = fileDescription;
body.MimeType = fileType;
body.Parents = new List<ParentReference> { new ParentReference() { Id = parentId } };
byte[] byteArray = System.IO.File.ReadAllBytes(fileName);
System.IO.MemoryStream stream = new System.IO.MemoryStream(byteArray);
Google.Apis.Drive.v2.FilesResource.InsertMediaUpload request = service.Files.Insert(body, stream, fileType);
Google.Apis.Upload.IUploadProgress progress = request.Upload();
Google.Apis.Drive.v2.Data.File file = request.ResponseBody;
if (file == null)
{
//Here we are, and we shouldn't be!
//progress.exception.message =
//
//Value cannot be null.
//Parameter name: baseUri
}
When I look at Drive API settings, these are the configurations:
No icons (there are boxes to set 256x265, 128x128, 64x64, 32x32, and 16x16 all are blank)
The application name and short and long descriptions are all blank and optional.
For Drive Integration, all boxes and checkboxes are blank or unchecked. Specifically:
"Automatically show OAuth 2.0 consent..." is unchecked.
"Open URL" is blank.
Default and secondary MIME types and file extensions are blank
"Allow users to create new documents..." is unchecked
"Allow users to open multiple files..." is unchecked
"Allow users to open files that can be converted..." is unchecked
"This application can be launched and works properly in a mobile browser" is unchecked.
Users don't use the Google Drive UI to create documents via my application, and is not meant to be used on a mobile browser. My application only uploads PDF files to users' accounts.
My application has been working for months with no problems, now suddenly seeing this error.
I have tried disabling all API's and then re-enabling them. No dice.
I have tried using a new client id and secret. No dice.
I have tried using a new gmail address and creating a new client id and secret. No dice.
I can't possibly be the only person in the world with this problem. Can anyone help me troubleshoot this?
The underlying issue is like an authorization issue or some other error with the request. However, there's a bug in the .NET client that is masking the error.
See https://github.com/google/google-api-dotnet-client/issues/456

Upload local database to SkyDrive as a textfile

I havent looked at the samples yet for the SkyDrive.
I have done a application that saves some data in a local database on the phone.
What i want to do is to upload all these to a SkyDrive account as a textfile.
Is this possible?
Might want to start with a blog post I wrote - Adding SkyDrive support to your Windows Phone application. You will need to download the Live SDK (unless you want to use the REST API manually, which I can see no reason for at this point).
Uploading is fairly simple after that, given that you obtained the proper session init:
client = new LiveConnectClient(App.MicrosoftAccountSession);
client.UploadCompleted += MicrosoftAccountClient_UploadCompleted;
client.UploadProgressChanged += MicrosoftAccountClient_UploadProgressChanged;
client.UploadAsync("me/skydrive", Binder.Instance.CurrentlyUploading,
stream, OverwriteOption.Overwrite);
Where stream is a MemoryStream instance.

Silverlight 4 webclient authentication - anyone have this working yet?

So one of the best parts about the new Silverlight 4 beta is that they finally implemented the big missing feature of the networking stack - Network Credentials!
In the below I have a working request setup, but for some reason I get a "security error" when the request comes back - is this because twitter.com rejected my api call or something that I'm missing in code?
It might be good to point out that when I watch this code execute via fiddler it shows that the xml file for cross domain is pulled down successfully, but that is the last request shown by fiddler ...
public void RequestTimelineFromTwitterAPI()
{
WebRequest.RegisterPrefix("https://", System.Net.Browser.WebRequestCreator.ClientHttp);
WebClient myService = new WebClient();
myService.AllowReadStreamBuffering = true;
myService.UseDefaultCredentials = false;
myService.Credentials = new NetworkCredential("username", "password");
myService.UseDefaultCredentials = false;
myService.OpenReadCompleted += new OpenReadCompletedEventHandler(TimelineRequestCompleted);
myService.OpenReadAsync(new Uri("https://twitter.com/statuses/friends_timeline.xml"));
}
public void TimelineRequestCompleted(object sender, System.Net.OpenReadCompletedEventArgs e)
{
//anytime I query for e.Result I get a security error
}
I found 2 issues that caused this request to throw the security exception
1) - In this video by Tim Heuer it turns out my VS2010 w/ Silverlight 4 toolkit installation didn't match the final build so I'm missing the option that shows up in the "out of browser settings" dialog that provides the checkbox for "Require elevated trust when running outside the browser".
In the video listed above Tim checks this so the Silverlight app can talk to the twitter API
But because my application didn't have this option I had to manually edit the xml file so it looked like the below. You can find this xml under properties in the project folder or inside visual studio directly.
<OutOfBrowserSettings ShortName="TrustedNetworkApp Application" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
<OutOfBrowserSettings.Blurb>TrustedNetworkApp Application on your desktop; at home, at work or on the go.</OutOfBrowserSettings.Blurb>
<OutOfBrowserSettings.WindowSettings>
<WindowSettings Title="TrustedNetworkApp Application" Height="480" Width="640" />
</OutOfBrowserSettings.WindowSettings>
<OutOfBrowserSettings.SecuritySettings>
<SecuritySettings ElevatedPermissions="Required" />
</OutOfBrowserSettings.SecuritySettings>
<OutOfBrowserSettings.Icons />
</OutOfBrowserSettings>
Notice the **security settings ElevatedPermissions="Required"
After you save this it's equivalent to checking this as Tim did in the video.
2) - as I was watching that video by Tim I noticed that you have to debug this outside of the browser to get it working. So install the app and run it outside the browser. This app now works.
I'll write a short blog post to summarize my experience with the networking stack under the beta and link to it for anyone interested.
Update
I finally wrote a blog post about my experience building an out of browser twitter client using Silverlight 4 if anyone is interested.

Resources