WDTV Forum - WDTV Media Player

WDTV 1 Forum Groups => Homebrew / Custom Firmware => Topic started by: ninja76 on June 10, 2009, 05:49:16 PM

Title: Add and browse torrents via OSD
Post by: ninja76 on June 10, 2009, 05:49:16 PM
New Version.  The old requirements still apply
Here is the next version.  With some major changes:
1. I removed the spaces from all the main directories to be more compatible.
2. The directory structure is now:
    TorrentTV
        - Active_Downloads
        - Completed
        - RSS_Feeds
                      - My_TV_RSS (or your custom feed)
                      - Allow for multiple feeds (Future improvement)
        - Whats_on_Tonight (Another future feature that will pull TV guide info)
3. Added a TorrentTV.conf file to /apps/TorrentTV/etc where you configure your RSS feed
4.  I would recommend removing everything from TorrentTV.  And run the init.d manually because for some reason it only runs on startup half the time...
5. Improved logging to messages.txt
http://www.mediafire.com/?31unmtd9vmc

------------------------------------------------------------------------------------------------------------------------
If there was ever a use at your own risk software this is it... Please read all requirements!
WDTV will need perl, perl-libwww and perl-libxml from optware
wget version (1.11.4-1)
Also will need to manually install XML-Simple
Updated XML-Simple Link
http://search.cpan.org/src/GRANTM/XML-Simple-2.18/lib/XML/Simple.pm

Thanks rezmus.  I forgot XML-Simple isn't in the libxml package.  
[/quote]


This app assumes the following directory structure:

/tmp/media/usb/TorrentTV
/tmp/media/usb/TorrentTV/00Completed
/tmp/media/usb/TorrentTV/00Active Torrents
(I know the 00 is not the best way but these are windows shares and windows doesn't like file names to start with a space)
This has only been tested with WDLXTV
I am using uTorrent but this should work with any torrent client that is configured to watch the 00Active Torrents directory and output to the 00Completed directory. Example if you currently use rtorrent on the WDTV just change its watch directories accordingly

Also the getrss.pl script is parsing a certain RSS feed so some tweaking will be required to work with whatever RSS feed you are using.  Again this could easily be modified to work with Usenet RSS feeds also
Also startup will be a little slower because the getrss.pl runs on init.d and depending on the size of the rss feed will effect your boot up.  So don't get worried if it stays longer on a blank screen with booting up

This is the first time I have released anything for public use so once again use at your own risk and don't blame me if it bricks your WDTV!  But enjoy and feel free to do with it as you want

Another also..  A big thanks to elm and LaurentG for there contribs which made this possible
Updated versionhttp://www.mediafire.com/?31unmtd9vmc
------------------------------------------------------------------------------------------------------

This is all possible thanks to the work of others on this board.
Ok here is what I have going on: I have uTorrent running on my Windows PC which is also serving NFS to the WDTV.  I have written a perl script that gets an TV RSS feed and creates a directory structure that makes it able to browse the torrents (works best in list mode).  Then using event-osd (thanks elm!) when you select a torrent the event script downloads the torrent and places it in uTorrent watch directory and off it goes!  I thought about just using rtorrent on the WDTV but I plan on having several WDTV around and I didn't want them all downloading plus if you already have box doing NFS why not just let it handle the DL.  Anyway,  I am working on making an app.bin but in the meantime here are some screenshots:

 
Title: Re: Add and browse torrents via OSD
Post by: elmarweber on June 10, 2009, 06:13:04 PM
Looks very good so far. I'm running Azureus on a home server and currently sitting down once a week to manually add my TV episodes because I haven't gotten around to search for a more comfortable solution. Doing this while kicking back in front of the WDTV sounds nice =)

A tip: I see you use 00 to show some folders first. If you use a spaces it is less noticeable and better to read.

ciao,
elm
Title: Re: Add and browse torrents via OSD
Post by: realtebo on June 10, 2009, 10:02:38 PM
I'm ready to test you planned .app.bin file and happy to read about this !

Please, go on, it's a very very very good idea. I'd like to 'mod' your work to add an RSS item to wchat FIFO file ... Can you post some code yet ?
Title: Re: Add and browse torrents via OSD
Post by: eliafino on June 10, 2009, 10:35:58 PM
Me too...
... this black box is wonderful!
Title: Re: Add and browse torrents via OSD
Post by: redindian on June 11, 2009, 01:52:46 AM
Nice work! Would be great to be able to add torrents with the OSD.
Title: Re: Add and browse torrents via OSD
Post by: dcrutgers on June 11, 2009, 05:35:19 AM
Very nice, cant wait to try it.
Title: Re: Add and browse torrents via OSD
Post by: dcrutgers on June 11, 2009, 06:22:35 AM
Can you add Newzbin RSS feed support to this? That would be awesome.. Same concept, download NZB to watch folder on PC..
Title: Re: Add and browse torrents via OSD
Post by: zaphod beeblebrox on June 11, 2009, 06:51:39 AM
great!! I opened a discussion about this several days ago and I am glad someone is reallly doing this!! Filtering the main tvrss/eztv/something else feed would be perfect.

