Novik / ruTorrent

Yet another web front-end for rTorrent
Other
2.02k stars 408 forks source link

unrar plugin #107

Closed nicobubulle closed 10 years ago

nicobubulle commented 10 years ago

From Wonslung@gmail.com on October 04, 2009 02:58:21

I'm adding this feature request because i've seen a lot of people ask for it.

Basically, what people want is the ability to select a downloaded torrent which is in split rar format and unrar it. it would use the unix version of unrar here is the manpage for unrar http://www.edenwaith.com/support/untar/help/man/unrar.html the command would be this: unrar e /some/remote/file

this will unrar the files in whatever dir the command is called from. the output of unrar can be sent to a file, this is helpful to show errors if they occur but isn't absolutely important for this function. This would be a VERY nice feature for people who have LOCAL SERVERS. I see a lot of people asking for this who have remote servers, which is really not smart but...it would make a NICE plugin for local machines. This plugin really doesn't even need a gui, all you need to be able to do is be able to "send" the unrar command to the rar file somehow.

Original issue: http://code.google.com/p/rutorrent/issues/detail?id=108

nicobubulle commented 10 years ago

From mikkr...@gmail.com on October 08, 2009 19:18:48

This can also be done from .rtorrent.rc

The original thread I read about it: http://ubuntu-se.org/phpBB3/viewtopic.php?f=67&t=26376&start=80 Google is bad at translating it from swedish

The idea is to use on_finished = to execute "something" to unrar it.

nicobubulle commented 10 years ago

From Wonslung@gmail.com on October 08, 2009 19:32:44

yes, i'm aware of this, but i think most people want a simple right click unrar.

nicobubulle commented 10 years ago

From mikkr...@gmail.com on October 10, 2009 12:18:36

Absolutely, I was just talking about "until the plugin gets there" :-)

nicobubulle commented 10 years ago

From TJHart85...@gmail.com on October 11, 2009 19:42:59

@mikkri31 Yeah, it sounds like a nice workaround, but I wouldn't want a "blanket" unrar, I would want to be able to specify which torrents I want unrarred.

nicobubulle commented 10 years ago

From novik65 on October 13, 2009 02:19:19

Variants of realization: 1) Add call of unrar to torrent's list context menu. You will can run it manually. 2) Add call of unrar to on_finished event, it will be called automatic. What do you want?

nicobubulle commented 10 years ago

From Wonslung@gmail.com on October 13, 2009 10:39:04

you should be able to pick a torrent which is done from SOME menu and unrar it to the folder it is in.

This would be the most basic function. Anything automatic should be an ADDED function of the original plugin. Most people who want this function want it for SPECIFIC torrents so they can reseed the item as a no- rar version.

Many private trackers allow you to reseed the SAME torrent if it's either rar or non-rar (if the tracker has the rar version, you can reseed non-rar version)

nicobubulle commented 10 years ago

From TJHart85...@gmail.com on October 28, 2009 20:09:21

If this does get created, would it be possible to have a setting to "unrar once download completed" Maybe even have it integrate into the RSS plugin as a checkbox?

My apologies if I'm going way beyond the scope of what you'd like to do...just throwing out what I would want in there & figure you can "catch" or implement whatever you'd like.

No matter what, I appreciate all the hard work you've put into RUtorrent & all the help you've given me.

Also, my apologies to Wonslung for throwing my $.02 in on this. I don't know the etiquette in here, if it's cool for me to tack onto your initial request or if I should make my own.....I'm going on the assumption that the dev would prefer to see everything related in one place, but if I'm wrong, let me know :-)

nicobubulle commented 10 years ago

From Wonslung@gmail.com on October 28, 2009 20:12:45

no need to apologize. We would much rather you reply to a valid ticket than open a new one about the same thing.

nicobubulle commented 10 years ago

From aprwilli...@gmail.com on November 08, 2009 01:52:36

My vote's for the automatic unrar.

nicobubulle commented 10 years ago

From Bhav...@gmail.com on November 08, 2009 18:54:53

I agree with Wonslung that only some files (that you choose) should be unRARed.

nicobubulle commented 10 years ago

From TJHart85...@gmail.com on November 08, 2009 18:59:57

