Author Topic: Movies with a codec.exe virus, removal php script  (Read 5646 times)

Offline egandt

  • Decent Indexer
  • ***
  • Posts: 62
  • Helpful: +8/-0
Movies with a codec.exe virus, removal php script
« on: 2014-04-11, 03:29:01 PM »
I'm sure we are all aware of these releases and annoyed by them, I could not find a good always remove them in nZEBd, so I wrote a quick little php script to get rid of them based upon the files contents of the release (assuming you extract the contents of releases).

Code: [Select]
<?php
require_once(dirname(__FILE__)."/config.php");

use 
nzedb\db\DB;

# remove any release with the text file If_you_get_error.txt as it is crap
$junkmovies 'SELECT releaseid FROM `releasefiles` WHERE `name` LIKE "%If_you_get_error%";';
remove_junk_releases($junkmovies);

# Locate any releases with codec/setup as these are also crap
$junkmovies 'SELECT releaseid FROM `releasefiles` WHERE `name` LIKE "%Codec_Setup%";';
remove_junk_releases($junkmovies);

function 
remove_junk_releases($query) {
#print "$query\n";

        
$db = new DB();
        
$badreleases $db->Query($query);

        foreach (
$badreleases as $release) {
                
# clean up fileslist
                
$deletequerya sprintf('DELETE FROM `releasefiles` WHERE releaseid = %s;'$release['releaseid']); 
                
$db->Exec($deletequerya);

                
# next remove the actual junk release
                
$deletequeryb sprintf('DELETE from `releases` where id = %s;'$release['releaseid']);
                
$rows_deleted $db->Exec($deletequeryb);
        }
        echo 
"query removed " sizeof($badreleases) . " bad releases based on files present\n";
}

This gets every one of those annoying crap releases.  As I said I've found no good place to check in the fix, so I have it running as a cron job, but thought I'd share it in case others would like to use it.

ruhllatio

  • Guest
Re: Movies with a codec.exe virus, removal php script
« Reply #1 on: 2014-04-12, 04:01:02 PM »
Egandt,

I just found this.  Was working on exactly that, except it will be integrated into remove crap.  WMV is changing to codec and will include a very similar command... except it will also use the standard nZEDb delete routine.  So no extra scripting required.

ruhllatio

  • Guest
Re: Movies with a codec.exe virus, removal php script
« Reply #2 on: 2014-04-12, 04:22:59 PM »
Additionally, I would urge everyone NOT to use this script... as it can leave orphaned stuff behind (NZBs etc).  The removeCrap version will not.  Still, Thanks a bunch egandt.  Just pushed it to dev.

Offline gennavar

  • Prolific Indexer
  • ****
  • Posts: 215
  • Helpful: +9/-0
Re: Movies with a codec.exe virus, removal php script
« Reply #3 on: 2014-04-12, 10:53:37 PM »
I like the idea of moving the WMV code into a codec check instead - good move.
I've pulled back the latest Dev though and am getting this:

Offline gennavar

  • Prolific Indexer
  • ****
  • Posts: 215
  • Helpful: +9/-0
Re: Movies with a codec.exe virus, removal php script
« Reply #4 on: 2014-04-12, 11:05:45 PM »
Update: This only happens when run as "All" in the tmux settings. If you run as custom but with everything checked the sessions loops round through all types and the error doesn't appear.