With this application and something to see streaming video apart from appletrailers this macchine could become perfect... same features as the pop Corn Hour but less than half the price  ;D
Title: Re: Add and browse torrents via OSD
Post by: ninja76 on June 11, 2009, 08:12:40 AM
Glad to see interest in this.  I will try to get something ready for downloading tonight.

Since tvrss.net is down indefinitely I have started using Yahoo Pipes to create custom rss feeds from eztv.it  but looks like you can use Pipes for any type of data and create an RSS feed

http://pipes.yahoo.com/pipes/pipe.info?_id=5c5e909cb6011fd662b494fe608de4ee


Also this app should work with any "Smart" torrent client that is capable of watching directories
Title: Re: Add and browse torrents via OSD
Post by: dcrutgers on June 11, 2009, 08:38:16 AM
Awesome! Can't wait for this :)
Title: Re: Add and browse torrents via OSD
Post by: realtebo on June 11, 2009, 09:09:23 AM
I've just realized a similar thing for browse and add MIRC download via osd.

I'm not able (it's my first app) only to show the 'custom ok message' I see in your screenshot. I think you used event-osd... or not?
Title: Re: Add and browse torrents via OSD
Post by: rezmus on June 11, 2009, 09:27:45 AM
yep he used event-osd to triger which torrent should be added to queue and the msg box is modified cancel_messagebox.xml / inc_messagebox.xml displayed coz of empty dir. good work btw, wanted to do this for nzbget and rtorrent but i;m just to lazy ;)

edit: just saw ninja76 explained it in other thread.
Title: Re: Add and browse torrents via OSD
Post by: realtebo on June 11, 2009, 10:27:48 AM
Ho to modify and then restore the 2 messagebox?
Title: Re: Add and browse torrents via OSD
Post by: ninja76 on June 11, 2009, 06:43:11 PM
If there was ever a use at your own risk software this is it... Please read all requirements!
WDTV will need perl, perl-libwww and perl-libxml from optware
wget is also required and it is recommended to use in list mode
This app assumes the following directory structure:

/tmp/media/usb/TorrentTV
/tmp/media/usb/TorrentTV/00Completed
/tmp/media/usb/TorrentTV/00Active Torrents
(I know the 00 is not the best way but these are windows shares and windows doesn't like file names to start with a space)

I am using uTorrent but this should work with any torrent client that is configured to watch the 00Active Torrents directory and output to the 00Completed directory. Example if you currently use rtorrent on the WDTV just change its watch directories accordingly

Also the getrss.pl script is parsing a certain RSS feed so some tweaking will be required to work with whatever RSS feed you are using.  (Specifically it looks for XML tags "title" and "link") Again this could easily be modified to work with Usenet RSS feeds also
Also start up will be a little slower because the getrss.pl runs on init.d and depending on the size of the rss feed will effect your boot up.  So don't get worried if it stays longer on a blank screen with booting up

This is the first time I have released anything for public use so once again use at your own risk and don't blame me if it bricks your WDTV!  But enjoy and feel free to do with it as you want

Another also..  A big thanks to elm and LaurentG for there contribs which made this possible
http://www.mediafire.com/?ji2or0mmn3m
Title: Re: Add and browse torrents via OSD
Post by: dcrutgers on June 12, 2009, 04:48:24 AM
Awesome, can't wait to test this out! Thanks
Title: Re: Add and browse torrents via OSD
Post by: zaphod beeblebrox on June 12, 2009, 06:18:40 AM
Umm... I followed every step but I have one big trouble.. I am able to create the TorrentTV directory and subdirectories (even if in ftp the 00Active Torrents is shown only as 00Active ) but when I reboot there is no trace of them...

Have any of you the same problem? Maybe I have to change some permits in order to properly write into /tmp/media/usb ?

Thank in advance.. keep up the good work :-)
Title: Re: Add and browse torrents via OSD
Post by: ninja76 on June 12, 2009, 06:53:55 AM
It is because the getrss.pl script cleans out the old directories before fetching the new stuff but the script is coded not to remove directories that match either "00Active Torrents" or "00Completed".  So wherever these directories live must support special characters in their name (etc.. spaces).  If everything is setup correctly WDTV should see the full directory name at "00Active Torrents" in the /tmp/media/usb/TorrentTV directory.  Is it creating the directories for each torrent?
Title: Re: Add and browse torrents via OSD
Post by: ninja76 on June 12, 2009, 06:56:06 AM
Another important note:  This has only been tested on the WDTVLX I haven't tried it with ext3
Title: Re: Add and browse torrents via OSD
Post by: ninja76 on June 12, 2009, 07:04:06 AM
Umm... I followed every step but I have one big trouble.. I am able to create the TorrentTV directory and subdirectories (even if in ftp the 00Active Torrents is shown only as 00Active ) but when I reboot there is no trace of them...

Have any of you the same problem? Maybe I have to change some permits in order to properly write into /tmp/media/usb ?

Thank in advance.. keep up the good work :-)

Also try running the getrss.pl from the command line to see if it works instead of rebooting.   perl /apps/TorrentTV/bin/getrss.pl
Title: Re: Add and browse torrents via OSD
Post by: zaphod beeblebrox on June 12, 2009, 07:32:29 AM
Also try running the getrss.pl from the command line to see if it works instead of rebooting.   perl /apps/TorrentTV/bin/getrss.pl

