1. Desi_Boy

    Desi_Boy New Member Member

    Jan 10, 2012
    356
    hi,
    Currently i am looking for a tool which unrar file and put our file like readme.txt and url file then rar it again. If u know please share thanx

    Looking for help!!!!

    Regards
    Desi_Boy
     
  2. bad_boyz98

    bad_boyz98 New Member Member

    Nov 10, 2009
    167
    it is call win rar
     
  3. Desi_Boy

    Desi_Boy New Member Member

    Jan 10, 2012
    356
    na i want this automatically do, i have dozen of files.
     
  4. bad_boyz98

    bad_boyz98 New Member Member

    Nov 10, 2009
    167
    i don't think they make it
     
  5. t3od0r

    t3od0r Well-Known Member Member

    Dec 8, 2008
    1,420
    windows? linux?
     
  6. Desi_Boy

    Desi_Boy New Member Member

    Jan 10, 2012
    356
    windows .
     
  7. Wadibahi

    Wadibahi New Member Member

    Jan 12, 2010
    2,659
    Desi_Boyuse jdownloader
    jdownloader provide auto unrar after download
     
  8. Desi_Boy

    Desi_Boy New Member Member

    Jan 10, 2012
    356
    thanx wadibahi can this auto rar with files also?
     
  9. sceneguy

    sceneguy Banned Banned

    Oct 12, 2011
    652
  10. deliteblogger

    deliteblogger New Member Member

    Aug 31, 2011
    331
    winRAR offers a freeware command-line unrar tool on their site. You can include that in a custom script.
     
  11. Daniel

    Daniel New Member Member

    Nov 5, 2009
    16,013
    Hi

    I can give you my script of unraring the files when the whole torrent is downloaded. It also manages .zip and .001 files.

    I haven't found a solution on deleting the .rar/.001/.zip files when the ratio is met however.

    Here goes:

    In .rtorrent.rc add this to invoke the script:
    Code:
    system.method.set_key = event.download.finished,unpack_rar,"execute=~/unrar_files.sh,$d.get_base_path="
    Then make the script in the home folder of the user which runs rtorrent (you can specify searchpath if you want aswell but I won't add this in my example).

    vim unrar_files.sh

    Cut-n-paste this:
    Note you need to change "nedladdat/torrents" to the folder your rtorrent download files to. And "/home/daniel" to the folder the user your using.
    These two checks are there for rtorrent freaks out if the script takes too long to complete.

    Code:
    #!/bin/bash
    #Skapat av Gymmarn 2010-02-11
    #Variabel $1 is the folder sent
    #Start to check if we're in the right folder (rTorrent seems to bug sometimes)
    if [ "$(ls -d $1 | grep -F nedladdat/torrents/)" ]; then
            #Create only 1 instance of this script to avoid rTorrent crashing
            if [ ! "$(ls /home/daniel/ | fgrep -i pidfile)" ]; then
                    yes no | nice -n 15 touch /home/daniel/pidfile
                    #Find and repeat for all folders and subfolders
                    for directory in $(find $1 -type d); do
                            #Check for .rar files and unpack them if found
                            if [ "$(ls $directory | fgrep -i .rar)" ]; then
                                    rarFile=`ls $directory | fgrep -i .rar`;
                                    searchPath="$directory/$rarFile"
                                    yes no | nice -n 15 unrar x -o+ $searchPath $directory
                            #Check for .001 files and unpack them if found
                            elif [ "$(ls $directory | fgrep -i .001)" ]; then
                                    rarFile=`ls $directory | fgrep -i .001`;
                                    searchPath="$directory/$rarFile"
                                    yes no | nice -n 15 unrar x -o+ $searchPath $directory
                            #Check for .zip files and unpack them if found
                            elif [ "$(ls $directory | fgrep -i .zip)" ]; then
                                    for zipFiles in `ls $directory | fgrep -i .zip`; do
                                            searchPath="$directory/$zipFiles"
                                            yes no | nice -n 15 unzip -n $searchPath -d $directory
                                    done
                                    #When there is .zip files there is often .rar/.001 in them. Check and unpack if so
                                    if [ "$(ls $directory | fgrep -i .rar)" ]; then
                                    rarFile=`ls $directory | fgrep -i .rar`;
                                    searchPath="$directory/$rarFile"
                                    yes no | nice -n 15 unrar x -o+ $searchPath $directory
                                    #Check for .001 files and unpack them if found
                                    elif [ "$(ls $directory | fgrep -i .001)" ]; then
                                    rarFile=`ls $directory | fgrep -i .001`;
                                    searchPath="$directory/$rarFile"
                                    yes no | nice -n 15 unrar x -o+ $searchPath $directory
                                    fi
                            fi
                    done
                    yes no | nice -n 15 rm -f /home/daniel/pidfile
            fi
    fi
    
    I'm no programmer and things could probably be made nicer, but here it is in all it's glory :D
     
  12. Djlatino

    Djlatino New Member Member

    Aug 20, 2010
    2,413
    Great post Sandvik.
     
  13. Desi_Boy

    Desi_Boy New Member Member

    Jan 10, 2012
    356
    thanx OJ , but need to Read thoroughly to make it work ;)
     

Share This Page