Same here...I am a member of many sites that ONLY allow RARd torrents & I don't always want to use the stuff I downloaded right away and it would be a massive waste of space to have it unrarred on the drive as well.

I don't know how hard it would be, but options for each? Blanket unrar everything downloaded & a right click menu that has "unrar" or "unrar after download completed" options?

nicobubulle commented 10 years ago

From hlpimfal...@gmail.com on November 08, 2009 20:02:53

Another thing is for most movies I don't even waste my time unraring because VLC will open rars and play the videos.

nicobubulle commented 10 years ago

From Wonslung@gmail.com on November 08, 2009 23:04:18

also, if you have a remote seedbox, unrar is stupid UNLESS you are on a tracker that allows you to reseed the unrar'd version. This is the only reason to unrar on a remote server because downloading split rar's via FTP is WAY faster than single files.

nicobubulle commented 10 years ago

From TJHart85...@gmail.com on November 15, 2009 09:48:11

I can imagine people on a remote server wanting to unrar the files first. Say it's a 30 GB torrent (not likely I know, but possible with BR discs or just a couple seasons of a TV show)....Time to download the files is obviously not your first concern, but space on your hard drive might be.

My server is a local box though, so I'm just imagining a situation where people might have a legit use for this.

nicobubulle commented 10 years ago

From Wonslung@gmail.com on November 15, 2009 10:05:43

either way, we need someone to write this.

nicobubulle commented 10 years ago

From aprwilli...@gmail.com on November 25, 2009 11:24:57

I may be mistaken, but I don't believe on_finished will work for rtorrent versions 0.8.5 and higher, you'd have to use something like this (from the swedish ubuntu link above):

system.method.set_key = event.download.finished,move_complete,"execute=mv,- u,$d.get_base_path=,~/torrent/completed/;d.set_directory=~/torrent/completed/"

system.method.set_key = event.download.finished,unpack_rar,"execute=/usr/local/bin/unpackrar.sh,$d.get_base_p ath=,$d.get_custom1="

where unpackrar.sh is a script that automatically unrars the file, such as:

!/bin/bash

if [ "$2" != "" ]; then
   yes no | nice -n 15 unrar x -r "$1/*.rar" "$2" >&- 2>&- &
fi

I believe the $d.get_custom1= refers to a specific destination path for certain watch directories, such as:

schedule = watch_directory_2,10,10,"load_start=/download/TV/*.torrent,d.set_directory=/download/ TV/,d.set_custom1=/archive/Series/"

nicobubulle commented 10 years ago

From slas...@gmail.com on December 17, 2009 22:06:09

Will paste my settings in a bit , thanks to novi for originally posting the foreign site ;) + with some tinkering it works quite well at least for my purposes , watch certain folders and label them such as TV/Series in rutorrent (i place the torrent files directly in watch dirs instead of using the add thru web interface) , unrar it to my shared raids and have my wdtv live auto mounting the shared content on boot , with some auto deleting upon certain ratio plugin (of the rar files) everything works pretty well and with rss feeds set up it's even more of a automated dream ;) .

nicobubulle commented 10 years ago

From hlpimfal...@gmail.com on December 29, 2009 21:09:24

in ubuntu/debian there is a package called unp, which is a perl script that will basically uncompress anything you can uncompress in linux. Might be useful.

nicobubulle commented 10 years ago

From matthewk...@gmail.com on January 18, 2010 17:23:32

I agree both options have their merit. Personally my primary interest would the ability to goto the files listing on any torrent, select the .rar and tell it to extract to folder.

If the default extraction location option was customizable that would be a bonus, perhaps a setting where you could type '/home/usr/tv' or a blank setting (default setting) would be extract to existing folder.

nicobubulle commented 10 years ago

From novik65 on February 02, 2010 02:24:36

Many private trackers allow you to reseed the SAME torrent if it's either rar or non-rar (if the tracker has the rar version, you can reseed non-rar version)

1) I need the example of such torrent (with lesser data as possible). 2) What do you want to see as result of context menu command "unrar"? You cant see files from it output on interface, because these files is not a part of some torrent.

nicobubulle commented 10 years ago

