简体   繁体   English

是否可以防止从网站下载视频

[英]Is it possible to protect from downloading a video from a site

Is it possible to protect a video from a site from being downloaded? 是否可以保护网站上的视频不被下载?

While users could record a video by using some hardware device, it should not be possible to download a video using some link - exactly like google videos. 虽然用户可以使用某些硬件设备录制视频,但不应该使用某些链接下载视频 - 就像谷歌视频一样。

For example, if I have Real One Player in my system, I have an option to download the video; 例如,如果我的系统中有Real One Player,我可以选择下载视频; this should be restricted. 这应该受到限制。

Yes. 是。 Never ever show it to anyone. 永远不要向任何人展示它。 As soon as you do, all bets are off (for less paranoid answer, see last paragraph). 一旦你这样做,所有的赌注都会被取消(对于不那么偏执的回答,见最后一段)。

This is the common problem with copy protection: you are unable, by any means, to distinguish between a legitimate user and an adversary (as they may even be the same person). 这是复制保护的常见问题:您无法以任何方式区分合法用户和对手(因为他们甚至可能是同一个人)。

Edit: re "my users can able to watch the video. but they must not be able to download that video" Let's try and disassemble this: 编辑:“我的用户可以观看视频。但他们一定无法下载该视频”让我们尝试反汇编:

  • the user clicks the mouse on your player's "Play" button 用户在播放器的“播放”按钮上单击鼠标
  • the click goes through the computer's OS to your player 点击通过计算机的操作系统进入播放器
  • the player sends a request through the network "send me teh videos" to your server 播放器通过网络向您的服务器发送“向我发送视频”的请求
  • (this, by definition, requires that the request goes through the whatever networking stack the user's computer has) (根据定义,这要求请求通过用户计算机所具有的任何网络堆栈)
  • the server, if it decides that it's a legitimate player, begins sending data to the user's computer. 如果服务器确定它是合法的播放器,则开始向用户的计算机发送数据。
  • (this, also by definition, means, that the user's computer is "downloading" the data) (这也是定义,表示用户的计算机正在“下载”数据)
  • *the data comes through the network into the computer (although capturing the data at this stage is more practical for the NSA than for a user) *数据通过网络进入计算机(尽管在此阶段捕获数据对NSA而言比对用户更实用)
  • *the OS handles the lower data layers (ie "this is a data packet, from $yourserver to me, and should be passed on to $yourapp") *操作系统处理较低的数据层(即“这是一个数据包,从你的$ yourserver到我,应该传递给$ yourapp”)
  • *the OS passes the data to the app that requested it *操作系统将数据传递给请求它的应用程序
  • the player receives the data 玩家接收数据
  • *the player transforms the data into a sequence of images (aka a video) and a sound track *播放器将数据转换为图像序列(也称为视频)和声道
  • *the player sends the images to the OS's display subsystem, or saves it to disk *播放器将图像发送到OS的显示子系统,或将其保存到磁盘
  • *the display system transforms the images into a format the screen understands *显示系统将图像转换为屏幕可识别的格式
  • *the images flow through a cable into the screen *图像通过电缆流入屏幕
  • *the images are displayed on the screen (at which point they exit the computer in form of light) *图像显示在屏幕上(此时它们以光的形式退出计算机)
  • the light reaches the user's eyes 光线照射到用户的眼睛

Your video can be intercepted (and/or modified) at every point marked with * (although quality of the copy may decrease, esp. when capturing the analog output). 您可以在标有*的每个点截取(和/或修改)您的视频(尽管副本的质量可能会降低,尤其是在捕获模拟输出时)。 Unless you can somehow eliminate each and every of those (good luck with the last one), all you can do is make the data capture/transform more complex. 除非你能以某种方式消除每一个(祝你最后一个好运),你所能做的就是让数据捕获/转换变得更加复杂。 There's a whole industry built around these "weak points" (google "stream ripping" to see for yourself). 围绕这些“弱点”构建了一个完整的行业(google“stream ripping”为自己看)。

You can complicate the capture with various DRM technologies, but in the end, the data stream must become analog video and analog audio (aka light and sound) somewhere. 您可以使用各种DRM技术使捕获变得复杂,但最终,数据流必须在某处变为模拟视频和模拟音频(即光和声音)。

However , if you don't care that a determined user will bypass your protection, and if it's enough to protect the video from 90% of users, I believe the Real formats that you mentioned do have some flag "don't allow save". 但是 ,如果您不关心确定的用户是否会绕过您的保护,并且如果它足以保护视频免受90%的用户影响,我相信您提到的Real格式会有一些标记“不允许保存” 。 This will disable the "save as" option in the player (ie the "or saves it to disk" option above); 这将禁用播放器中的“另存为”选项(即上面的“或将其保存到磁盘”选项); for most users, this will be a significant enough barrier. 对于大多数用户来说,这将是一个非常重要的障碍。 Anything more will probably inconvenience and anger 100% of your users, while not providing significantly more protection. 任何更多可能会给您的用户带来不便和愤怒,同时不会提供更多的保护。

If the user's eyes can see the video, the user's recording device can also see the video. 如果用户的眼睛可以看到视频,则用户的录制设备也可以看到视频。 There is not now, and never will be, a way to prevent users from recording content which they are viewing/listening to. 现在并且永远不会有一种阻止用户记录他们正在观看/收听的内容的方法。 It is an unsolvable problem. 这是一个无法解决的问题。

If users can "watch" a video, they can always find a way to save it to disk. 如果用户可以“观看”视频,他们总能找到将其保存到磁盘的方法。 You could watermark a copyright message over your videos but I am afraid that's about it. 您可以在您的视频上为版权信息添加水印,但我担心这是关于它的。

It is impossible to prevent a video from being downloaded. 无法阻止下载视频。 For the video to be displayed on the screen, the bits that make up the video must be transmitted to the users pc - which you have no control over. 对于要在屏幕上显示的视频,组成视频的位必须传输到用户电脑 - 您无法控制。

All you can do is make it difficult. 你所能做的就是让它变得困难。

For example, use css to display a transparent image over the video so to make it hard to right-click the video and view its properties (Flickr do with with pictures). 例如,使用css在视频上显示透明图像,这样就很难右键单击视频并查看其属性(Flickr可以处理图片)。

Or use obfuscated html/javascript to make it hard for a user to do View->Source. 或者使用混淆的html / javascript使用户很难进行View-> Source。 But a sufficiently determined user could unobfuscate it, and you can't disable View->Source because you don't own the user's pc. 但是,一个充分确定的用户可以对其进行解混,并且您无法禁用View-> Source,因为您不拥有该用户的PC。

You could go further and use a custom (secret) video file format and brower plugin, or use a seperate realmedia-style playback client. 您可以更进一步使用自定义(秘密)视频文件格式和浏览器插件,或使用单独的realmedia风格播放客户端。 These are likely to annoy your users, though, and doesn't stop someone from reverse-engineering your protocol/format and writing their own client to impersonate the browser and save the video in a standard format. 但是,这些可能会惹恼您的用户,并且不会阻止某人对您的协议/格式进行逆向工程并编写自己的客户端来模拟浏览器并以标准格式保存视频。

I don't advocate doing any of the above! 我不提倡做以上任何一项!

Bottom line: you have to send the bits to the user's pc, and once you do that you lose all control over them. 底线:你必须将这些位发送到用户的电脑上,一旦你这样做,你将失去对它们的所有控制权。

@Fero @Fero

Instead of Putting Your video in web site, Setup Remote Desktop in your Home Computer. 您可以在家用电脑中安装远程桌面 ,而不是将视频放入网站。

Open Login account for each users manually, and Let users login, 手动为每个用户打开登录帐户,并让用户登录,

And Let the users watch your movies through it , and 并让用户通过它观看您的电影

You can also monitor them one by one too, without sleeping. 你也可以一个接一个地监视它们,而不是睡觉。

May be thats the way to go! 可能就是这样!

To be upfront, nothing is bulletproof. 要提前,没有什么是防弹的。 For every protective measure developed, someone has found a way to defeat it. 对于所开发的每一项保护措施,有人找到了打败它的方法。 However, you can take some steps to stop (or at least slow down) the casual user. 但是,您可以采取一些措施来阻止(或至少减慢)临时用户。

The Real Networks platform offers quite a few options for protecting content, the safest of which is generally streaming it live or on-demand. Real Networks平台提供了很多用于保护内容的选项,其中最安全的通常是实时或按需流式传输。

In order to give you specific directions, we'll need more information, though. 为了给您提供具体的指示,我们需要更多信息。 You mention that Real One Player is giving a 'save' option. 你提到Real One Player正在提供一个“保存”选项。 It can play several formats. 它可以播放多种格式。 What type of file are you posting (Real, WMV, etc) and how is it currently being served (link, embed, stream). 您发布了什么类型的文件(Real,WMV等)以及当前如何提供(链接,嵌入,流)。

It is impossible to effectively stop a user from saving your video one way or another. 无法有效阻止用户以某种方式保存您的视频。 A desperate one might actually record the entire screen content while it is being played. 绝望的人实际上可能会在播放时记录整个屏幕内容。

Fero, this is a subject that a lot of big entertainment corporations are facing it everyday. Fero,这是许多大型娱乐公司每天都面临的主题。 "But how can I stop people copying my stuff"? “但我怎么能阻止人们复制我的东西”?

You can difficult it, but as you difficult people watching, people are less inclined to use your system unless you give the most important information they have ever seen. 你可能很难,但是当你看到困难的人时,除非你提供他们所见过的最重要的信息,否则人们不太愿意使用你的系统。 If a login barrier is a concern, imagine forcing people to use Real Player. 如果登录障碍是一个问题,想象一下强迫人们使用Real Player。

Trying to make your videos famous and relevant are better than try to encrypt at any costs before they are important. 试图使您的视频着名和相关,比在重要之前尝试加密任何成本更好。

You can protect video from downloading if you are using html5 video. 如果您使用的是html5视频,则可以保护视频不被下载。

Here is an opensource script which you can try and there is no way to bypass it for now : http://sourceforge.net/projects/defaprotecthtml5videodownload/ 这是一个您可以尝试的开源脚本,目前无法绕过它: http//sourceforge.net/projects/defaprotecthtml5videodownload/

It is using way of special algorithm which doesn't send you a original video files but sending files with rules so it can stop your video from downloading 它使用特殊算法的方式,它不向您发送原始视频文件,但发送带有规则的文件,以便它可以阻止您的视频下载

   //test.php
 <video controls src="your/path/1502139559.mp4"></video>
    <?php

      if (session_id() == '') {
       session_start();
      }
      error_reporting(0);
      $out2 = ob_get_contents();
      if (strpos($out2, "<video") || strpos($out2, "<audio") || strpos($out2, "<source")) {
       ob_clean();
       if (strpos($out2, "<safe") == false) {
        $window = md5(time());
        $_SESSION['window'] = $window;

        ?>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" >
        <script>
         jQuery.ajax({
          type: "POST",
          url: "/enable.php",
         });


        </script>



        <?php

        if (strpos($out2, "<safe") !== false) {
         $_SESSION['safe'] = "SAFE";
        }

        function getURL($matches) {
         global $rootURL;
         if ($_SESSION['defat'] == "") {
          $_SESSION['defat'] = 1;
         } else {
          $_SESSION['defat'] = $_SESSION['defat'] + 1;
         }
         $_SESSION['x' . $matches['2'] . $_SESSION['defat']] = 0;
         $_SESSION['defa' . $matches['2'] . $_SESSION['defat']] = md5(time() . "Defa Protector");
         $_SESSION['imdefa' . $_SESSION['defat']] = md5('Defa') . base64_encode(base64_encode($matches['2']));
         $_SESSION['x' . $matches['2']] = 0;
         $_SESSION['defa' . $matches['2']] = md5(time() . "Defa Protector");
         $_SESSION['file' . $_SESSION['defat']] = md5('Defa') . base64_encode(base64_encode($matches['2']));
         return $matches[1] . $rootURL . "defavid.php?window=" . $_SESSION['window'] . "&defat=" . $_SESSION['defat'];

        }

        $mes = preg_replace_callback("/(<video[^>]*src *= *[\"']?)([^\"']*)/i", getURL, $out2);
        $mes = preg_replace_callback("/(<source[^>]*src *= *[\"']?)([^\"']*)/i", getURL, $mes);
        $mes = preg_replace_callback("/(<audio[^>]*src *= *[\"']?)([^\"']*)/i", getURL, $mes);
        echo $mes;
       } else {
        echo $out2;
       }
      }

    ?>
    //defavid.php
    <?php

      ob_start();
      if (session_id() == '') {
       session_start();
      }
      $window = addslashes(strip_tags($_GET['window']));
      $md5defa = md5('Defa');
      $t = (int) $_GET['defat'];
      $filedefa = str_replace($md5defa, '', $_SESSION['file' . $t]);
      $file = str_replace("https://", "http://", base64_decode(base64_decode($filedefa)));
      $defa = str_replace("https://", "http://", base64_decode(base64_decode($filedefa)));
      $defaurl = get_headers($file, 1);
      $url = $defaurl["Location"];
      if ($url != $file && $url != "") {
       $file = $url;
      }
      if (!function_exists('http_response_code')) {

       function http_response_code($newcode = NULL) {
        static $code = 200;
        if ($newcode !== NULL) {
         header('X-PHP-Response-Code: ' . $newcode, true, $newcode);
         if (!headers_sent())
          $code = $newcode;
        }
        return $code;

       }

      }
      $header = http_response_code();
      $header2 = getallheaders();

      function isMobile() {
       return preg_match("/(MSIE|Edge|android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"]);

      }

      if (isset($_SESSION['jsenable' . $window])) {
       if ($header == 200 && $header2['Accept'] != "" && $_SESSION['x' . $defa . $t] == 0 && isMobile() || isset($_SERVER['HTTP_RANGE'])) {

        $_SESSION['x' . $defa . $t] = $_SESSION['x' . $defa . $t] + 1;
        if (isset($_SERVER['HTTP_RANGE'])) {
         $opts['http']['header'] = "Range: " . $_SERVER['HTTP_RANGE'];
        }
        $opts['http']['method'] = "HEAD";

        $conh = stream_context_create($opts);

        $opts['http']['method'] = "GET";

        $cong = stream_context_create($opts);

        $out[] = file_get_contents($file, false, $conh);

        $out[] = $http_response_header;

        ob_end_clean();

        array_map("header", $http_response_header);

        readfile($file, false, $cong);
        die();
       }
      }

    ?>
    //enable.php

    <?php
    if(session_id() == ''){
         session_start(); 
    }
    $window = $_SESSION['window'];
    $_SESSION['jsenable'.$window] = TRUE;
    ?>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM