DSM-G600, DNS-323 and TS-I300 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 2008-05-24 21:26:58

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 203

[REL] Automatic for funplug-0.5

Many Transmission users have been requesting a way to download stuff automatically with the use of RSS feeds, like uTorrent does, for example.

Since the devs consider such functionality as bloat and won't implement it, I went ahead and programed my own tool called Automatic.

It's a stand-alone program written in C that runs in the background and checks a given RSS feed at an interval to check for new downloads.
You can specify what to download via regular expressions.
The app can just download the torrent files, or, if you have Transmission running, add the torrents directly to Transmission.

Latest version: v0.2 funplug-0.5 package           Source code

Install it using funpkg:

Code:

funpkg -i Automatic-0.2-ffp0.5.tgz

The tool requires libcurl and libxml2, both of which should already be installed if you use the latest version of Transmission.
Please note that this will only work with funplug-0.5!

The package contains a configuration file which is placed at /ffp/etc/automatic.conf-sample. Save a copy as automatic.conf and change the options as to your likings.


EDIT: Updated to v0.1.1
    * Fixes a bug with parsing the configuration file.

EDIT: Updated to v0.1.2.
    * The config file has a new option "transmission-home". Set it to the configuration folder of Transmission (default: /mnt/HD_a2/.transmission).
    * This is a change in response to [DrAg]'s problem. Now it's not necessary anymore to set the environment variable TRANSMISSION_HOME.

EDIT: Updated to v0.1.3.
    * Should compile on normal Linux distributions now as well.
    * Added option "torrent-folder" so you can decide where torrents will be saved
    *Fixed a problem with the statefiles which only becomes apparent after quite a lot of downloads

EDIT: Updated to v0.1.3.1.
    * Fixed a crash when certain environment variables weren't set on a system