From Wonslung@gmail.com on February 02, 2010 02:47:56

i would imagine you would bring this menu up by right clicking on an actual .rar file within the FILES tab for manual use in which case it should give you a window asking where to save the output of unrar.

Some people also want an "automatic" unrar feature. The way THIS would work if possible is, in files which had .rar files, it would unrar the contents on completion (maybe this would be set on a directory similar to autotools: for example, if a file is downloaded to /some/dir/in/path/unrar then auto-unrar would run on completion on any .rar files and dump contents into current directory. Any such plugin would need to be able to check directories recursively considering how most torrents will be in thier own dir.)

Personally, i think the most important aspect of this plugin would be the manual unrar feature. You'd go to the file tab, right click the rar file and it would unrar.

It might also be a good idea to have such a plugin capture STDIN, STDOUT, and STDERR and dump it into a file called error.log (and maybe have this be an option you can disable)

nicobubulle commented 10 years ago

From Wonslung@gmail.com on February 02, 2010 03:50:28

Thinking more about this:

If there was an "automatic" unrar function, it should probably be integrated with auto-tools. This would help prevent any problems like trying to extract an incomplete file. Perhaps it could be run AFTER auto-move and be tunable.

Personally i think the manual unrar would be the most important but many people who ask me about this care about the automatic unrar as well. This type of function seems like it would fit perfectly in with autotools, so if this was done, it should be done in this order:

