obfuscating video url / video link - php

Is there any way from which i can obfuscate my video url or video link ? I am embedding video in <video> of html 5. I have disabled right click of the page using jquery. But still user can download video thru download manager. I want to restrict it. How can i do it?
My website is in Opencart 2

If the user can view the video, you CAN'T restrict the download.
As a side note, any attempts to restrict user access to elements that he/she can see or interact are a waste of time, any savvy user will bypass them easily.

Related

Get Download Link from Google Generated URL

i've been stuck on this error for over some days now.
I have this app, that helps do some youtube conversion.
I am using Youtube DL for the conversion, and after that, it generates a unique api in the form
https://r17---sn-p5qlsnl7.googlevideo.com/videoplayback?key=yt6&gir=yes&expire=1506012043&mt=1505990314&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&pl=23&dur=727.741&lmt=1502263140756131&ip=54.147.55.117&ms=au&keepalive=yes&ei=K5fDWY3TFe6S8gSCjJnwBw&mv=u&source=youtube&id=o-AMxd1cK50iCKgEiy6DllYTFo-SeXUKSQ1fpmR3vdgsVa&mn=sn-p5qlsnl7&mm=31&signature=D5A495AD2061D93871BFDB91BF3843B061E5C73A.32EB5728DA132892E6CAA88581C77352DC6AC097&requiressl=yes&clen=10878177&itag=251&ipbits=0&mime=audio%2Fwebm&ratebypass=yes
The problem now is, the link above expires after 24 hours or less, and when i click on it, it takes me to a web browser with the media version, and when i click on download, it stores the file as videoplayback which at most cases does not play on using my pc's audio/video player.
How do i download the audio from the link directly, and also give it a unique name, instead of videoplayback..
Please help//

How to save a file in a hidden location php

I have to build an application where users can download videos from a site but cannot share them. My first solution is to save these files in a hidden location on the users computer since one of the requirements is that the user should be able to watch the downloaded videos offline.
Please how do I go about saving a file in a location the user cannot see using php.
Thanks.
One solution is to generate token for each request for a video. That token would have its lifetime. Php script should be serving the content instead of giving direct access to resource to user. The script should check if the token is still active before serving the content.
It is up to you how to pass the token. The simplest way is to make it contained in uri.
No matter where you put your videos in your directory structure, you always send the data as a partial request. Once data is acquired by the user, it could be saved an reproduced.
There are techniques, however, to protect your video from direct download through curl, wget or other ways of download. And this is using a secure token and an expiration, passed as parameters. This way your video download window will be limited and generating the token manually would be pretty hard.
Chidiebere Onwunyirigbo, its a Great Question. One solution for your requirement is Steganography. It is the process of concealing your data (videos) behind other files (multimedia files like image, audio, video), in your case preferable would be Image Steganography. It is quite a old technology but new to many, you can get several ready tools/code for it on the internet which you can customize as per your need. From your side you have to provide the file that is already embedded inside the image for download. Only the tool coded for retrieval and rendering the hidden video can render your video. So, for this part all the users of your site have to first download this desktop application from your site for viewing the video. This will keep your videos safe on the users computer offline, because every user who takes the video will require the reverse steganography tool to be downloaded from your site. You can even embed secret info like users IP inside the Stego image along with the video and for each tool download, associate user computer's IP with the tool. If IP embedded inside Stego image matches with that of tool only then you allow to play else redirect application to get it registered. But the limitation would be that, the users will have to download your application and will be able to view videos only on your desktop application which will render the Steganographed video.
You cannot hide information on the user computer. Even if your process are running on a windows comp as SYSTEM user, a power user can take ownership of the files.
The only solution you have, are developing or using a known DRM system, for allowing only playing the video on a determined computer or another specifications (for example, if the program have the authentication token of some user).
At any case, you need to do two things for this:
- You need a custom application to play the video, if you want to check DRM.
- You need to recode / modify something on the video before download, for adding on them a code for allow only play on the destination computer or data used for authenticating DRM.

How to embed video in website with html/php, so it can't be downloaded by visitor?

How can I embed a video in a website with html/php, so it can't be downloaded by a visitor? The visitor can just view the video but can't download it.
If you are trying to stop someone 'stealing' the video then at the end of the day you can't - if the video plays on the users browser then it has to pass from the server to the users machine and a malicious user can capture it one way or another.
If you mean that you just want to default action to be that the video plays back rather than downloads, then using the standard HTML5 tag in the default way will provide this behaviour.
Assuming it is the 'stealing' case you are worried about then DRM is the technology most often used to address this concern - this encrypts the video so that someone copying it will not be able to play it back without the correct key. How you manage the keys is obviously critical but most of the common DRM providers will have established ways to securely manage the keys. The technology is quite complex so using a hosted video service which supports DRM might be an approach to consider (e.g. https://support.brightcove.com/en/video-cloud/docs/content-protection-drm or http://corp.kaltura.com/Products/Features/DRM).
In your situation, right-click protection can make sense. This feature protects your video from unwanted downloads and works on any website. It blocks downloading on right mouse click and restricts accessing the file’s original source code. Optionaly, you can add a text or link to be shown on right mouse click that directs people to your website when they try to download your video. Learn more here

How to restrict access to paid videos?

I have a wordpress paid video site with the e-commerce plugin. User purchases a video, then gets shown a meta box with the video player code linking to the video (using flow player 3). How can I stop access to the paid video files to non-authorized users (if they decide to share the direct link to the video by looking at the source code)?
you need protect this content for that session (and ip), using some technique like security token.
http://code.google.com/p/mod-auth-token/
Here are a few plugins that might help you with your problem.
http://www.magicmembers.com/
http://wordpress.org/extend/plugins/membership/
http://www.memberwing.com/

Identify if user has watched a video

I am developing an application that requires a user to view a set of videos.
How can I identify if the user has watched a particular video(complete and incomplete)?
You could embed the video on a page on your website, so you can register it that way.
You could also put a URL at the end of the video that they must follow to register they've seen the video.
I hope that the answer is "you can't" if you're talking about having watched it directly from YouTube.
You can use php's session variables, and put each video on a different webpage. Then when one video ends it redirects to another webpage and adds a value to that session. Before each page is loaded the session checks to see if the user should be on that webpage like so:
session_start();
if($_SESSION['videos']=="whatever value"){ //check to see if the session equals what value it should
$_SESSION['videos'] = 'whatever value2'; //update the value for next webpage
}
else { //if session variable doesn't equal what it should, redirect to homepage
header("Location: http://www.example.com/");
and to figure out when the video ends, just set a timer to the exact length of the video. I think you can figure that out for yourself.
Ah youtube videos. I made a YouTube Client that could do exactly what your referring to. It was a Client side URL sniffer that checked various urls for the presence of a youtube video ID. It could detect when a video was watched embedded in a site and many other places where the video could be watched.
Unfortunately, Firefox has changed their JS Engine to disallow URL sniffers, so finding if youtube videos have been watched via javascript is now out of the question. Your last option might be to authenticate the user under their youtube account and check the History. Good Luck!

Categories