DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2009-05-04 14:01:00

nyunyu
Member
Registered: 2009-05-03
Posts: 44
Website

Can anyone translate/compile this into ffp package?

Can someone translate this into fun plug package?
I know there is already transmission, mldonkey etc but I need something that can automate searches and downloads.

I think this code can be further developed.
Please be aware that this is the code of 4 years back (2005/2006) when I'm active in anime scene.


autodownload.sh

Code:

#!/bin/sh
cd /root/torrent
LYNX=/usr/bin/lynx
TIDY=/usr/local/bin/tidy
URLDECODE=/usr/bin/urldecode
PERL=/usr/local/bin/perl
GREP=/bin/grep
PRINTF=/usr/bin/printf
WGET=/usr/bin/wget
SORT=/bin/sort
SED=/bin/sed
SENDMAIL=/usr/sbin/sendmail

$LYNX -source "http://www.animesuki.com/" | $TIDY -q -f /dev/null | $URLDECODE | $PERL -ne 'print "$1\n" if /(http:.*torrent.*)"/' > torrent.list
$LYNX -source http://animeyuki.fansub-torrents.com/ | $TIDY -q -f /dev/null | $URLDECODE | $PERL -ne 'print "http://animeyuki.fansub-torrents.com/$1\n" if /"(.*torrent)"/' >> torrent.list
$LYNX -source http://www.animelab.com/anime.manga/bittorrent/new/ | $TIDY -q -f /dev/null | $URLDECODE | $PERL -ne 'print "http://www.animelab.com/anime.manga/bittorrent/new/ $1\n" if /(http:.*torrent.*)"/' >> torrent.list
$LYNX -source http://a.scarywater.net/ | $TIDY -q -f /dev/null | $URLDECODE | $PERL -ne 'print "http://a.scarywater.net/ $1\n" if /(http:.*torrent.*)"/' >> torrent.list
$LYNX -source "http://jasio.net/tracker/torrents-details.php" | $TIDY -q -f /dev/null | $URLDECODE | $PERL -ne 'print "$1\n" if /(http:.*torrent.*)"/' >> torrent.list
$LYNX -source "http://baka-updates.com/releases.php" | $TIDY -q -f /dev/null | $URLDECODE | $PERL -ne 'print "$1\n" if /(http:.*torrent.*)"/' >> torrent.list
$LYNX -source "http://shinsen-bt.dyndns.org/" | $TIDY -q -f /dev/null | $URLDECODE | $PERL -ne 'print "http://shinsen-bt.dyndns.org/ $1\n" if /(http:.*torrent.*)"/' >> torrent.list
$LYNX -source "http://www.animesuki.com/xml.php" | $TIDY -q -f /dev/null | $URLDECODE | $PERL -ne 'print "$1\n" if /(http:.*torrent.*)"/' >> torrent.list
$LYNX -source http://animecouncil.fansub-torrents.com/ | $TIDY -q -f /dev/null | $URLDECODE | $PERL -ne 'print "$1\n" if /(http:.*torrent.*)"/' >> torrent.list
$LYNX -source http://a.scarywater.net/lunar/ | $TIDY -q -f /dev/null | $URLDECODE | $PERL -ne 'print "$1\n" if /(http:.*torrent.*)"/' >> torrent.list
$LYNX -source http://bittorrent.shinsen-subs.org/ | $TIDY -q -f /dev/null | $URLDECODE | $PERL -ne 'print "$1\n" if /(http:.*torrent.*)"/' >> torrent.list
$LYNX -source http://a.scarywater.net/ | $TIDY -q -f /dev/null | $URLDECODE | $PERL -ne 'print "$1\n" if /(http:.*torrent.*)"/' >> torrent.list
$LYNX -source http://tracker.mahou.org/torrents/ | $TIDY -q -f /dev/null | $URLDECODE | $PERL -ne 'print "$1\n" if /(http:.*torrent.*)"/' >> torrent.list
$LYNX -source http://seed.eatshoe.com/torrents/ | $TIDY -q -f /dev/null | $URLDECODE | $PERL -ne 'print "$1\n" if /(http:.*torrent.*)"/' >> torrent.list
$PERL -i -pe 's/&/%26/' torrent.list
while read EPISODE ANIME; do
  NEXT=`expr $EPISODE + 1`
  NEXT=`$PRINTF %02d $NEXT`
  TORRENT=`$GREP -E -i "$ANIME.*$NEXT(.*(\[|\()|\.)" torrent.list | tail -1`
  if [ "$TORRENT" ]; then
    TORRENTNAME=`basename "$TORRENT" | $PERL -pe 's/(.*=)?(.*torrent)(\?.*)?/$2/g'`
    $WGET -O "$TORRENTNAME" "$TORRENT"
    FILENAME=`basename "$TORRENTNAME" .torrent`
