Making a Youtbe video exclusive on my website - api

I have a Youtube video set to private so nobody can watch it via Youtube or the embedded player. However I do want people be to be able to watch it on my website. The goal is to make the video available exclusively on my website for a while before I open it to the world. I was thinking to login to my Youtube account seemlessly using Youtube's API and log out after the video's finished but that doesn't make security sense. What's your take on that?

I agree with your intuition. Making the private sharing secure seems tricky at best. Although the Data API has procedural authentication options, I don't think Player API has that facility. Furthermore even if it did, it's hard to see how it might work without exposing your password.
Your best bet is probably to directly host the video on your website. You would use your website's authentication for restricting access limited release video. Then when your ready for the public release you can either switch to YouTube hosting or relax the authentication of your self hosting. The Video for Everybody site has examples of several options for self hosting of videos.

Related

Video private links with expiration

On Vimeo (using their API), is it possible to generate private links that automatically expire? If not, what would be a good workflow to approximate this function, based on the API's limitations?
Basically, we would like to provide subscribers to our website limited time access to our videos. We would embed the player links in a private area of the site.
We wouldn't want users to have the ability to copy the link code and keep accessing the videos after their access has expired. Also, in the case of multiple users wanting access to the same video, we wouldn't want any updates to the privacy settings of a video to interfere with previous user access granted (that has not yet expired).
The Vimeo API can only toggle a video's privacy settings, the API cannot grant playback to a viewer outside of the privacy settings available.
For example, the API can be used to set a video as password-protected and set the video's password, however the API cannot be used to authenticate and bypass password protection and allow playback.
You could deal with this by providing a redirect from your own site and have the redirect expire. That would provide the functionality you’re looking for, but it’s also very easy to circumvent. It depends how strict/hard you want to make the expiry.

Spotify Web API to control playback on connect devices

Is there any way to use an API to control playback on my registered spotify connect devices? I'm not trying to create or add a new connect devices but control playback to them.
Is there any official or reverse engineering discussion on how to do this?
As far as I can tell, there is no way to do this currently.
That said, it's also unclear if or when this feature will be added. Spotify hasn't updated its api code in months. It also appears that the login functionality is broken on my app too. Spotify doesn't seem to be easy to work with.

How do you detect changes in a user's Spotify playlist?

Scenario: Spotify user on the native desktop application is adding and removing songs from the currently playing playlist.
I'm curious if it's possible for me to detect when any addition/removal happens? Basically need a trigger to tell me the playlist has changed without having to continuously poll Spotify's API to see if anything changed. Looking for a solution that could be used either via the Spotify API or something hack-ish using spotilocal or listening on Spotify's 4070 port.
Looking for a solution that could be used either via the Spotify API
or something hack-ish using spotilocal or listening on Spotify's 4070
port.
I wouldn't recommend this approach since the mentioned APIs may change without notice. It's not publicly supported so there's no commitment from Spotify to avoid breaking changes. It also requires the user to have the Spotify desktop application installed.
As you've noticed, since there's currently no way to subscribe to changes in a playlist, e.g. by a Websocket or HTTP PubSub interface like PubSubHubbub, your application would be forced to poll for changes. If you go down this path, I strongly recommend that you make use of the ETags and snapshot_id provided in the Playlist response.
Declaring how ETags are implemented in the Web API deserves a longer response and should be on the developer site. There's however a useful Working With Playlists guide on there that explains snapshots and some other things related to playlists.
It's also worth mentioning that all applications are rate limited, so I urge anyone polling to be aware of this and poll less rather than more. Obviously only poll when the application is actively used by the user, and only poll the playlist if it's actively viewed. You know you're being rate limited if you retrieve a 429 Too Many Requests response.

Soundcloud API Download

I am asking this here because Soundcloud does not have support. I going to build a website that people can purchase audio files from using Soundcloud to download the files (and stream before buy). I want to be able to access the download file link in the Soundcloud API without the download link being enabled and showing on the Soundcloud UI. I can't seem to find this info in the Soundcloud API docs. I am going to have a Paypal redirect after the payment to the download link. I know this is a weird way of doing this but I have certain criteria I have to meet. I would host the audio files on my server but they are huge. Anyone have experience with this or can help?
im not sure its possible to do what you want. (very easily at least)
there would be no way for the purchaser to access the 'download' track on soundcloud directly unless downloads are specifically enabled for that track.
really the only way to not host the files and still be able to provide the download would be to use the api to download or proxy the track from soundcloud to your server, using your credentials (because you always have access to your own tracks, download or stream). mind you this would use 2x the bandwidth usage (the server getting the track from soundcloud, and the client downloading the track), and storage space would only be impacked on a temporary bases. but. this is a pretty hacky way and not really a good/proper solution.
you can:
-compress/re-encode the audio as to not use as much disk space
-pay for more storage space at your web host, its usually pretty cheap thse days.
So you want to charge on something free? Well, I think all the downloader out there are middleware where they stream the track from soundcloud and response to client as attachment upon request, one of many examples is http://wittysound.com. Cheapest way to get thing done is providing direct link to soundcloud server like what http://soundflush.com does

Simplest way for getting my own playlists from Spotify API?

What I want to accomplish:
Display all my Spotify playlist on my website and let my visitors play the songs.
From what I've understood, I need to use the Spotify Web API to accomplish that, so I registered an app and received a Client Id and a Client Secret.
All the examples I've seen on https://developer.spotify.com/web-api/code-examples/ are pretty advanced for a newbie like myself and they all seem to require stuff like node.js or Composer etc. which I can't install since I'm on a shared hosting service.
What's the easiest way to show my playlists on my website?
Thanks!
Ensure all your playlists are publicly available (users other than you can't read your private playlists) and call the following endpoint — everything you need to know is documented:
https://developer.spotify.com/web-api/get-list-users-playlists/