Automatic NZB file tasking from ipod/iphone

Discussion in 'iOS Jailbreak & Cydia' started by ralree, Feb 10, 2010.

  1. ralree

    ralree New Member

    Joined:
    Aug 3, 2008
    Messages:
    2
    Likes Received:
    0
    Device:
    2G iPod touch
    So, I wanted to be able to download an NZB file from the internet through safari, and have it automatically tasked on another machine for download. This turns out to be rather easy to do with my 2nd gen ipod touch with 3.1.2 firmware.

    I followed the instructions at
    Code:
    http://www.networkedmediatank.com/showthread.php?tid=12157
     and 
    http://www.hackint0sh.org/f126/55358.htm
    
    and made my own modifications. It basically comes down to the following:

    1. Install
    • Safari download plug-in (by Hachu)
    • OpenSSH - to remote connection to phone from your PC
    • Insomnia - prevents SSH disconnections when phone sleeps

    2. Edit /System/Library/Internet Plug-Ins/File Download Plugin.webplugin/Info.plist and add this to the heirarchy carefully:

    Code:
    <key>application/x-nzb</key>
      <dict>
        <key>WebPluginExtensions</key>
        <array>
          <string>nzb</string>
        </array>
        <key>WebPluginTypeDescription</key>
        <string>NZB File</string>
        <key>WebPluginTypeEnabled</key>
          <true/>
      </dict>
    3. Put the script at
    Code:
    http://github.com/hank/life/raw/master/code/bash/ipod_touch/nzbmover.sh
    
    in /var/mobile/nzbmover.sh.
    4. Edit that script, and change the variables to work with your setup.
    5.
    Code:
    chmod a+x /var/mobile/nzbmover.sh
    6. Set up your SSH keys to work properly.
    7. In /Library/LaunchDaemons/com.automation.nzbmover.plist, put:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>Disabled</key>
        <false/>
        <key>Label</key>
        <string>com.automation.nzbmover</string>
        <key>ProgramArguments</key>
        <array>
            <string>/var/mobile/nzbmover.sh</string>
        </array>
        <key>WatchPaths</key>
        <array>
            <string>/var/mobile/Library/Downloads</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>onDemand</key>
        <true/>
    </dict>
    </plist>
    8. Now go download a file and test it! I tried downloading a file, running the script from the command line, and seeing success.
    9. Add it to the launch daemon with:
    Code:
    launchctl load /Library/LaunchDaemons/com.automation.nzbmover.plist

Share This Page