cat <<MAIL | $SENDMAIL -t
To: webmaster@anime-resources.com
From: AR Torrent Fetcher 
Subject: Current anime being downloaded

Now downloading: $FILENAME
It will be available within several hours.

MAIL
    $PERL -i -pe "s/$EPISODE $ANIME/$NEXT $ANIME/" anime.dat
  fi
done < anime.dat
$SORT -o anime.dat anime.dat
rm torrent.list

check_torrent_download.sh

Code:

#!/bin/sh
cd /root/torrent
# echo "[`date`] Checking ..."

for i in *.torrent
do
  SIZE="`./torrentsize.py "$i"`"
  FILE="`basename "$i" .torrent`"
  if [ -f "$FILE" ]; then 
    DLSIZE=`/bin/ls -l "$FILE" | /bin/gawk '{print $5}'`
  else
    DLSIZE=`/bin/ls -lR "$FILE" | grep "^-" | /bin/gawk ' {  SUM = SUM + $5  }'END'{print SUM}'`
  fi
  # echo "$FILE $SIZE $DLSIZE"
  if [ $SIZE -eq $DLSIZE ]; then 
    /bin/rm "$i" # && echo "$FILE finish downloading"
    chown -R animer:animer "$FILE"
    mv "$FILE" ~animer/public_html/anime
  fi
done

#[ `/bin/ls *.torrent | /usr/bin/wc -l` -eq 0 ] && exit

torrentsize.py

Code:

#!/usr/bin/python

# Written by Henry 'Pi' James and Loring Holden
# modified for multitracker display by John Hoffman
# see LICENSE.txt for license information

from sys import *
from os.path import *
from sha import *
from BitTornado.bencode import *

NAME, EXT = splitext(basename(argv[0]))
VERSION = '20030621'

if len(argv) == 1:
    print '%s file1.torrent file2.torrent file3.torrent ...' % argv[0]
    print
    exit(2) # common exit code for syntax error

for metainfo_name in argv[1:]:
    metainfo_file = open(metainfo_name, 'rb')
    metainfo = bdecode(metainfo_file.read())
#    print metainfo
    info = metainfo['info']
    info_hash = sha(bencode(info))

    piece_length = info['piece length']
    if info.has_key('length'):
        # let's assume we just have a file
        file_length = info['length']
        name ='file size.....:'
    else:
        # let's assume we have a directory structure
        file_length = 0;
        for file in info['files']:
            path = ''
            for item in file['path']:
                if (path != ''):
                   path = path + "/"
                path = path + item
            file_length += file['length']
            name ='archive size..:'
    piece_number, last_piece_length = divmod(file_length, piece_length)
    print file_length

anime.dat (can be named whatever you want)

Code:

06 Peach
06 Xenosaga
07 Negi
07 Tactics
08 Air
08 Goddess
11 Tsukuyomi
12 Genshiken
123 Naruto
13 Hime
13 Yakitate
14 Piece
16 Tennis
18 Samurai7
19 Destiny
19 Gankutsou
20 Beck
20 Bleach
20 Fafner
22 Champloo
41 Monster

DNS323 + 2x1TB WD GREEN + Fun Plug 0.5 (Fonz) + Transmission 1.92 + Automatic 0.6 = GREAT!
Looking for Auto Direct Download script if possible smile

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB