MFS FTP

From DVRpedia

Revision as of 07:28, 12 June 2010 by Admin (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Overview

MFS_FTP is a FTP server program that is installed on the TiVo itself. The purpose of this program is to extract shows from the TiVo to your PC for backup and archiving; extracted shows can be restored to the TiVo as well. If you have disabled encryption on your TiVo, extracted shows can also be converting to another format, coped to DVD, and/or watched on your PC or mobile device. MFS_FTP allows similar functionality to TiVo Desktop, where shows can be downloaded from the TiVo to your PC. However, TiVo Desktop is compatible with only Series 2 Stand-Alone TiVos; MFS_FTP is compatible with any modified TiVo.

By default, MFS_FTP runs on port 3105 and requires no username or password but does require a passive FTP connection. It can be accessed from any standard FTP client, such as Filezilla. To connect to a TiVo running MFS_FTP, connect the the TiVo IP address and specify port 3105 and make sure your FTP client is configured for Passive Mode.

To shutdown MFS_FTP, FTP to the TiVo (port 3105) and download the "shutdown" file. Or, you can telnet into port 3105 and type in the *exit* command.

How MFS_FTP Works

Shows are not stored as single files on the TiVo hard disk; they are stored in a database. Because of this, you can not use the standard TiVo FTP server to browse the file system and find shows. MFS_FTP reads this database and extracts show details, which are then presented as shows that can be downloaded when you connect to MFS_FTP. After connecting, it is possible to download shows in various formats (*.tmf, *.ty+, *.ty, *.ccx). The big difference between the formats is the extra data included in the TMF file, which allows a show to be reinserted back to the TiVo after it is extracted. The *.ccs option is for playing shows by Media Center on a modified Xbox.

This Page Applies to these TiVo Versions

  • TiVo Series 1 - yes
  • Tivo Series 2 - yes
  • TiVo Series 2.5 - yes
  • TiVo Series 3 - unknown
  • TiVo Series 3 "HD and HD XL" - yes
  • DirecTV TiVo Series 1 - yes
  • DirecTV TiVo Series 2 - yes
  • DirecTV TiVo Series 2 HD - yes

Requirements

Your TiVo must already be modified. At minimum, it will need to have networking enabled and you'll need to have telnet and ftp running on the TiVo. See other pages on this site for instructions on how to modify your TiVo to meet these requirements.

If you just want to backup the files you are extracting from the TiVo so that you can upload them back to the same exact TiVo in the future, you do not need to have encryption disabled. However, you need to export shows using the *.tmf format and you'll need to backup your DC_key.xml file. See the notes section at the end for more details.

If you want to convert the shows to another format, watch them on a PC, or save them to a DVD, you will need to disable encryption on your TiVo. See other pages on this site for instructions on how to disable encryption.

Installation - Series 3 "HD and HD XL"

mount -o remount,rw /
mkdir /tivo-bin/
  • You will now need to ftp all of the above files to your TiVo, putting them in the /tivo-bin/ directory.
  • You start by unzipping mfs_ftp:
cd /tivo-bin/
unzip mfs_ftp.1.2.9p.tar.zip
tar -xf mfs_ftp.tar
  • You should now have a new directory created containing all of the mfs_ftp files:
/tivo-bin/mfs_ftp/
  • Next you have to extract and move the proper MIPS64 binaries for the TiVo HD/HD XL to the mfs_ftp directory:
cd /tivo-bin/
tar -xjf mfs-utils.64.tar.bz2
mv /tivo-bin/mfs-utils.64/bin.mips/* /tivo-bin/mfs_ftp/
  • You now need to extract and move a copy of patch that is guaranteed to work properly (personally tested with no issues) as well as all of the patches needed for mfs_ftp.tcl:
cd /tivo-bin/
gzip -dv patch.gz
tar -xzf mfs_ftp.20070121.patch.tar.gz
gzip -dv mfs_ftp-20070207-pasv-fix.patch.gz
gzip -dv mfs_ftp-20070717b-ya-pasv-fix.patch.gz
mv patch /tivo-bin/mfs_ftp/
mv mfs_ftp.20070121.patch /tivo-bin/mfs_ftp/
mv mfs_ftp-20070207-pasv-fix.patch /tivo-bin/mfs_ftp/
mv mfs_ftp-20070717b-ya-pasv-fix.patch /tivo-bin/mfs_ftp/
  • You are now going to apply the patches, they need to be done in this order:
cd /tivo-bin/mfs_ftp/
touch port.3105.log (You need to do this for the following command, change it to port.<YOURPORT>.log if you're not using the default port 3105)
chmod -R 755 *
./patch mfs_ftp.20070121.patch
./patch mfs_ftp-20070207-pasv-fix.patch
./patch mfs_ftp-20070717b-ya-pasv-fix.patch
  • Nearing the end of the install, you now need to move p1.tcl, p2.tcl and tzoffset.tcl into the mfs_ftp.tcl diretory (you do not need to apply them):
cd /tivo-bin/
mv p1.tcl /tivo-bin/mfs_ftp/
mv p2.tcl /tivo-bin/mfs_ftp/
mv tzoffset.tcl /tivo-bin/mfs_ftp/
  • The final step to complete before you can start mfs_ftp is to edit settings.tcl so that p1.tcl doesn't cause an error:
cd /tivo-bin/mfs_ftp/
  • Using vi, vim, or joe (depending on what you have installed) add the following to the end of settings.tcl:
set info(seriescreate) 0                        ;#
  • You now have a properly functioning copy of mfs_ftp installed in a directory that won't get wiped, and can test that it runs and functions properly by issuing the following commands, waiting approximately 5 minutes, and then connecting via a FTP client to your TiVo IP on port 3105 and attempting to download a file:
cd /tivo-bin/mfs_ftp/
./mfs_ftp.tcl
  • Hold on though, you're not done yet.
  • You now need to stop mfs_ftp by either logging in and downloading shutdown.txt, or rebooting your TiVo. If you choose to reboot your TiVo, remount / with Read/Write:
mount -o remount,rw /
  • Since the root file system is typically read only, you now need to create a symlink for port.3105.log and /tivo-bin/mfs_ftp/cache/ to somewhere that is, like /var/mfs_ftp/:
cd /tivo-bin/mfs_ftp/
rm port.3105.log
rm -rf /tivo-bin/mfs_ftp/cache/
mkdir -p /var/mfs_ftp/cache
touch /var/mfs_ftp/port.3105.log
ln -sf /var/mfs_ftp/port.3105.log .
ln -sf /var/mfs_ftp/cache/ .
  • You can now remount / as read only:
mount -o remount,ro /
  • You should now have no problems starting mfs_ftp since the log and cache directory are both now on /var/ and can be written to!
cd /tivo-bin/mfs_ftp/
./mfs_ftp.tcl

Installation - Series 2

  • Download mfs_ftp.1.2.9p.tar.zip listed in this post on DealDatabase.com
  • Download mfs-utils_bin.mips-20050604.tar.bz2 from this thread on DealDatabase.com
  • Download the p1.tcl file listed in this DealDatabase post
  • Download the p2.tcl file listed in this DealDatabase post
  • Download the mfs_ftp.20070121.patch.tar.gz patch listed in this DealDatabase post
  • Download the mfs_ftp-20070207-pasv-fix.patch.gz patch listed in this DealDatabase post
  • Download the mfs_ftp-20070717b-ya-pasv-fix.patch.gz patch listed in this DealDatabase post
  • Download the patch.gz program listed in this DealDatabase post.
  • Download the tzoffset.tcl file from this post on DealDatabase.com.
  • FTP all of the files over to your Tivo to the /var/hack/ directory (may need to mount the file system Read/Write via mount -o remount,rw /). After doing so, you should see the following files:
    • mfs_ftp.1.2.9p.tar.zip
    • mfs-utils_bin.mips-20050604.tar.bz2 (actually, it's best to extract this file on your PC because of the directory structure and compression format)
    • p1.tcl
    • p2.tcl
    • mfs_ftp.20070121.patch.tar.gz
    • mfs_ftp-20070207-pasv-fix.patch.gz
    • mfs_ftp-20070717b-ya-pasv-fix.patch.gz
    • patch.gz
    • tzoffset.tcl
  • From the telnet prompt, change to the directory containing the files
cd /var/hack/
  • Extract the files (Note: Busybox may have an error that prevents extraction of .zip file. Use the unzip program included in AlphaWolf's All-In-One S2 Utilities Collection). If you have problems, extract the files to TAR files on your PC and then transfer the TAR files to the TiVo.
  • Unzip and unTAR the mfs_ftp files:
unzip mfs_ftp.1.2.9p.tar.zip
tar -x -f mfs_ftp.tar

Note: The previous step creates the mfs_ftp directory with all mfs_ftp file within

  • Extract the file mfs-utils_bin.mips-20050604.tar.bz2 on your PC using 7-zip or an equivalent
  • Extract the resulting mfs-utils_bin.mips-20050604.tar file on your PC using 7-zip or an equivalent
  • Using FTP, copy all of the ~17 files in the ... /mfs-utils/bin.mips/ directory on your PC into the /var/hacks/mfs_ftp directory on your TiVo, overwriting any existing files with the same name.
  • (if your tivo has bunzip2, instead of doing the above 3 steps on your pc you can: cd /var/hack ; bunzip2 mfs-utils_bin.mips-20050604.tar.bz2 then tar -xvf mfs-utils_bin.mips-20050604.tar then mv mfs_utils/bin.mips/* mfs_ftp/. then rm -rf mfs_utils/.)
  • Using telnet, run the following commands on the TiVo
  • Extract and the patch file and move it to the mfs_ftp directory:
cd /var/hack
gzip -dv patch.gz
mv patch /var/hack/mfs_ftp
  • Extract the 20070121 patch and move it to the mfs_ftp directory:
gzip -dv mfs_ftp.20070121.patch.tar.gz
tar -x -f mfs_ftp.20070121.patch.tar
mv mfs_ftp.20070121.patch /var/hack/mfs_ftp
  • Extract the 20070207 patch and move it to the mfs_ftp directory:
gzip -dv mfs_ftp-20070207-pasv-fix.patch.gz
mv mfs_ftp-20070207-pasv-fix.patch /var/hack/mfs_ftp
  • Extract the 20070717 patch and move it to the mfs_ftp directory:
gzip -dv mfs_ftp-20070717b-ya-pasv-fix.patch.gz
mv mfs_ftp-20070717b-ya-pasv-fix.patch /var/hack/mfs_ftp
  • Move the tzoffset.tcl file to the mfs_ftp directory:
mv tzoffset.tcl /var/hack/mfs_ftp
  • Move the p1.tcl file to the mfs_ftp directory:
mv p1.tcl /var/hack/mfs_ftp
  • Move the p2.tcl file to the mfs_ftp directory:
mv p2.tcl /var/hack/mfs_ftp
  • If you change the to /var/hack/mfs_ftp directory are run an ls command to list the file, you should see the following files/directories:
NowShowing                       mfs_import
abort.doc                        mfs_info
abort_toggle.sh                  mfs_ls
cache                            mfs_stdinsert
ciphercheck                      mfs_stream
contrib                          mfs_streams
fifo                             mfs_tarstream
ftp                              mfs_tmfstream
ftpf.sh                          mfs_tzoffset
ftpf21.sh                        mfs_uberexport
license.txt                      patch
log                              readme.txt
mfs-utils                        scramble_utils
mfs-utils_bin.mips-20050604.tar  seasonpass
mfs_burstcmds                    set
mfs_dumpobj                      setpri
mfs_dumpschema                   settings.tcl
mfs_export                       tserver
mfs_ftp-20070207-pasv-fix.patch  tzoffset.tcl
mfs_ftp.20070121.patch           vserver
mfs_ftp-20070717b-ya-pasv-fix.patch
mfs_ftp.tcl
  • Change to the mfs_ftp directory, make all the files executable, and apply the 20070121 patch:
cd /var/hack/mfs_ftp
chmod -R 755 *
./patch < mfs_ftp.20070121.patch
  • Apply the 20070207 patch:
./patch < mfs_ftp-20070207-pasv-fix.patch
  • Apply the 20070717 patch:
./patch < mfs_ftp-20070717b-ya-pasv-fix.patch
  • The patches must be applied in the correct order, and you must start with an original 1.29p mfs_ftp.tcl
  • Patches failing? If you extracted the files in Windows you might have created extra ctrl-M. See: This DealDatabase post that tells you to extract everything on your tivo. It worked great for me.
  • A manual TimeZoneOffset file is generally not needed, but has caused some people problems with later versions of TiVo software. Perform this step only if you have a timezone-related error. To create th tzoffset file in the mfs_ftp directory using the joe text editor type:
joe /var/hack/mfs_ftp/tzoffset.txt

Place the following text in the new file

# <tzoffset>-18000</tzoffset>
set info(tzoffset) -18000

Hit CTRL+K and then hit X to save the file and exit the joe text editor. Note: the -18000 value may be different depending on your timezone. This represents the number of seconds difference between GMT and your timezone. It's not a big deal if you use a different value from your timezone, but times/dates my be slightly off. Use -18000 for EST, -21600 for CST, -25200 for MST, -28800 for PST. If you're really concerned about it, you can adjust this setting for Daylight Saving Time.

  • mfs_stdinsert has been superseded by mfs_import. Delete the old and replace it with the new:
cd /var/hack/mfs_ftp
rm mfs_stdinsert
cp mfs_import mfs_stdinsert
  • To use p1.tcl, you need to add a line to settings.tcl or you will get an error. Original instructions here.
set info(seriescreate) 0                        ;# Allow Series to be created? 0 = disabled, 1/others = enabled.

Backup and auto-recovery of mfs_ftp (in case /var directory gets wiped)

Create a tarball of the patched mfs_ftp directory tree for easy reinstall:

cd /var/hack
tar -cf mfs_ftp_backup.tar mfs_ftp

Copy the tarball to /hacks for safekeeping:

cp mfs_ftp_backup.tar /hacks/mfs_ftp_backup.tar 

Add the following to /etc/rc.d/rc.sysinit.author for auto recovery if /var/hack/mfs_ftp is deleted

#############################################
# check if /var/hack/mfs_ftp got deleted, rebuild if required (with optional autostart commented out)
if [ ! -d /var/hack/mfs_ftp ]; then
cd /var; tar -xvf /hacks/mfs_ftp_backup.tar
fi
# tivosh /var/hack/mfs_ftp/mfs_ftp.tcl >> /dev/null &

Installation - Series 1

  • Download mfs_ftp.1.2.9p.tar.zip from this thread on DealDatabase.com
  • Download the file mfs-utils_bin.ppc-20050604.tar.bz2 from Unified mfs_tools thread on dealdatabase.com and extract the TAR file to a directory named mfs-utilsusing 7-Zip or equivalent. Copy all of the files from the /mfs_tools/mfs-utils/bin.ppc directory to the mfs_ftp directory, overwriting any older files.
  • Download the tzoffset.tcl file from the this post on deal database.com and copy it into the mfs_ftp directory on your PC.
  • Download the p2.tcl file from this post on dealdatabase.com. Place it in the same directory as the other files.


Using telnet, connect to your TiVo and create the /var/hack/mfs_ftp directory: Remount root as read-write

mount -o remount,rw /

Create the necessary directories

cd /
mkdir /var/hack/mfs_ftp
mkdir /var/hack/mfs_ftp/scramble_utils
mkdir /var/hack/mfs_ftp/seasonpass
mkdir /var/hack/mfs_ftp/contrib

Using ftp connect to your TiVo, transfer the files in the /var/hack/mfs_ftp directory from your PC to the /var/hack/mfs_ftp directory. Be sure that you configure the FTP client to transfer the file in Binary Mode. If you transfer them in ASCII mode, MFS_FTP will not function.

Create the TimeZone Offset required for later versions of TiVo software:

joe /var/hack/mfs_ftp/tzoffset.txt

Place the following text in the file

# <tzoffset>-18000</tzoffset>
set info(tzoffset) -18000

Hit CTRL+K and then hit X to save the file and exit the joe text editor. Note: the -18000 value may be different depending on your timezone. This represents the number of seconds difference between GMT and your timezone. It's not a big deal if you use a different value from your timezone, but times/dates my be slightly off. Use -18000 for EST, -21600 for CST, -25200 for MST, -28800 for PST. If you're really concerned about it, you can adjust this setting for Daylight Saving Time.

This may not be necessary, but just in case, make the files executable:

chmod -R 755 /var/hack/mfs_ftp/*

Remount root as read-only:

sync
mount -o remount,ro /

Starting MFS_FTP

Run the following command via telnet:

/var/hack/mfs_ftp/mfs_ftp.tcl

mfs_ftp will now take about 5 minutes to index the shows on your TiVo. The files will be created in the /var/hack/mfs_ftp/cache directory (an *.xml and a *.pts file for each show recorded on your TiVo.) If you're curious, shitch to the cache directory and run an ls command. Each time you run it, more and more files should be shown until mfs_ftp finishes creating the cache. At that point, you can connect to mfs_ftp.

Note: Since mfs_ftp is a TCL script, it is not necessary to place an & after the command to start the program and be returned to the command prompt. If you do start mfs_ftp this way, there is no difference, except that after about 20 seconds you may see the following text show-up at the telnet prompt: [1]+ Done ./mfs_ftp.tcl (wd: /var/hack/mfs_ftp) (wd now: /var/hack/mfs_ftp/cache)

Shutting Down MFS_FTP

  1. To shutdown MFS_FTP, FTP to the TiVo (port 3105) and download the "shutdown" file.
  2. Or, you can telnet into port 3105 and type in exit
  3. If you kill a tivosh script that accesses the mfs db it forces a reboot. mfs_ftp has a ping_pong "heartbeat" that shuts down the program if /var/mfs_ftp/abort.txt exists. The default interval is 15 mins. Abortcheck is also called whenever a new control channel is opened. So, create a file named /var/mfs_ftp/abort.txt, wait 15 minutes, mfs_ftp will exit, then delete the file abort.txt.

Optional: Have MFS_FTP autostart when TiVo Boots

Add mfs_ftp to the rc.sysinit.author file so it starts when TiVo boots.

  • Make the file system writable:
mount -o remount,rw / 
  • Start the Joe text editor and edit the rc.sysinit.author file:
joe /etc/rc.d/rc.sysinit.author
  • Go to the end of the file and add the following line:
/var/hack/mfs_ftp/mfs_ftp.tcl
  • Hit CTRL+K and then hit X to save the file and exit the joe text editor.
  • Mount the file system as read only:
sync
mount -o remount,ro /

Connecting to MFS_FTP

Use your FTP client on your PC to connect to your TiVo. Specify port 3105 and FTP Passive Mode to view shows available through MFS_FTP. (You will still connect to the standard port 21 for transferring all operating system files to/from your TiVo file system. Port 3105 is used exclusively for transferring recorded shows to/from the TiVo MFS database.)

Notes

Series 2 Insert Old TMF into New Software Version

Between software version updates, there can be changes to the metadata that goes along with an extracted show, preventing you from re-inserting a show extracted from a previous version of software.

To get around this, downloaded a (new) TMF file from your updated TiVo, extracted the XML (un-TAR the TMF), and inserted the XML into the old file. The result should be a successful upload that can be played.


===Series 2 Reinsert Problem (now fixed)===This Series 2 only issue was fixed with the patches but is left here for reference. If you need to insert a *.ty file back into your Series 2 TiVo (you should have used *.tmf or *.ty+), you may need to edit the following the file mfs_ftp.tcl and change this line:

set temp [string range $info(mc) 0 4] ; outd $p "header descriptor is \"$temp\""

to this (replace the 4 with a 3):

set temp [string range $info(mc) 0 3] ; outd $p "header descriptor is \"$temp\""

More info on extracting encrypted shows

Currently the only format to save/restore scrambled recordings is tmf. Be sure to backup the TiVo DiskConfigurationKey (DC_key.xml), which is created by running the get_DC_key.tcl utility through telnet. 3 things must match to play or decrypt a scrambled recording 1) CommercialSkipOffset keys (stored in ty+ or tmf archives); 2) tivo hard drive DiskConfigurationKey, 3) tivo motherboard crypto chip. If the DiskConfigurationKey has changed for any reason (re-imaged the drive- sw update - clear & delete) the correct DiskConfigurationKey (DC_key.xml) must be restored to play the files back on the original TiVo. They can't be played back on any other TiVo.

External References