Hese is the output:

# perl /apps/TorrentTV/bin/getrss.pl

Can't locate XML/Simple.pm in @INC (@INC contains: /opt/lib/perl5/5.10.0/mipsel-linux /opt/lib/perl5/5.10.0 /opt/lib/per                 
l5/site_perl/5.10.0/mipsel-linux /opt/lib/perl5/site_perl/5.10.0 .) at /apps/TorrentTV/bin/getrss.pl line 1.
BEGIN failed--compilation aborted at /apps/TorrentTV/bin/getrss.pl line 1.


I have ext3-boot.. So probably that's the reason it doesn't work.. Too bad.
I am really a newbie on all this so I have no idea if it will be easy to do a new release that works on ext3-boot.. In any case thanks for sharing :-)
Title: Re: Add and browse torrents via OSD
Post by: rezmus on June 12, 2009, 07:41:27 AM
Code: [Select]
mkdir -p /opt/lib/perl5/5.10.0/XML
wget -O /opt/lib/perl5/5.10.0/XML/Simple.pm http://search.cpan.org/src/GRANTM/XML-Simple-2.18/lib/XML/Simple.pm

edit: fixed link.
Title: Re: Add and browse torrents via OSD
Post by: ninja76 on June 12, 2009, 08:14:42 AM
Code: [Select]
mkdir -p /opt/lib/perl5/5.10.0/XML
wget -O /opt/lib/perl5/5.10.0/XML/Simple.pm http://search.cpan.org/dist/XML-Simple/lib/XML/Simple.pm

Thanks rezmus.  I forgot XML-Simple isn't in the libxml package. 
Title: Re: Add and browse torrents via OSD
Post by: ninja76 on June 12, 2009, 08:18:37 AM
I don't see any reason why it should not work with ext3-boot.  I would think as long as all the requirements are there it should be fine.  Only testing will tell!
Title: Re: Add and browse torrents via OSD
Post by: dcrutgers on June 12, 2009, 08:22:41 AM
I had to download simple.pm, and now it can find the module.. However, I'm getting errors like this:

# perl /apps/TorrentTV/bin/getrss.pl
Bareword found where operator expected at /opt/lib/perl5/5.10.0/XML/Simple.pm line 4, near ""stylesheet" href"
        (Missing operator before href?)
Bareword found where operator expected at /opt/lib/perl5/5.10.0/XML/Simple.pm line 4, near ""http://st.pimg.net/tucs/style.css" type"
        (Missing operator before type?)
Bareword found where operator expected at /opt/lib/perl5/5.10.0/XML/Simple.pm line 8, near "<title>XML::Simple"
        (Missing operator before XML::Simple?)
String found where operator expected at /opt/lib/perl5/5.10.0/XML/Simple.pm line 16, near "&middot; <a href=""
Title: Re: Add and browse torrents via OSD
Post by: ninja76 on June 12, 2009, 08:32:37 AM
I had to download simple.pm, and now it can find the module.. However, I'm getting errors like this:

# perl /apps/TorrentTV/bin/getrss.pl
Bareword found where operator expected at /opt/lib/perl5/5.10.0/XML/Simple.pm line 4, near ""stylesheet" href"
        (Missing operator before href?)
Bareword found where operator expected at /opt/lib/perl5/5.10.0/XML/Simple.pm line 4, near ""http://st.pimg.net/tucs/style.css" type"
        (Missing operator before type?)
Bareword found where operator expected at /opt/lib/perl5/5.10.0/XML/Simple.pm line 8, near "<title>XML::Simple"
        (Missing operator before XML::Simple?)
String found where operator expected at /opt/lib/perl5/5.10.0/XML/Simple.pm line 16, near "&middot; <a href=""


Looks like an issue with the Simple::XML

try creating another perl script with this single line:

use XML::Simple;

Then run it.  If XML-Simple is okay is should return nothing.  If it continues to display the same errors try to re-download XML-Simple.

I guess I should rewrite getrss.pl to just use XML-Parser which is included in libxml  Oh well live and learn.  I don't understand why XML-Simple would not be in libxml???

Thanks for testing!
Title: Re: Add and browse torrents via OSD
Post by: zaphod beeblebrox on June 12, 2009, 09:32:10 AM
@Ninja76

Nope.. I created the dir and update xml-simple.. then I tried to run perl script, even the last single command you wrote. It gives a very long output error similar to dcrutger's one.
Title: Re: Add and browse torrents via OSD
Post by: dcrutgers on June 12, 2009, 09:49:16 AM
Fixed:  The link that Rezmus provided was incorrect, use this link to download Simple.pm and it will work as advertised..

http://search.cpan.org/src/GRANTM/XML-Simple-2.18/lib/XML/Simple.pm

Also make sure your directories are created before running it.

Title: Re: Add and browse torrents via OSD
Post by: rezmus on June 12, 2009, 10:20:28 AM
yep, pasted wrong link (it was trac style file not .pm itself), fixed post.
Title: Re: Add and browse torrents via OSD
Post by: zaphod beeblebrox on June 12, 2009, 10:25:05 AM
ok.. simple.pm by dcrutgers works..