manual unrar which would use the unrar binary for linux/freebsd, it would work as i described before (you'd go to files, then right click a rar file (or maybe even a rar piece) after selecting this, an "extract to location" menu would pop up, of course user would need read/write/execute to this location)

as far as providing the .torrent info i am not sure you understood what i meant but i could give you an example.

Some sites will allow you to download a file which is in one format and then reupload it in another. So if you downloaded the file as a dir full of split rar files you could extract it, then create a torrent with the unrarred file, then reupload it to the same site as -non-rar.

If you search Iptorrents you'll see this.

nicobubulle commented 10 years ago

From novik65 on February 05, 2010 06:21:26

"Manual" version of plugin "unpack" added in r728

Status: Started

nicobubulle commented 10 years ago

From Wonslung@gmail.com on February 05, 2010 06:31:07

you are a god.

nicobubulle commented 10 years ago

From TJHart85...@gmail.com on February 05, 2010 07:25:09

Truly a god!

nicobubulle commented 10 years ago

From Bhav...@gmail.com on February 05, 2010 15:02:54

Wow awesome~!! Going to test it now.

nicobubulle commented 10 years ago

From Bhav...@gmail.com on February 05, 2010 18:19:20

I get this error when trying to 'unpack' a file;

Attachment: Capture.PNG

nicobubulle commented 10 years ago

From Bhav...@gmail.com on February 05, 2010 18:20:19

Also. The torrent i am trying to unpack is named t1.76.rar .

nicobubulle commented 10 years ago

From Wonslung@gmail.com on February 06, 2010 11:14:12

is it a multi-part rar? if so did you select the multiple unrar selector?

also, make sure it's a bug and not a bad rar file. I've seen bad rar files before and it was always solved by getting the right rar file.

nicobubulle commented 10 years ago

From Bhav...@gmail.com on February 06, 2010 16:44:09

No it's just one small RAR file i packed myself to test the plugin. Are you able to get
the plugin to work?

nicobubulle commented 10 years ago

From Wonslung@gmail.com on February 06, 2010 16:54:49

yes, it works flawlessly for me. I've been using it since it dropped on my home nas

nicobubulle commented 10 years ago

From Wonslung@gmail.com on February 06, 2010 16:56:07

which os are you on? if it's debian, then you may have the problem that your binary is unrar-free which isn't as compatible as unrar-nonfree.

if you need a location for unrar-nonfree for debian let me know

nicobubulle commented 10 years ago

From TJHart85...@gmail.com on February 06, 2010 17:29:04

How do I get this plugin?

When I follow directions here: https://code.google.com/p/rutorrent/wiki/GetFromSVN I am told that the plugin doesn't exist.

When I 'svn update' my rutorrent directory, I get 'At revision 732 '.

When I click the link in novik's post, I see that it is in /branches/3.0 ... Do I need to checkout a different source than what is listed in the instructions: https://code.google.com/p/rutorrent/wiki/GetFromSVN ?

nicobubulle commented 10 years ago

From Wonslung@gmail.com on February 06, 2010 17:54:50

This plugin is ONLY for 3.0

in order to use it you must upgrade to 3.0, if you check the forums ( http://forums.rutorrent.org ) i post a guide for how to upgrade to 3.0 with all plugins. I also have a guide for how to set up 3.0 with multiple user capabilities in the same forum

nicobubulle commented 10 years ago

From Wonslung@gmail.com on February 06, 2010 18:03:13

I fixed the wiki (hope that's ok)

nicobubulle commented 10 years ago

From TJHart85...@gmail.com on February 06, 2010 19:59:53

Thanks! I followed the instructions on your site & everything is good now!

Plugin works great...quick suggestion though, would it be possible to make it choose the directory that the .rar files are currently in as the default unpack directory?

nicobubulle commented 10 years ago

From Wonslung@gmail.com on February 06, 2010 20:31:16

I think this is a valid question. one question, do you have the _getdir plugin?

Also, if i don't put anything in the dir window, it unrars to the current dir, for instance, i just tested a file in /mnt/dump/torrents/Wonslung/sometvshow/someshow.rar and it unrared to /mnt/dump/torrents/Wonslung/someshow/someshow.mkv

nicobubulle commented 10 years ago

From TJHart85...@gmail.com on February 06, 2010 20:57:12

I do have the _getdir plugin.

I didn't realize that if you left it blank, it would use the current directory.

It would have been more intuitive if it would have the data prefilled, but then people who prefer to always unrar it to a certain directory would be upset, so leaving it blank is 100% ok with me :-)

Thanks for the plugin Novik & THANK YOU for all the help Wonslung!

nicobubulle commented 10 years ago

From Wonslung@gmail.com on February 06, 2010 21:52:14

It should also be noted that this plugin isn't done. Novik is working on one major update to it which would add an automatic unrar service. I'm not 100% sure how it will work but i would guess it would work somewhat like the auto-tools plugins.

nicobubulle commented 10 years ago

From novik65 on February 07, 2010 01:38:56

No it's just one small RAR file i packed myself to test the plugin. Are you able to get the plugin to work?

Attach it here, please. And torrent file too.

nicobubulle commented 10 years ago

From novik65 on February 11, 2010 02:47:21

Attach it here, please. And torrent file too.

Doesn't need, already fixed. Autounpacking added in r742 .

Status: Fixed

nicobubulle commented 10 years ago

From Wonslung@gmail.com on February 12, 2010 14:42:25

awesome

nicobubulle commented 10 years ago

From Wonslung@gmail.com on February 12, 2010 16:28:10

I was just checking out the new "automatic" setup. It's nice, but it would be much nicer if you could make it work somewhat like auto-tools.

Basically, you pick a dir, let's say it's /home/wonslung/download/unrar/

let's say your torrent download dir is /home/wonslung/download/

now you've got a dir inside of that which, if you set a torrent to download to, it will be auto-unpacked. Then everything else wouldn't be auto-unpacked.

See what i mean? This is a minor issue, but That is how i originally envisioned it.

It's still wonderful as it is now, so please don't take this as a criticism

nicobubulle commented 10 years ago

From TJHart85...@gmail.com on February 12, 2010 17:26:26

I concur with Wonslung, that type of functionality would be most excellent.

Another solution that you may like would be to have it based on labels (with autotools

Thanks for the awesome plugins though, even as they are now, they're great!

nicobubulle commented 10 years ago

From Wonslung@gmail.com on February 12, 2010 17:37:04

Well, if you look at some of my original suggestions, i say that the automatic portion of the plugin should be part of auto-tools or work LIKE auto-tools. This label idea would be most excellent.

Either way, it should be something that is SOMEHOW tunable. I'm not 100% sure i want to use a label for all my unrared stuff, though if this proves to be an EASIER solution, then it would be fine.

Basically, i think you should be able to set a dir which, if any torrent is downloaded to (or as part of the hierarchy ) would be auto-magically unrared on completion.