Adult Script Pro Community Forums

Create, help and share your ideas with the community!

You are not logged in.

#1 2018-02-11 00:28:22

happylag
Member
Registered: 2016-04-05
Posts: 177

Anti leeching

Hello,

My site is using a lot of bandwidth for my small traffic. I'm wondering if i can stop people from leeching my video?

In nginx config i have:

location ~* ^.+\.(jpg|gif|ico|css|js|png|avi|wmv|mp4|mpg|mpeg|xls|doc|rar|iso|tgz)$ {
        expires 7d;
        valid_referers none blocked domain.com media.domain.com etc...


I'm using streaming method = Progressive.

And File Access: File Secure = Yes

I heard i need to use pseudostreaming with nginx so i need to set up nginx conf.

1) Do i need to set it up on script server or on media server?
2) In Streaming URL should i put http://www.mydomain.com/ or http://media.mydomain.com ?
3) What should i put in Secure Key?

Thanks for your help.

Last edited by happylag (2018-02-11 11:16:46)

Online

#2 2018-02-12 17:35:37

symtab
Administrator
Registered: 2010-08-23
Posts: 7,462
Website

Re: Anti leeching

1) you need to setup nginx pseudostreaming with secure link enabled on the media server
2) the media server url, urls like this http://media.mydomain.com/media/videos/mp4/video_id.mp4 should be valid (these will be protected by secure link, but before enabling secure link these urls should work)
3) whatever you want for password, make sure you add the same in nginx config

referer is also good


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#3 2018-02-13 10:55:04

happylag
Member
Registered: 2016-04-05
Posts: 177

Re: Anti leeching

4) On the media server, other than nginx, which modules need to be installed?
5) In the nginx.txt file it has include global/restrictions.conf; But if i include it in my conf it doesn't work because it can't find the file.
6) In nginx.txt file it has location /file/ {
        rewrite ^/file/([0-9]+)/([0-9]+)/([^/]*)/([0-9]+)/(.*)$ /file.php?id=$1&server=$2&hash=$3&expire=$4&file=$5 last;
    }
But there is no file.php in the media server. It is on the script server. Should i transfer this file on the root of the media server?
7) Do i need to change anything in the config of script server nginx conf?
8) How to check if Nginx pseudostreaming is working and i'm not still on Progressive? Because I have still the same bandwidth usage.

Thank you.

Last edited by happylag (2018-02-13 11:05:18)

Online

#4 2018-02-15 15:07:38

symtab
Administrator
Registered: 2010-08-23
Posts: 7,462
Website

Re: Anti leeching

4) its recommended that you use nginx, its the easiest to configure, you could however use apache, but you need to install these modules and settings: http://forum.adultscriptpro.com/viewtopic.php?id=1896 (please note that these settings might be influenced by other apache config settings and might not work as expected)
5)  you can create that configuration file if you want or just copy the contents (these rules will add another layer of security), its just a example on how i configure the servers
6) no the media server you dont need any rules
7) you need to edit the download.php file on the media server and set the secret word + nginx stuff
8) if fast forward works in the player this means that pseudostreaming is working


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#5 2018-02-15 20:06:32

happylag
Member
Registered: 2016-04-05
Posts: 177

Re: Anti leeching

9) What should i put as Secure Prefix ( where is it set in nginx conf ? ). It force me to put Something in Video - Servers - Manage - Edit - Secure Prefix.
10) Could you please give me the content of include global/restrictions.conf; ? Because i can't find it anywhere in the script zip.

I setup the nginx correctly ( When typing "nginx- V" i get "--with-http_secure_link_module" and nginx conf is setup ) and setup the Streaming Properties correctly in Video - Servers - Manage - Edit.

If I remove this code from the nginx config:

if ($secure_link = "") {
            return 403;
        }

The videos are loading fine but i think it's still in progressive because it works whatever the secure key i use ( even if nginx conf secure key is different from ASP Secure Key Settings ). If i readd the code above, the videos go to 403.

Thank you.

Last edited by happylag (2018-02-16 12:11:05)

Online

#6 2018-02-19 14:07:45

symtab
Administrator
Registered: 2010-08-23
Posts: 7,462
Website

Re: Anti leeching

9) anything you want, its only used if you use lighttpd
10) you can remove the line with global/restrictions.conf (its only stuff i use to configure servers, like deny .htaccess, caching stuff....)
So the pseudostreaming part is handled by the nginx_h264_mobile and the anti-hotlinking part is handled by the secure_link module. If you get 403 forbidden when you try to access the videos, then make sure the key in nginx.conf is the one you've set in admin.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#7 2018-02-19 16:16:43

happylag
Member
Registered: 2016-04-05
Posts: 177

Re: Anti leeching

11) I can't find nginx_h264_mobile module on my server or on google. Do you mean --with-http_mp4_module?
12) Do i just need to type "nginx -V" command and check if I have --with-http_mp4_module and --with-http_secure_link_module installed?

Online

#8 2018-02-24 14:53:51

symtab
Administrator
Registered: 2010-08-23
Posts: 7,462
Website

Re: Anti leeching

1. yes sorry, its --with-http_mp4_module
2. yes


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#9 2018-02-26 14:30:22

happylag
Member
Registered: 2016-04-05
Posts: 177

Re: Anti leeching

- In my media server I typed "nginx -V" and --with-http_mp4_module --with-http_secure_link_module are showing.
- In Admin - Videos - Server - Manage - Streaming Properties I set:

Streaming Method: Pseudostreaming
Streaming Server: Nginx
Streaming URL: http://media.mydomain.com
Streaming Secure: Yes
Secure Prefix: Whatever
Secure Key: MyPassword

- In media server nginx config i set ( i only have mp4 videos files ):

location ~ \.mp4$ {
        secure_link $arg_st,$arg_e;
        secure_link_md5 MyPassword$uri$arg_e$remote_addr;

        if ($secure_link = "") {
            return 403;
        }

        if ($secure_link = "0") {
            return 403;
        }

        mp4;
        mp4_buffer_size     1m;
        mp4_max_buffer_size 5m;

- I restart nginx in the media server and go to my site. The video urls are correct but they goes to 403 error.

I setup everything correctly but i still get errors.

Online

#10 2018-02-28 19:46:34

symtab
Administrator
Registered: 2010-08-23
Posts: 7,462
Website

Re: Anti leeching

Check if there is a time difference between the 2 servers...if the time diference is more than 2 hours...the url might actually be considered expired on the media server...


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#11 2018-03-01 15:55:03

happylag
Member
Registered: 2016-04-05
Posts: 177

Re: Anti leeching

Both script and media servers have the same time.

Online

#12 2018-03-02 14:17:13

symtab
Administrator
Registered: 2010-08-23
Posts: 7,462
Website

Re: Anti leeching

Email me access to both servers and i will check!


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#13 2018-03-04 13:40:56

happylag
Member
Registered: 2016-04-05
Posts: 177

Re: Anti leeching

symtab wrote:

Email me access to both servers and i will check!

Email sent.

Thank you.

Online

Board footer

Powered by FluxBB