I got the directories and the subdirectories for the shows.. Still I was not able to create the 00Active Torrents directory. I did it manually through ftp, chose a tv show to download but i did not find the .torrent file in the 00Active torrents folder.

After reboot I cannot see the folders no more (probably because the wget command should be done after every reboot until new release comes?)

I can still see the shows folders in the tree (via ftp) but cannot open them..

Also: I fear that rtorrent.conf has some problem with the 00Active Torrents foledr name since when I try to force rtorrent to start from config file (screen rtorrent -n -o import=/opt/etc/rtorrent.conf) it gives me an error related to the string where 00Active torrents is written.

I hope I explained myself  :P
Title: Re: Add and browse torrents via OSD
Post by: dcrutgers on June 12, 2009, 11:32:02 AM
I had no problems viewing the directories, I see the torrent file as well. I was able to replicate that when the box is rebooted the folders are gone.  Hmm, I ran the script again and rebooted, the directories were not deleted this time..  Looks like we are good to go!
Title: Re: Add and browse torrents via OSD
Post by: ninja76 on June 12, 2009, 02:12:19 PM
Since I am not sure at what stage the getrss.pl is running at boot up.  I would recommend removing the getrss.pl from the TorrentTV/etc/init.d/ start up script and moving it to a cron job.  I think having it run once or twice a day is enough.

Thanks for the input!
Title: Re: Add and browse torrents via OSD
Post by: zaphod beeblebrox on June 12, 2009, 03:57:29 PM
umm.. No way.

Probably it's me, but I cannot make it work. I load the two perl script ("simple.pl" custom..made of one string [XML::Simple;], and "getrss.pl").. After that the "TorrentTV" folder start to grow and I see each directory ,one for each show.

Even the prompt from wdtv is correct, BUT the problem is 00Active Torrents is still empty and no .torrent inside.

After reboot I see no TorrentTV folder :-(

If anyone has tried this .app with ext3-boot with success, please tell :-)

Then there's the problem of rtorrent.. It seems to me that rtorrent.conf doesn't like at all 00Active Torrents name..
Title: Re: Add and browse torrents via OSD
Post by: rezmus on June 12, 2009, 08:58:19 PM
i gave it a try and works good. just add

Code: [Select]
mkdir -p "/tmp/media/usb/TorrentTV/00Active Torrents"
mkdir -p "/tmp/media/usb/TorrentTV/00Completed"

to /apps/TorrentTV/etc/init.d/S51TorrentTV before getrss.pl line to get dirs on boot

edit: there is also a mistake in file itself, should be #!/bin/sh instead of #/bin/sh (u need to change it coz script won;t start).

also u can change "00Active Torrents" to something else (00Active?), just edit /apps/TorrentTV/bin/getrss.pl and /apps/TorrentTV/bin/directory_changed.torrent.sh according to your needs.

btw: http://search.cpan.org/~zag/Net-RTorrent-0.06/lib/Net/RTorrent.pm
Title: Re: Add and browse torrents via OSD
Post by: zaphod beeblebrox on June 13, 2009, 04:18:44 AM
Thanks Ninja and Rezmus.. Something is still missing (at least for me)

I did all the thigs Rezmus told in his last post, but I got some errors:

1) at start i got TorrentTV folder but no show subfolders.. getrss don't start automatically, I suppose

2) if I start getrss manually I get some problems:

# perl /apps/TorrentTV/bin/getrss.pl
.
rm: cannot remove '.' or '..'
..
rm: cannot remove '.' or '..'

00Activetorrents

(mind that I removed the blank space on 00Active Torrents and changed the file accordingly, see above Rezmus post)

3) after this message nothing happens, but if I run perl command again, then torrents directories start to create..BUT! my 00Activetorrents folder is erased now  ???

4) after restart everyting is back again to 1) .. I got TorrentTvfolder + 00Completed + 00Activetorrents but no shows folders..

Hope it helps develope this amazing app..
Title: Re: Add and browse torrents via OSD
Post by: rezmus on June 13, 2009, 05:33:55 AM
Code: [Select]
cat /apps/TorrentTV/etc/init.d/S51TorrentTV >> /boot/torrenttv.log
cat /apps/TorrentTV/bin/directory_changed.torrent.sh >> /boot/torrenttv.log
cat /apps/TorrentTV/bin/getrss.pl >> /boot/torrenttv.log

and attach here torrenttv.log from your usb stick.
Title: Re: Add and browse torrents via OSD
Post by: ninja76 on June 13, 2009, 06:05:23 AM
New Version!
minor fixes:

