Upload Videos to Youtube WITHOUT OAUTH - c#

So I am making a program to upload YouTube videos to my clan channel so that I can distribute it to the other clan members and everything is all set...
They open the program, they browse the file, set the title, the privacy and press Upload. DONE
If they want they open the thumbnail changer, browse for the thumbnail press Upload. DONE
It works great!... In my computer, how can I make it that it works for everyone? because everytime I share it with one of the members... it doesn't work because they need to login using OAUTH (to one of their accounts).
Thanks for helping!
I'm coding in C# but that is not relevant at all.. by the way I've already tried older methods present in the API but it returns invalid request.

There is no way to use the YouTube API without Oauth. If you want to access private user data you need to have the permission of the user who owns the data.
Your only option would be to authenticate your code once and store the refresh token and use it when the others want to access your data. If you are using Google .net Client library check filedatastore its storing your refresh token.

Here is the code for uploading videos to youtube without OAuth, You only need API key, Username, Password.
https://developers.google.com/youtube/2.0/developers_guide_dotnet?csw=1#Direct_Upload

Related

upload file to google drive windows forms c#

Basically the idea of ​​the program is as follows: The user enters their email account and password google drive, then select the file and click upload button.
Can this be done?
Yes, but you have to have an embedded browser to handle the authentication using OAuth, as the client will need to enter their credentials into the Google login page. A previous answer here How to publish Google Docs in .NET? also indicates there is a .net library (which I havent tried) that might help.

Upload files on cloud using email address

So I am not sure if it is possible and if it is making sense at all. I am trying to learn and use cloud space in my application. So as a sample I was trying to create an application to upload files in Google Drive. I registered my application and used some references given by Google. And I am able to upload files now.
I registered my app using myname#gmail.com and used Client_Id and Client_Secret given in my account to create the app. When I upload the files, files get uploaded to my myname#gmail.com account. But what I want is, my app should give an option to user to login into there gmail accounts. Whoever logs in (say with email your#gmail.com), my app should be able to upload files to there account. I believe offline Google Drive app for desktop works the same way. Enter your username and password and files will sync to that account. Can anyone point me to a sample code please?
I want to upload files, read them, delete them, share them through my app. I am not giving any code sample, but if its needed let me know. Thanks.
You can do it. You will need to navigate user to a specific URL, where he will input his email and password. After that Google will give you authorization code and refresh token. Refresh token can be used to retrieve authorization code whenever it is expired.
This authorization code is used to work with user drive.
If your application is a web application you may navigate user to google and set callback to your custom URL.
If it is a windows forms application, then you have 2 options
Create custom browser window and parse DocumentTitle property
Navigate user's browser and ask him to copy-paste code from title (or do it automatically)
You may download an example from here
Just fill CLIENT_ID and CLIENT_SECRET constants.

Youtube: Upload video to multiple accounts

I am developing an c# application to upload videos to youtube from my local drive to different accounts. Currently I am not using youtube API to upload the videos and I use webclient class & a google developer key to do it. I am able to upload the videos successfully to the account which is associated with the developer key. However when I use the credentials of different youtube account it's not able to upload and I get the error
"Currently authenticated user does not have write access to username myusername"
I am not sure about the cause of this error. Or is it that do I need to change any settings in the youtube account to enable the access for the application to upload videos? I assume I need to use the youtube API to do it. Are there any other methods to upload a video to different youtube account by providing the username and password with my developer key?
The problem was wit the url to upload to a comment.
Thanks.
I have no idea what the "webclient class" you refer to means. You should be using the official YouTube API if you're programmatically interacting with YouTube.
The correct way to handle uploads is to use the username "default" when constructing your upload URL, as described at
https://developers.google.com/youtube/2.0/developers_guide_protocol_direct_uploading
This will ensure that the upload goes into the account associated with the current authorization token.
There's sample code to do this using the .NET client library available at
https://developers.google.com/youtube/2.0/developers_guide_dotnet#Direct_Upload

List Dropbox Files using REST API

I want to list all the files of a folder from my own Dropbox account on my website. I was going to use C# and the Dropbox Rest API but from reading the documentation it appears that I can't do that without first getting the user to go to dropbox to receive an authorisation token.
Is this correct? Is there anyway I can return the data in code without asking the user to log in?
Actually no.
You need to authenticate first using OAuth and than get list of files. Documentation is here
Also as tutorial here:
https://github.com/geersch/DropboxRESTApi

Transparently Get Facebook Profile Pictures

I'm just getting into the Graph API and am having having a hard time trying to figure out if/how I can go about showing MY profile albums on My website with out having to have the user log into facebook. I'm getting thrown off with the access token...I realize I can retreive an access token to retreive my photos if I have someone log on to the site, but I want it to be transparent, using my credentials through code (securely) some how if necessary.
How can I accomplish this? I'm looking for a general conceptual explaination, but pseudo code never hurts. Can any one clear it up for me a little?
Using:
Facebook Javascript Sdk
Mirosoft MVC
Facebook C# Sdk
There's no way, that I'm aware of, to do that.
Facebook apps treat all users the same, you can't have special privileges for your user.
If your user is public then you should be able to get all of the public using an application access token which does not expire.
If that's not the case then you have two options as I see it.
Use the server side authentication with your user, or extend a valid token (a method to replace the deprecation of the "offline_access" permission), that will get you a long lived token, about 60 days, and in that time frame you can then get your data from facebook.
Then when that expires re-authenticate in the same way and get another 60 working days, etc.
Another approach is to authenticate as yourself and then have your app save the data, then present it from your own db.
Be sure to update the data every once in a while.

Categories

Resources