FLV Hotlink Protection

Discussion in 'General Business' started by muncle, Mar 23, 2009.

  1. #1
    I’ve had several of my hosted .flv videos hotlinked from a Chinese website and it’s eating up bandwidth and dragging my server down like crazy. Is there any reliable, stable solution to protect hotlinking of .flv videos? Any scripts (will buy if it’s a good, established solution)? Or is there a chance to have .htaccess modified to reliably prevent .flv hotlinking?
     
    muncle, Mar 23, 2009 IP
  2. loop

    loop Active Member

    Messages:
    519
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    90
    #2
    you can disable sites whit .htaccess but they always can use proxy sites.

    So best for you to use some of free tube scripts that already have PHP base hotlink protection.
     
    loop, Mar 23, 2009 IP
  3. Dollar

    Dollar Active Member

    Messages:
    2,598
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    90
    #3
    Well you could just block China in your firewall and problem solved, unless your targeting these demographic of people
     
    Dollar, Mar 23, 2009 IP
  4. thefandango

    thefandango Active Member

    Messages:
    787
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    58
    #4
    Just block China and indeed half the world that only causes problems and contributes nothing to the internet community.
     
    thefandango, Mar 23, 2009 IP
  5. joep1978

    joep1978 Peon

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Move the FLVs into a non-web accessible directory (or add a .htaccess file blocking it from external access)
    Next wrap the FLV output in PHP doing something like:-

    <?php
    $filename="/path/to/your/file.flv";
    $yourdomain = "yourdomain.com";
    if (stristr($yourdomain, $_SERVER["HTTP_REFERER"]) || $_SERVER["HTTP_REFERER"]=="")
    {
    header("Content-type: video/flv");
    echo file_get_contents($filename);
    }
    else
    die ("You are not allowed to access this file");
    ?>

    Then point the FLV player SWF at the PHP file instead of the FLV file.

    If you want to do pseudo streaming you'll need to use something like xmoov.com (free) but that requires using yamdi (also free) to inject metadata into your FLV files.

    HTH
     
    joep1978, Mar 23, 2009 IP
  6. symbol.software

    symbol.software Member

    Messages:
    138
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    48
    #6
    Great post ! Thank you.
     
    symbol.software, May 28, 2009 IP