We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15716
    • 57 Posts
    Hello,

    I want to be able to protect videos from being downloaded via their direct path. I’ve got a progressive download player, using SimpleVideoShow snippet. I just want to be able to mask the location or prevent the downloading of the videos somehow (so they can only be played in the browser).

    Any ideas or thoughts?

    Thanks!
      • 27708 MODX Staff
      • 2,502 Posts
      Do a search on using .htaccess or apache redirect to disallow direct links to the file or you could use sessions to block this.

      Personally, I often check source so that I can view in an offline viewer because sometimes I want to watch it later or sometimes the viewpane that the designer chose is too small for my 600px high viewpane (1280X800 in Firefox with 4 toolbars).
        Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
        • 15716
        • 57 Posts
        I can prevent access to the folder, but I’m having trouble denying access to the direct path. So if someone does check the source, they can just type in the direct path and download the video...can’t let this happen. How can I mask the direct path or just prevent it all together?

        Thanks again!
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          There’s something in the .htaccess that can do that; I’m not real sure, but it has to do with specifying the directory then using "deny: all" or something like that. Try Google, or maybe somebody else knows more about that.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 27708 MODX Staff
            • 2,502 Posts
            Try this article:

            http://www.selfseo.com/story-18469.php

            I have seen this before, just replace the file type with those that you are using.

            According to the article modify and put this in your .htaccess file:
            RewriteEngine on
            RewriteCond %{HTTP_REFERER} !^$
            RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
            RewriteRule \.(gif|jpg)$ - [F] 
            
              Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
              • 27708 MODX Staff
              • 2,502 Posts
              Quote from: ganeshXL at Apr 10, 2008, 11:11 AM

              This is silly. If they can watch the video online, it will end up in the user’s browser cache. There’s nothing you can do to prevent that. Use real streaming instead of progressive download if you really want to prevent downloading the whole video.

              Sure, If you are using the site for paid content access that would be fine. But 99% of people won’t go into their cache for it. If you are trying to prevent theft or bandwidth stealing it is an easy way to go. Most streaming required some type of server side application logic to handle the HTTP stream. (I don’t know how to so I don’t suggest it; just being honest).
                Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
                • 15716
                • 57 Posts
                Thanks for all the feedback. I was just wondering if a simple solution existed that would be painless to implement. I’ll give the htaccess a go, but my previous attempts have failed.

                Thanks again!
                  • 27708 MODX Staff
                  • 2,502 Posts
                  If you have MODx Friendly URLs working make sure this rule is above it or it may not work.
                    Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
                    • 15716
                    • 57 Posts
                    The .htaccess doesn’t work because the media no longer downloads. Nothing loads. All the images on the page still load, but the movie inside the player will not load...

                    Here is what I think is the only problem holding me back: I think that the PLAYER is being recognized as a hot-linking source and therefore will not allow it to load the video. It sources the video by using a full address (http://www....video.wmv). I’m not sure how to bypass this.

                    I could be dumb and crazy (obviously).

                    Thanks for all the help!