EDIT: Updated to v0.1.4.
    * Fixed a crash when a torrent download was unsuccessful (Partly fixes mudapw's problem)

EDIT: Updated to v0.2.
    * Support for Transmission 1.3+: The torrents are added to Transmission via HTTP/JSON, no need to save the file to disk and add via transmission-remote.
    * Support for multiple RSS feeds
    * Removed logging to file for now, it was causing problems. You can still log though, take a look at the automatic.sh startup script

INFO 1: There are new options in automatic.conf-sample, and some have been removed. I strongly advise to use it as a template and create a new configuration file (you can copy over your patterns from the old one).
INFO 2: Automatic now assumes by default that you use Transmission 1.3+. If that's not the case you have to change the setting in automatic.conf


As always, feedback and suggestions are always welcome. When you think you found a bug, please provide a log file so I can trace the error back.


Have fun!

Last edited by KyleK (2008-08-26 22:44:25)

Offline

 

#2 2008-05-25 02:09:35

vedeja
Member
Registered: 2008-02-21
Posts: 122

Re: [REL] Automatic for funplug-0.5

KyleK, it installed without problem. I added the RSS feed URL to the .conf file (inside double quotes) and attempted starting.

Code:

# /mnt/HD_a2/ffp/start/automatic.sh start
Starting /ffp/bin/automatic
Error parsing config file: Success

Last edited by vedeja (2008-05-25 02:10:23)


¤ 2 x 500 GB Samsung Spinpoint ¤ FFP 0.5 ¤ Custom fanscript ¤
¤ Lighttpd 1.4.19 ¤ Transmission 1.32 ¤ FW 1.05b28 ¤

Offline

 

#3 2008-05-25 06:55:14

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 203

Re: [REL] Automatic for funplug-0.5

Strange error message.
Can you provide the config file?

Offline

 

#4 2008-05-25 22:52:34

vedeja
Member
Registered: 2008-02-21
Posts: 122

Re: [REL] Automatic for funplug-0.5

KyleK wrote:

Strange error message.
Can you provide the config file?

I did'n change the original automatic.conf ohter than added my feed url.


¤ 2 x 500 GB Samsung Spinpoint ¤ FFP 0.5 ¤ Custom fanscript ¤
¤ Lighttpd 1.4.19 ¤ Transmission 1.32 ¤ FW 1.05b28 ¤

Offline

 

#5 2008-05-26 04:14:40

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 203

Re: [REL] Automatic for funplug-0.5

Did you make sure to save the file Linux-style, i.e. with only newline characters for linebreaks (instead of newline+carriage return)?

You can send me a PM if you don't want to attach the config directly to the thread.

EDIT: Found the problem and fixed it. You can download the new version 0.1.1 here.

Last edited by KyleK (2008-05-26 04:32:41)

Offline

 

#6 2008-05-26 18:45:28

SilentException
Member
From: Island of Krk, Croatia
Registered: 2008-05-04
Posts: 121

Re: [REL] Automatic for funplug-0.5

nice one kylek! smile are the sources available for download?


D-Link DNS-323 v1.05 fun_plug-ed + many mods,  2 x 320GB Seagate Barracuda 7200.10 RAID0, Cat6 Gigabit Network, 9k Jumbo Frames, Average (WRITE): 19,32 MB/sec, Average (READ): 28,6 MB/sec

Offline

 

#7 2008-05-26 18:52:01

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 203

Re: [REL] Automatic for funplug-0.5

Not yet. I want to do clean it up a bit and maybe add some commenting before releasing the source. It's not gonna take long though.

Offline

 

#8 2008-05-27 14:17:19

[DrAg]
Member
Registered: 2008-04-17
Posts: 13

Re: [REL] Automatic for funplug-0.5

Thanks KyleK,

I like your new tool. Still having some problems to get it working.

1. I added a RSS feed
2. added a pattern
3. at the moment the new torrent get downloaded tot ffp/tmp/*.torrent

How can I add the torrent directly to transmission-remote / daemon so the torrents get downloaded to a directory as soon a they appear at the RSS-feed? (I left the automatically download option to YES in the config file)

Offline

 

#9 2008-05-27 15:17:24

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 203

Re: [REL] Automatic for funplug-0.5

If the option "use-transmission" is set to "yes" in the configuration file, Automatic will issue the following command after it has downloaded a torrent:

Code:

transmission-remote -a <path-to-torrent>

You can check if the torrent has been added by typing "transmission-remote -l" in the shell.

I can see this fail if transmission-remote does not know where the Transmission home directory is.
I suggest you add the following line to your fun_plug script:

Code:

export TRANSMISSION_HOME=/mnt/HD_a2/.transmission

Offline

 

#10 2008-05-27 15:22:03

[DrAg]
Member
Registered: 2008-04-17
Posts: 13

Re: [REL] Automatic for funplug-0.5

Thanks, it works!

There was no association for TRANSMISSION_HOME so transmission-remote failed to work.

Offline

 

#11 2008-05-27 18:38:26

Pejn
Member
Registered: 2007-12-17
Posts: 24

Re: [REL] Automatic for funplug-0.5

good work kylek, this is something i want.. ill try it out when ive updated to funplug 0.5

Offline

 

#12 2008-05-27 19:15:55

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 203

Re: [REL] Automatic for funplug-0.5

New version 0.1.2 is out. I updated the first post.

Last edited by KyleK (2008-05-27 19:23:03)

Offline

 

#13 2008-06-05 19:54:34

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 203

Re: [REL] Automatic for funplug-0.5

I packaged the source code of the project, link is available in first post.

Offline

 

#14 2008-06-24 19:29:51

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 203

Re: [REL] Automatic for funplug-0.5

New version 0.1.3 is up and the links in the first post are updated.
I also put the source code on its own little web page with additional information on how to compile and use it on other systems.

Feedback is - as always - appreciated.

Have fun!

Offline

 

#15 2008-06-24 19:48:19

SilentException
Member
From: Island of Krk, Croatia
Registered: 2008-05-04
Posts: 121

Re: [REL] Automatic for funplug-0.5

thanks for the updated version and source code fix, will try it out this weekend when i'm home! smile


D-Link DNS-323 v1.05 fun_plug-ed + many mods,  2 x 320GB Seagate Barracuda 7200.10 RAID0, Cat6 Gigabit Network, 9k Jumbo Frames, Average (WRITE): 19,32 MB/sec, Average (READ): 28,6 MB/sec

Offline

 

#16 2008-06-25 02:48:42

Pejn
Member
Registered: 2007-12-17
Posts: 24

Re: [REL] Automatic for funplug-0.5

Thanx for new version i tested it but getting error "Segmentation fault" when i try starting, dont know what that means, but version 1.1.2 works, ill try more tomorrow but now sleep smile

Offline

 

#17 2008-06-25 02:59:13

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 203

Re: [REL] Automatic for funplug-0.5

Uh, Segmentation fault is not good at all. Please run it like this:

Code:

automatic -f -v 3 -c /ffp/etc/automatic.conf >automatic.log 2>&1

and send me the output.
Your automatic.conf would help me as well.

Last edited by KyleK (2008-06-25 03:26:00)

Offline

 

#18 2008-06-25 11:34:59

[DrAg]
Member
Registered: 2008-04-17
Posts: 13

Re: [REL] Automatic for funplug-0.5

Same problem here, (sorry sad) logfile output:

Allocated 32 bytes (0x17008)
Allocated 28 bytes (0x17078)
Segmentation fault

Last edited by [DrAg] (2008-06-25 11:35:13)

Offline

 

#19 2008-06-25 12:45:45

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 203

Re: [REL] Automatic for funplug-0.5

Problem fixed in v0.1.3.1
Automatic crashed because it was looking for the "TEMPDIR" environment variable, which you guys apparently haven't set.

In this case I strongly suggest you use the option "torrent-folder" in the automatic.conf, because otherwise Automatic will save torrents to /tmp by default, and we all know that /tmp is filled up pretty quickly smile

Alternatively, you can set TEMPDIR to /ffp/tmp, where you shouldn't have any space problems. Put this in either fun_plug or /ffp/etc/rc:

Code:

export TEMPDIR=/ffp/tmp
export TMPDIR=/ffp/tmp

Offline

 

#20 2008-06-25 15:07:41

[DrAg]
Member
Registered: 2008-04-17
Posts: 13

Re: [REL] Automatic for funplug-0.5

Thanks for the quick fix. Have some trouble starting, the program seems to point to wrong dir by default: better may be /ffp/etc/automatic.conf

Error parsing config file: Cannot find file '/etc/automatic.conf'

The program's works perfect. Maybe add the torrent-folder = "" by default, makes it more easy to configure. And some times it not clear you have to use "" for the parameters in the config.

Thanks for all the hard work!

Offline

 

#21 2008-06-25 15:29:04

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 203

Re: [REL] Automatic for funplug-0.5

I chose /etc/automatic.conf as default because the tool is supposed to work on normal Linux distributions as well.
I updated the start/automatic.sh file though with the proper switches, so you shouldn't see any problems with that.

Actually I think you can omit the quotes, they're only needed if there would be whitespace within the URL.
But you're right, I should be consistent about their use in the sample config. I've updated the package with a new automatic.conf

Offline

 

#22 2008-07-12 19:35:16

d98jh
Member
Registered: 2008-07-12
Posts: 5

Re: [REL] Automatic for funplug-0.5

Hi! I'm using Automatic 1.3.1 which works great except for one small thing, I can't get it to start at boot.
I've "chmod a+x automatic.sh" but it still won't start. What have I missed? If I recall correctly version 1.3.0 started at boot without any problems...

Thanks!

Offline

 

#23 2008-07-16 23:11:04

mudapw
New member
Registered: 2008-07-16
Posts: 1

Re: [REL] Automatic for funplug-0.5

Hi KyleK, thanks for this great little thingy!

Everything works great, but at this one site I have a problem with downloads, is it because it has a ; in the url?

url = "http://www.X.net/rss.php?passkey=X&username=mudape&direct:COOKIE:uid=X;pass=X"

The log says:
[getHTTPData] response code: 302
[getHTTPData] Failed to get 'http://www.X.net/details.php?id=21998&hit=1' [response: 302]
Segmentation fault

According to site the wrong file gets downloaded because there's an error with the user/pass
url works in uTorrent. Any ideas? I tried \; but that didn't change anything, I'm a noob at this...

ps. In automatic.sh line 11 is
automatic_flags"-c /ffp/etc/automatic.conf"
should be
automatic_flags="-c /ffp/etc/automatic.conf"
right?

Cheers


Attachments:
Attachment Icon automatic.log, Size: 5,591 bytes, Downloads: 30

Offline

 

#24 2008-07-16 23:25:09

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 203

Re: [REL] Automatic for funplug-0.5

Since you apparently use a rss feed for some private torrent site, the remote server responds with a redirect message, which currently Automatic does not understand.
I'll have to look into this.
What worries me more is the segmentation fault, that should never ever happen.
I'll let you know when I know more.

PS: the semicolon shouldn't matter.

Offline

 

#25 2008-07-22 12:59:49

d98jh
Member
Registered: 2008-07-12
Posts: 5

Re: [REL] Automatic for funplug-0.5

d98jh wrote:

Hi! I'm using Automatic 1.3.1 which works great except for one small thing, I can't get it to start at boot.
I've "chmod a+x automatic.sh" but it still won't start. What have I missed? If I recall correctly version 1.3.0 started at boot without any problems...

Thanks!

KyleK: Any input on my problem? Thanks in advance!

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson