====== Running get_iplayer on SRCF ====== Well, if you are here, congratulations - you are one of the elite of elites - you have to be a member of University of Cambridge, and you happen to have SRCF membership. This is a privilege that not many people have - a lot of people have gone through Cambridge without knowing SRCF. ===== Get get_iplayer running ===== Right now, SRCF comes with ffmpeg, but not AtomicParsley. The Perl environment is also incomplete for running get_iplayer. Here is what I have to do to get my get_iplayer installation running: (The lines started with ''#'' are comments.) # go to home directory, in case you are not there. cd ${HOME} mkdir -p ~/bin cd bin wget https://raw.githubusercontent.com/get-iplayer/get_iplayer/master/get_iplayer chmod +x get_iplayer # cpanminus and Perl local::lib, for running get_iplayer wget -O- "http://cpanmin.us" | perl - -l ~/perl5 App::cpanminus local::lib eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib` echo 'eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`' >> ~/.profile # AtomicParsley, for tagging the MP4 file. hg clone https://bitbucket.org/wez/atomicparsley cd atomicparsley ./autogen.sh ./configure --prefix ~ make make install cd ${HOME} ==== Update your get_iplayer ==== If your get_iplayer becomes outdated, you need to do this: cd ~/bin cd bin wget https://raw.githubusercontent.com/get-iplayer/get_iplayer/master/get_iplayer -O get_iplayer ===== How to deal with large video files. ===== As of 27/Aug/2018, an 1 hour video from iPlayer at the best quality costs about 2.4GB. With SRCF, you get only 1GB [(https://www.srcf.net/faq/managing-account)] of storage quota - I am not sure if you want to email the sysadmin to increase the quota. I prefer to to save my file elsewhere on the Internet. I do this my using ''sshfs''. SSHFS allows me to mount a remote storage server to SRCF, so when I download files, they get transferred to my storage server. ==== Edit your get_iplayer option file ==== cd ~ mkdir -p .get_iplayer mkdir -p mnt # Open up the editor nano .get_iplayer/options This is my get_iplayer option file: modes tvbest,radiobest subsembed 1 subtitles 1 nopurge 1 output mnt You can just copy and paste the content to the editor, then press ''Ctrl + O'' then ''Ctrl + X'' to exit. Note that I output my files to a folder called ''mnt''. ==== Generate SSH public/private a keypair ==== You only have to do the following once. This is for setting up the authentication. The following code segment contain what is displayed in your terminal. The lines which contain command you have to type starts with ''$'', the lines which contain comments start with ''#''. All other lines are terminal outputs. $ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/USERNAME/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/USERNAME/.ssh/id_rsa. Your public key has been saved in /home/USERNAME/.ssh/id_rsa.pub. The key fingerprint is: SHA256:A_RANDOM_FINGERPRINT USERNAME@pip Now, open up your notepad or your favourite text editor. Run the following in your terminal window: cat ~/.ssh/id_rsa.pub Copy the output to notepad, and save it as a text file, send it to your storage server operator. This is the preferred way of doing things, because a lot of instant messaging software corrupts the long text string. The output of your ''id_rsa.pub'' should look like this: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOR6on6Yfjc0h7dqdiMbmbHpGbKXGYt44thV94aMVKCS+JUR+QlMUxO+gL6vYt+Cjx0IoMg7c/v0hoXeUDaGMhzsy7QiCXJy1i+cHsr0y9DS2qaDTV3/jaSryysXjRKSN+OZnjD7UmHdkFuwUfKNJv7T1xlskO6qD4AScEG8mej8DprPmC1MTGVi9GjJJRA+ZO0xwL8CiCqOYp/a2dK7aV0gd1LuwvFQ0U+Cgho2geBe/ED7Ac82BhdZbinr4PGFyi21dY7Dtx930oqV59SdqhIpWzOOCUsx81HoRuX2087dgCZBmIX2Wg+/pR+tslVxEVZwvrQWYNwVQhFuaNlWSj fangfufu@smithsonian DO NOT DISCLOSE THE CONTENT OF id_rsa TO OTHER PEOPLE, INCLUDING YOUR SYSADMIN! As a reminder, public key authentication comes in two keys - the public key and the private key. The public key can be shown to everyone, it is used for encryption. The private key is used for decryption. Therefore you can show your public key to everyone, but you need to keep your private key secret. ''id_rsa.pub'' contains the public key, while ''id_rsa'' contains the private key. ==== Using SSHFS ==== After logging into SRCF, to mount a remote folder locally, do the following: sshfs fangfufu.co.uk:/home/USERNAME mnt This assumes that you are at your home directory, if you are not, you can always change into your home directory by typing in: cd ~ Note that ''mnt'' is the directory which you set to store your file in your previous section. This will effectively change ''mnt'' folder into an anchor point for your remote storage location. Everything you write into ''mnt'' will be transferred to your remote server. When you are done, you should disconnect the SSHFS, by doing the following: fusermount -u mnt