1. Fixed syntax error in the init.d script (thanks rezmus)
2. Removed nohup from the getrss.pl in the init.d script (This might increase load time but reduce the chance of directories not being created.
3. Add commands to make the 00Active Torrents and 00Completed directories in init.d (Thanks rezmus)
http://www.mediafire.com/?m1xxyctcw9b


Working on a script to fetch images for each show on the rss feed from tvrage.  Also thinking about adding a "Whats on tonight" entry to get TV guide listings for that nights shows and the ability to add that show and try to find it later on.

If it wasn't for college football season I would ditch my satellite TV!
 
Title: Re: Add and browse torrents via OSD
Post by: dcrutgers on June 13, 2009, 06:06:50 AM
ninja76 - Great work! Thanks
Title: Re: Add and browse torrents via OSD
Post by: ninja76 on June 13, 2009, 12:02:58 PM
Here is the next version.  With some major changes:
1. I removed the spaces from all the main directories to be more compatible.
2. The directory structure is now:
    TorrentTV
        - Active_Downloads
        - Completed
        - RSS_Feeds
                      - My_TV_RSS (or your custom feed)
                      - Allow for multiple feeds (Future improvement)
        - Whats_on_Tonight (Another future feature that will pull TV guide info)
3. Added a TorrentTV.conf file to /apps/TorrentTV/etc where you configure your RSS feed
4.  I would recommend removing everything from TorrentTV.  And run the init.d manually because for some reason it only runs on startup half the time...
http://www.mediafire.com/?mzbybnz9k2d

Title: Re: Add and browse torrents via OSD
Post by: dcrutgers on June 13, 2009, 12:27:49 PM
Wow, keep up the good work.. I really like this future feature "Allow for multiple feeds".
Title: Re: Add and browse torrents via OSD
Post by: dcrutgers on June 13, 2009, 12:51:03 PM
Hmm.... I just tried this in a real test and when I add a torrent to my Queue it never downloads the torrent to  TorrentTV\Active_Downloads.  Ninja have you seen this before?
Title: Re: Add and browse torrents via OSD
Post by: ninja76 on June 13, 2009, 12:56:37 PM
Hmm.... I just tried this in a real test and when I add a torrent to my Queue it never downloads the torrent to  TorrentTV\Active_Downloads.  Ninja have you seen this before?

Is the file size of the torrent in the Active_Downloads > 0 ?  I know with utorrent I have to start and restart when I change the directory config. 

Title: Re: Add and browse torrents via OSD
Post by: dcrutgers on June 13, 2009, 01:01:46 PM
It never downloads the torrent to Active_Downloads, the folder is blank.. Bizarre.. Any ideas?
Title: Re: Add and browse torrents via OSD
Post by: ninja76 on June 13, 2009, 03:25:06 PM
It never downloads the torrent to Active_Downloads, the folder is blank.. Bizarre.. Any ideas?

Do you see any "wget" messages when you tail the messages.txt log and select a torrent??
Title: Re: Add and browse torrents via OSD
Post by: zaphod beeblebrox on June 13, 2009, 04:05:49 PM
Code: [Select]
cat /apps/TorrentTV/etc/init.d/S51TorrentTV >> /boot/torrenttv.log
cat /apps/TorrentTV/bin/directory_changed.torrent.sh >> /boot/torrenttv.log
cat /apps/TorrentTV/bin/getrss.pl >> /boot/torrenttv.log

and attach here torrenttv.log from your usb stick.

Thanks for the support Rezmus!, here it is:

Code: [Select]
#!/bin/sh

MODE=$1         # either thumb or list
NEW_PATH=$2     # the directory

CHOICE=`basename "$NEW_PATH"`
PARENT=`dirname "$NEW_PATH"`
PARENT=`basename "$PARENT"`
OSD=/apps/event-osd/osd-backup
XML=inc_messagebox.xml
XML2=basic_browse.xml
TORRENTNAME=`perl -e 'print localtime();'`
MESSAGE="@@message"
TITLE="@@browse_title_icon"
CHANGE_DONE=0
 echo "$CHOICE"
    if [ "$PARENT" == "TorrentTV" ] && [ "$CHOICE" != "00Active Torrents" ] && [ "$CHOICE" != "00Completed" ]; then
     $TITLE="Torrent TV"
     MESSAGE="$CHOICE has been added to the download queue"
     wget -O"/tmp/media/usb/TorrentTV/00Active Torrents/$TORRENTNAME.torrent" -i "$NEW_PATH/torrent.link"
     logger "wget -O/tmp/media/usb/TorrentTV/00Active Torrents/$TORRENTNAME.torrent -i $NEW_PATH/torrent.link"
    fi
    if [ "$CHOICE" == "00Active Torrents" ]; then
     $TITLE="Active Torrents"
    fi
    
    if [ "$CHOICE" == "00Completed" ]; then
     $TITLE="Completed"
    fi
    
        sed "s/@@browse_title_icon/$TITLE/" -i $OSD/$XML2  
        sed "s/@@message/$MESSAGE/" -i $OSD/$XML
  nohup `dirname "$0"`/directory_restore.osd.sh &      
use XML::Simple;
use LWP::Simple;
my $torrentBasePath = "/tmp/media/usb/TorrentTV";
my $torrentFinishedDir = "00Completed";
my $torrentActiveDir = "00Active Torrents";
## Clean out old stuff
opendir(DIR, $torrentBasePath);
    while (my $file = readdir(DIR)) {
if (($file ne $torrentFinishedDir) and ($file ne $torrentActiveDir))
{
          print "$file\n";
          `rm -r \"$torrentBasePath/$file\"`;
   };
    }

my $xml = get("http://pipes.yahoo.com/pipes/pipe.run\?_id\=5c5e909cb6011fd662b494fe608de4ee\&_render\=rss");
#my $xml = get("http://rss.bt-chat.com/\?group\=3");
$xsl = XML::Simple->new();
$data = $xsl->XMLin($xml, keyattr => ['item'] );
foreach my $item (@{$data->{channel}->{item}})
{
$torrentTitle = $item->{title};
$torrentLink = $item->{link};
$makeDir = `mkdir \"$torrentBasePath/$torrentTitle\"`;
`echo \"$torrentLink\" > \"$torrentBasePath/$torrentTitle/torrent.link\"`;
};
Title: Re: Add and browse torrents via OSD
Post by: rezmus on June 14, 2009, 12:43:15 AM
ok u said u changed dir to 00ActiveTorrents, but i still see the space in scripts, and plz paste also the content of script which is in /apps/TorrentTV/etc/init.d/ dir coz i don;t see it in your log.
Title: Re: Add and browse torrents via OSD
Post by: zaphod beeblebrox on June 14, 2009, 03:17:23 AM
uhm.. you're right.. I didn't know in which files "00Active" was written, so probably I didn't change the name everywhere... Since the new version has no blank spaces I'll try that.. There's no sense in solving this if the new update has already changed the name..

I'll report any bug/issue as soon as I've tried..

Keep up the good work !  ;)
Title: Re: Add and browse torrents via OSD
Post by: rezmus on June 14, 2009, 04:20:04 AM
ninja76: i know u don;t use torrent clinet on wdtv, but i think most ppl would like to have all in one solution. do u think there;s a chance to do something like monitor page for rtorrent (list active torrents and progress at least)? i;ve gave a link to perl module which should be good as rtorrent xmlrpc api for this.
Title: Re: Add and browse torrents via OSD
Post by: zaphod beeblebrox on June 14, 2009, 07:30:13 AM
I am trying the new release .. Everything works smoothly (folders and so on) but when I click on a show folder there is no .torrent file in the ActiveDownloads folder.. Is there supposed to be a .torrent file there right?

