Add copyright protection to tagged topics

Hello,

Many of our Member have quality topics, blog articles etc… Unfortunately others steal these (and make it public other sites as their own without any source) even if the author says clearly. “I only write it to this site please don’t steal it…If you want to use this content please contact me before.” We had to do something because our authors are simply discouraged from creating new quality contents. We don’t want to make the forum closed (private) because many visitor read these contents from outside the forum.

We know this is the internet and there is not a 100% solution to copyright content but we can make it harder or make it less easy to steal these contents. I know this looks like waste of time but many stealer give it up if a simple text selection and copy is not working.

What we do is use a copy-protected tag and reuse this Disable right click on image lightbox - #7 by awesomerobot

We add an option to every member to add a #copy-protected tag to the topics.
This tag has some features:

  • it disable right click (on the whole first post OP content .cooked class)
  • it disable copy and cut (on the whole first post OP content .cooked class)
  • for anons (non-registered visitors) it disable text selection (on the whole first post OP content .cooked class)
  • it add a copyright-protected note above the topic title section

1. Here is the code we use for this in header. When authors add copyright tag to the topic it will activate.

<script type="text/discourse-plugin" version="0.8">
const TopicRoute = require("discourse/routes/topic").default;

TopicRoute.reopen({
  activate: function() {
    this._super();
    Em.run.next(function() {
      // Disable right click
      $('.tag-copy-protected #post_1 .cooked').on('contextmenu', function(e) { return false; });
      // Disable copy and cut
      $('.tag-copy-protected #post_1 .cooked').bind('cut copy', function (e) { e.preventDefault(); });
    });
  }
});
</script>

2. For anons (non-registered visitors) we use an extra layer, disable text selection. We use CSS for this on common.

.anon {
  .tag-copy-protected {
    #post_1 .cooked {
      -webkit-user-select: none;
      -khtml-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      -o-user-select: none;
      user-select: none;
    }
  }
}

3. We add a little red notice above the topic title section too. Which says This content has been copyright-protected by the author!

.tag-copy-protected #topic-title .title-wrapper {
  &:before {
    content: 'This content has been copyright-protected by the author!';
    color: #e40202;
  }
}

4. We use the prevent anons from downloading files site setting to only the Members can download files.


This is what we did to handle this problem. Our authors are happy with this solution and that we care about and appreciate them. :slightly_smiling_face: :heart: I hope this will help a bit and brings the expected result. :crossed_fingers:

17 Likes

Nice work!

Sounds like a great opportunity to package this up in a Theme Component?

4 Likes

Thanks Robert! :slightly_smiling_face:

Sure, a Theme Component is a great idea! I would be grateful if you could do it, of course if you want to and have some time for it :slightly_smiling_face:

3 Likes

I’d be delighted to help you. We can host and support it on Pavilion and I’ll give you and Awesomerobot credit as authors.

My current focus is on getting my plugins and TC’s Ember-CLI compability and a couple of bugs, but I can get to this next.

I’ll PM you for testing.

Perhaps we can add some settings at some point if switching things on and off is useful? Perhaps we can add a setting to select the specific tag etc.

There may be others who find this useful as a TC (@davidkingham ?)

6 Likes

It’s a great idea to have this as a TC for others to use, I really don’t need the extra features beyond the right click protection that I already have though.

2 Likes

It’s not working with me…

Can you clarify a little bit? I double checked this and works as expected. I will try to make a Theme Component from this so that will make it easier to use. :slightly_smiling_face:

1 Like

That would be greate; since im not using the default discourse theme; but it’s doesn’t work with me for both themes… component will be good idea… thanks!

1 Like

I changed the code and made a component from this. It was not so compatible with loading spinner hopefully it fix the issue. I think it broke when the body class list refresh.

I’ve added some settings.

Screenshot 2022-02-11 at 12.10.41


Here you can find this.

4 Likes

Works perfect, just the visitor can open the pictures/save it… but the rest working fine.

1 Like

There is a 3 dots on the video that users can download. I want to disable download - so view only… Fotografia: Como Aumentar a Percepção de Valor - Geral - Fotógrafos Online I have check the “prevent anons from downloading files” but this did not work… any ideas? @jaymf or others in the support channel? thank you much!

Hello,

Here is a quick and hacky solution to disable download on videos.

Paste this to Common / Header

Use this, if you want to disable only the download button from video controls.

<script type="text/discourse-plugin" version="0.8">
  api.decorateCooked(
    $elem => $elem.find('video').attr('controlsList', 'nodownload'),
    { id: 'disable-video-download-button' }
  );
</script>

Use this, if you want to disable download button from video controls and disable right click (context menu) on video. So it prevents the video download with right click or long tap (mobile) from context menu.

<script type="text/discourse-plugin" version="0.8">
  api.decorateCooked(
    $elem => $elem.find('video')
    // disable download button from controls
    .attr('controlsList', 'nodownload')
    // disable right click context menu
    .on('contextmenu', function(e) {
      e.preventDefault()
    }),
    { id: 'disable-video-download' }
  );
</script>
1 Like

How would that ever work? Technically videos must be downloaded before those can be shown, but even if the meaning is take away download button my iPhone and iPad will ask what I want to do when clicked a video: download (save as) or view.

You can also just grab the url from the network tab and throw it at wget.

This worked like a charm! Thank you very much! We’ll be locking premium content and this would work perfectly!

2 Likes