Anyway, thank you for your work so far Ninja :)
Title: Re: Add and browse torrents via OSD
Post by: ninja76 on June 14, 2009, 03:22:34 PM
I have created another version that has better logging.  Try tailing messages.txt when trying to add torrents and check for any TorrentTV messages.

I will start working on parsing rtorrent information and making that a item option.

http://www.mediafire.com/?31unmtd9vmc

Thanks
Title: Re: Add and browse torrents via OSD
Post by: dcrutgers on June 14, 2009, 05:38:42 PM
Looked at Message.txt:

wget -O/tmp/media/usb/TorrentTV/Active_Torrents/31471714510901641.torrent -i /tmp/media/usb/TorrentTV/RSS_Feeds/My_TV_RSS/American Chopper S06E10 HDTV XviD-aAF//torrent.link

when executed manually it returns the following which is why this doesn't work.

wget: illegal option -- i
Title: Re: Add and browse torrents via OSD
Post by: dcrutgers on June 14, 2009, 06:01:30 PM
I figured out the problem, the version of wget installed did not support the -i option.. I upgraded to the latest version and that resolved the problem...

ipkg install wget
Installing wget (1.11.4-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/wdtv/cross/unstable//wget_1.11.4-1_mipsel.ipk
Configuring wget
Successfully terminated.

Also, the torrent I was fetching had a space in the directory name so I had to add quotes:

wget -O/tmp/media/usb/TorrentTV/Active_Downloads/31471714510901641.torrent -i "/tmp/media/usb/TorrentTV/RSS_Feeds/My_TV_RSS/American Chopper S06E10 HDTV XviD-aAF//torrent.link"

Ninja: you may want to put a note that you have to install wget version (1.11.4-1).. Also, please verify that your script puts the path in quotes if the path contains spaces.

Oh, and one more thing... You need to update this line in your directory_changed.torrent.sh script:

logger "wget -O/tmp/media/usb/TorrentTV/Active_Torrents/$TORRENTNAME

to

logger "wget -O/tmp/media/usb/TorrentTV/Active_Downloads/$TORRENTNAME


Title: Re: Add and browse torrents via OSD
Post by: mr_murder on June 14, 2009, 07:53:00 PM
Just gave this a go, works great  ;D
maybe you could prefix each item in your feed with a number so that the newest torrents show first?
Title: Re: Add and browse torrents via OSD
Post by: ninja76 on June 15, 2009, 06:48:34 AM
I figured out the problem, the version of wget installed did not support the -i option.. I upgraded to the latest version and that resolved the problem...

ipkg install wget
Installing wget (1.11.4-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/wdtv/cross/unstable//wget_1.11.4-1_mipsel.ipk
Configuring wget
Successfully terminated.

Also, the torrent I was fetching had a space in the directory name so I had to add quotes:

wget -O/tmp/media/usb/TorrentTV/Active_Downloads/31471714510901641.torrent -i "/tmp/media/usb/TorrentTV/RSS_Feeds/My_TV_RSS/American Chopper S06E10 HDTV XviD-aAF//torrent.link"

Ninja: you may want to put a note that you have to install wget version (1.11.4-1).. Also, please verify that your script puts the path in quotes if the path contains spaces.

Oh, and one more thing... You need to update this line in your directory_changed.torrent.sh script:

logger "wget -O/tmp/media/usb/TorrentTV/Active_Torrents/$TORRENTNAME

to

logger "wget -O/tmp/media/usb/TorrentTV/Active_Downloads/$TORRENTNAME





Thanks dcrutgers.. The latest version should have better logging and all paths are quoted.
Title: Re: Add and browse torrents via OSD
Post by: ninja76 on June 15, 2009, 06:53:04 AM
ninja76: i know u don;t use torrent clinet on wdtv, but i think most ppl would like to have all in one solution. do u think there;s a chance to do something like monitor page for rtorrent (list active torrents and progress at least)? i;ve gave a link to perl module which should be good as rtorrent xmlrpc api for this.

I will take a look at the rtorrent.pm.  I am just trying to think of how to display that type of info in the current constraints of using directories for displaying everything and I can't figure out what triggers the WDTV to refresh its view of the content in the directories.

Title: Re: Add and browse torrents via OSD
Post by: rezmus on June 15, 2009, 07:32:46 AM
u can use active torrents dir for this coz i saw it is not used right now (just to store torrents), u can triger entering this dir to generate dirs of active downloads names using rtorrent.pm, and if someone get;s into specific dir / torrent a page with some info is displayed (also some info can be displayed on torrent list like global up/down, etc).
Title: Re: Add and browse torrents via OSD
Post by: zaphod beeblebrox on June 15, 2009, 05:40:42 PM
tried the last version.. Here my feedback:

-at boot my_tv_rss is empty (connection works fine..)  :(

-I start manually getrss.pl, it works..Now my rss folder is full , and I choose a show  :)

-I see the new torrent in the Active_downloads; rtorrent loads the torrent correctly  :)

-the file is inactive due to lack of space.. :( :(  Where exactly is Active_Downloads?? With my previous configuration I had all the torrent folders on th root and there were no space problems.. 8the usb stick is 16 Gb, so no problem in that).. Is there a way to choose a folder without space limitations?

Hope you can help me :-)
Title: Re: Add and browse torrents via OSD
Post by: ninja76 on June 15, 2009, 06:00:49 PM
All folders should be on your storage device (USB Drive, NFS or CIFS share, etc.../tmp/media/usb/<USB1>/TorrentTV or whatever your device is called) and rtorrent should be configured to download to the Downloads folder under TorrentTV
Title: Re: Add and browse torrents via OSD
Post by: mr_murder on June 15, 2009, 09:19:09 PM
-the file is inactive due to lack of space.. :( :(  Where exactly is Active_Downloads??

I think this was mainly intended to be used with a share, in which case the TorrentTV folder is mounted in 4 locations by xmount, 1) /tmp/media/usb/USB?/<uuid>/TorrentTV,  2) /tmp/media/usb/USB?/TorrentTV, 3) /tmp/media/usb/TorrentTV, and 4) /boot/TorrentTV

The script saves the torrent files to location 3, so to save files locally make sure you have the folder "TorrentTV" on the root of your stick (location 1), and then add command to init.d that binds this folder to the correct location (mount -o bind /path/to/your/torrent/folder /tmp/media/usb/TorrentTV). This way any files saved to either folder end up on your stick.
Title: Re: Add and browse torrents via OSD
Post by: zaphod beeblebrox on June 16, 2009, 09:11:07 AM
-the file is inactive due to lack of space.. :( :(  Where exactly is Active_Downloads??

I think this was mainly intended to be used with a share, in which case the TorrentTV folder is mounted in 4 locations by xmount, 1) /tmp/media/usb/USB?/<uuid>/TorrentTV,  2) /tmp/media/usb/USB?/TorrentTV, 3) /tmp/media/usb/TorrentTV, and 4) /boot/TorrentTV

The script saves the torrent files to location 3, so to save files locally make sure you have the folder "TorrentTV" on the root of your stick (location 1), and then add command to init.d that binds this folder to the correct location (mount -o bind /path/to/your/torrent/folder /tmp/media/usb/TorrentTV). This way any files saved to either folder end up on your stick.

ok, maybe I understood.. but which is exacly the ini.d folder i have to use?
/tmp/init.d?
/opt/etc/init.d?
another one?

sorry to be so noob  :)
Title: Re: Add and browse torrents via OSD
Post by: rezmus on June 16, 2009, 09:38:14 AM
with a proper configuration of rtorrent u don;t have to bind anything, coz dir where rtorrent watch for new torrent files and dir to download to are two different dirs, look at my /opt/etc/rtorrent.conf

directory = /tmp/media/usb/Dane/
schedule = watch_directory,5,5,load_start=/tmp/media/usb/TorrentTV/00Active/*.torrent

1st dir is where i want my torrents to be downloaded to (it;s my mounted ext2 hdd) and 2nd dir is just for watching changes and where torrenttv app puts new .torrent files. so u should change your rtorrent.conf, set directory = to the place where is your hdd mounted and u should not have out of space probs (remember that rtorrent have probs with ntfs).
Title: Re: Add and browse torrents via OSD
Post by: zaphod beeblebrox on June 16, 2009, 12:57:32 PM
IT WORKS PERFECTLY (just like you said Rezmus)! I'm very satisfied right now  ;D

a big THANK YOU to Ninja, obviously, but also to anyone that gave me tips to fight my newbiness  :)
Title: Re: Add and browse torrents via OSD
Post by: EM1PWR on June 17, 2009, 10:54:42 PM
Sorry for being such a newbie, but how does one set up RTorrent?  I have done everything else and it all seems to be working.  The directories are there, My_TV_RSS is populated?

I confuse when RTorrent is mentioned....
Title: Re: Add and browse torrents via OSD
Post by: ninja76 on June 18, 2009, 07:24:46 AM
Sorry for being such a newbie, but how does one set up RTorrent?  I have done everything else and it all seems to be working.  The directories are there, My_TV_RSS is populated?

I confuse when RTorrent is mentioned....

http://b-rad.cc/?s=rtorrent

b-rad has a great how to for rtorrent
Title: Re: Add and browse torrents via OSD
Post by: dcrutgers on June 18, 2009, 07:29:11 AM
Hey Ninja, How are the new features coming along?
Title: Re: Add and browse torrents via OSD
Post by: ninja76 on June 18, 2009, 07:45:29 AM
Hey Ninja, How are the new features coming along?

What features ?  ;)

Honestly I have been slacking a little and rtorrent keeps crashing my WDTV. 
What features in particular are you interested in the most?
Title: Re: Add and browse torrents via OSD
Post by: dcrutgers on June 18, 2009, 07:47:47 AM
                      - Allow for multiple feeds (Future improvement)
        - Whats_on_Tonight (Another future feature that will pull TV guide info)
Title: Re: Add and browse torrents via OSD - BUMP!
Post by: zaphod beeblebrox on July 13, 2009, 04:04:45 PM
Anyone is still using this? I think this is one of the best applications on the WDTV...I am trying to make it work properly  but I am still missing three things:

1) some rss feeds work properly (i.e. http://www.mininova.org/rss.xml?user=xsaimex )... Instead my yahoo pipe (http://pipes.yahoo.com/pipes/pipe.run?_id=XXXX&_render=rss) don't work anymore.. Here the error message if I run getrss.pl:

Code: [Select]
not well-formed (invalid token) at line 4, column 88, byte 160 at /opt/lib/perl5/site_perl/5.10.0/mipsel-linux/XML/Parser.pm line 187
Anyone knows how to solve this?

2) Is there any way to define an automatic routine (like utorrent does)? If I can obtain an rss feed with only the shows I want to download, then I'd like to download them automatically

3) Also (rtorrent issue): if I use my NFTS hhd as the target of the download, there is some "chunk error".. "device non exististing" or something like that.. I am still dubious..Can or cannot an NFTS drive work with rtorrent via USB? (it is no volume problem.. I typed the .XXXX..XX with the dot at start)

If anyone can solve any of these issues... You are my saviour! :-)
Title: Re: Add and browse torrents via OSD - BUMP!
Post by: halfling85 on October 24, 2010, 10:08:13 AM
Anyone is still using this? I think this is one of the best applications on the WDTV...I am trying to make it work properly  but I am still missing three things:

1) some rss feeds work properly (i.e. http://www.mininova.org/rss.xml?user=xsaimex )... Instead my yahoo pipe (http://pipes.yahoo.com/pipes/pipe.run?_id=XXXX&_render=rss) don't work anymore.. Here the error message if I run getrss.pl:

Code: [Select]
not well-formed (invalid token) at line 4, column 88, byte 160 at /opt/lib/perl5/site_perl/5.10.0/mipsel-linux/XML/Parser.pm line 187
Anyone knows how to solve this?

2) Is there any way to define an automatic routine (like utorrent does)? If I can obtain an rss feed with only the shows I want to download, then I'd like to download them automatically

3) Also (rtorrent issue): if I use my NFTS hhd as the target of the download, there is some "chunk error".. "device non exististing" or something like that.. I am still dubious..Can or cannot an NFTS drive work with rtorrent via USB? (it is no volume problem.. I typed the .XXXX..XX with the dot at start)

If anyone can solve any of these issues... You are my saviour! :-)


I know this thread is really old but I have had some great success with this program!

I got it working, and, even though I know next to nothing about code, I was able to get it to support multiple feeds!! :)

I have 7 feed folders displaying on my WDTV.

Yahoo Pipes doesn't work because it is Yahoo pipes, it isn't the fault of this software from what I can tell online.

Oh, and I am using Utorrent on my PC rather than using Rtorrent. I am pretty much just reading feeds on the WDTV, then when I click them, they send the torrrent file to a watch folder (windows share) on my pc which initiates the dowload in utorrent which puts the video file in a folder that is shared with the WDTV via Samba.app.bin.

I know a lot of people are leaving the WDTV for greener pastures (like the Live+) but I am broke :) so this is a great free upgrade for me :).

Thanks,
Halfling
Title: Re: Add and browse torrents via OSD
Post by: arfgh on September 01, 2013, 06:38:23 AM
links are dead, please reshare