Microsoft Windows Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Saturday, 16 June 2012

How To Automatically Download TV Shows to Your Mac

Posted on 14:10 by Unknown
So you've read the Perl programming language articles here on Macinstruct, and you're feeling more comfortable with Perl in general. Now you're wondering how to use this information to do something cool. How about building a solution that automatically downloads TV shows to your Mac?

That's right. With some free tools, a little configuration, and a few hundred lines of Perl, you can automatically download new episodes of TV shows to your Mac. But that's not all. This solution will also automatically convert the shows and import them into iTunes with the TV show name, episode name, season number, and episode number. Let's get started!

How This Works

Let's talk for a minute about how this solution works, and what it will do. First, you'll subscribe to TV shows with an application called TVShows 2. It will always be watching for new torrents of the TV shows that you subscribe to. When TVShows 2 finds a new episode, it will automatically download the torrent, and then Transmission will start downloading the file. After the download completes, Transmission will call a helper file which you'll create later. That file will call import.pl, which will convert, name, and import your brand new episode into iTunes.

First, Some Words of Warning

By now, you've probably realized what this means. You could download practically any TV show to your Mac, automatically and for free. But you might be breaking the law by doing so. You should not download TV shows unless a copyright owner has released them for free distribution. It's your responsibility to comply with federal and international regulations.
If nothing else, please consider the people who create and produce the shows you love. These people rely on advertising revenue for their livelihoods, and a show's continued success depends on the number of viewers who regularly, and legally, watch it. Wouldn't you want to be paid for the work you do?

Getting the Right Tools for the Job

First, go ahead and download the following applications and files:
  • The super-cool TVShows 2 application
  • Transmission (a BitTorrent client)
  • HandbrakeCLI (a command line interface to the best video converting tool available)
  • A few pre-made Perl scripts that I wrote myself
We'll show you want to do with them in just a moment.

Subscribing to TV Shows

TVShows 2 is a free preference pane that lives in System Preferences. Once installed and configured, it watches for new episodes and automatically downloads new files when they become available. This is the backbone of our automated TV show downloading system, but it's worth noting that this application can also be used independently, without our nifty Perl scripts.
Now you should use TVShows 2 to subscribe to your favorite TV shows. Here's how:
  1. From the Apple menu, select System Preferences.
  2. Select TV Shows, as shown below.

  3. Click the Add Show button, as shown below.

  4. Subscribe to whichever shows you want to automatically download.
TVShows 2 is now configured to download TV shows to your Mac.

Configuring TVShows 2

Next, let's configure TVShows 2 to work with Transmission and our Perl scripts. This will help create a seamless integration between the applications, so you won't even notice the episodes downloading. Everything will happen in the background, without you having to do anything.
Here's how to configure TVShows 2:
  1. In the TVShows 2 preferences pane, click Preferences. The window shown below appears.

  2. Verify that Episode naming convention is set to S01E01.
  3. Verify that the Automatically open each Torrent file after download checkbox is selected.
  4. Select an a Episode save location. It doesn't matter what you select - just remember what it is.
  5. Close System Preferences
That's it! You've configured TVShows 2 to automatically download the TV shows you subscribed to.

Configuring Transmission

Now let's configure Transmission, the free BitTorrent client, to automatically download the torrents that are found by TVShows 2. Without this application, you wouldn't have a way of downloading the episodes to your Mac! Here's how to configure Transmission:
  1. Open the Transmission application.
  2. From the Transmission menu, select Preferences.
  3. Click Transfers. The window shown below appears.

  4. Verify that the Start transfers when added checkbox is selected.
  5. Verify that the Display a window when opening a torrent file checkbox is deselected.
Note that you do not need to have the Auto add checkbox selected. TVShows 2 will do that work for you.

Preparing Perl

Once you have downloaded and installed the applications, use the skills you learned in Using CPAN to Extend Perl on Mac OS X to download the following dependencies from CPAN:
  • Log::Log4perl
  • LWP::UserAgent
  • HTTP::Request
  • HTTP::Response
Next, make sure "import.pl" is executable by entering the following command in the Terminal application:
chmod +x import.pl
Remember? You learned how to do that in Getting Started with Perl on Mac OS X.

Putting the Pieces Together

Things are coming together nicely. We've installed the Perl dependancies and configured TVShows 2 and Transmit. Now we just need to glue everything together so it works seamlessly and automatically! Here's how:
  1. Open a text editor, such as TextWrangler.
  2. Paste following in a file named begin_import.sh:
    #!/bin/bash
    cd ~/Desktop/ && ./import.pl $TR_TORRENT_NAME"
  3. That code will work if you are downloading your TV Shows to your desktop. If not, change ~/Desktop to the appropriate directory.
  4. Save the file in a safe place.
  5. Open the Transmission application.
  6. From the Transmission menu, select Preferences.
  7. Click Transfers, and then click Management. The window shown below appears.

  8. Select the Call script checkbox.
  9. From the file selection window that appears, select the begin_import.sh so it's called when Transmission completes a download.
That's it! From now on, your Mac will automatically download TV shows when new episodes become available.

Final Thoughts

To recap, here's what's happening. TVShows 2 is always watching for new torrents of TV shows. When it finds one, it automatically downloads the torrent and Transmission starts downloading the file. When the download completes, Transmission calls the helper file (begin_import.sh), which calls import.pl, and converts, names, and imports your brand new episode into iTunes. Of course, once the shows are in iTunes, you can transfer them to your iPad, iPhone, or iPod Touch.
Enjoy your new TV shows! To keep improving your Perl chops, you may want to dive into those files that you downloaded from GitHub and look around. If you see something wonky, or if you have an improvement, be sure to fork the repo and submit changes!
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in | No comments
Newer Post Older Post Home
View mobile version

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Another Microsoft Guru Steps Down
    Microsoft announced on Monday that company veteran Craig Mundie has stepped down from his post as chief of research and will retire in th...
  • how linux is built
  • UK women are 'fattest in Europe'?
    The UK has more obese women than any other country in Europe, according to European Union figures. Data agency Eurostat, which looked at 19...
  • Lenovo Is Now World's Third Biggest Smartphone Maker Title
    Lenovo  pushed LG aside in the third quarter to become the number three global smartphone maker for the first time.  Lenovo's smartphone...
  • Wow: Blizzard Gives a Thumbs Up to World of StarCraft
    After World of StarCraft Youtube videos the world over went dark a couple days ago, fans immediately began to bury the ambitious mod under p...
  • Neo Geo Game makes come back
    Releasing December 6, the Neo Geo X Gold Entertainment System is a handheld that plays classic Neo Geo arcade games. In addition to the h...
  • Is China's space program a new threat to America'?
    On Sunday, China's Shenzhou-9 spacecraft successfully docked with the orbiting Tiangong-1 space lab, heralding the Asian superpower...
  • US,NATO missile shield in Spain
    The Spanish government has agreed to participate in NATO's anti-missile shield that will see specialized United States warships based ...
  • How to Use: A Windows Installer Disc to Back Up Your Files When Your Computer Won’t Boot
    If Windows won’t boot, recovering your files can be a headache.  You do n0t have to pull the hard drive or use a Linux live CD – you can use...
  • Is american flag still standing on moon?
    Apollo mission remnants can be seen by the Lunar Reconnaissance Orbiter When astronauts first touched down on the moon in 1969 as part of NA...

Categories

  • 3 D printers
  • 360s
  • amazon
  • android
  • animation
  • apple
  • bing
  • book
  • boxee
  • browser
  • china
  • chrome
  • console
  • dicaprio
  • domain
  • ecommerce
  • facebook
  • ferrari
  • finland
  • gadget
  • galaxy
  • games
  • gmail
  • google
  • hosting
  • HTC
  • internet
  • ipad
  • iphone
  • iphoto
  • iwatch
  • japan
  • keyborad
  • lenovo
  • linux
  • lunar
  • microsoft
  • mobile
  • moon
  • movil
  • ms
  • names
  • new tech
  • Nokia
  • online
  • password
  • pc
  • phone
  • retails
  • samsung
  • search
  • smartphone
  • software
  • space
  • tablet
  • tech
  • text messages
  • track
  • trip
  • usres
  • web
  • whatsapp
  • whois
  • window
  • words
  • xbox

Blog Archive

  • ►  2013 (160)
    • ►  December (1)
    • ►  November (9)
    • ►  September (5)
    • ►  August (8)
    • ►  July (19)
    • ►  June (12)
    • ►  May (23)
    • ►  April (3)
    • ►  March (5)
    • ►  February (18)
    • ►  January (57)
  • ▼  2012 (340)
    • ►  December (25)
    • ►  November (34)
    • ►  October (24)
    • ►  September (27)
    • ►  August (26)
    • ►  July (46)
    • ▼  June (83)
      • China's spacecraft returns to Earth Successfully
      • A flying drone 'hack' into by University of Texas ...
      • Do Want To Easily Watch Netflix and Hulu From Any...
      • BlackBerry maker to cut jobs, delays new platform
      • Google takes browser battle to iPhone and iPad
      • New York Times to launch Chinese news website
      • Google unveils Nexus 7 tablet computer
      • US bans Samsung Galaxy Tab 10.1
      • MI5:fighting 'astonishing' level of cyber-attacks
      • India Aakash is 'world's cheapest tablet' £26
      • UK women are 'fattest in Europe'?
      • Are British women's waists 'too big'?
      • China Deep sea and space exploration
      • China Shenzhou-9 spacecraft makes first manual doc...
      • How to Move Your Email to Another Mac
      • How to Benchmark Your Mac
      • How to Hide the Explicit Label in iTunes
      • your Internet data still be there in 100 years?
      • Facebook now lets you edit comments
      • Europe Outpaced America in High Speed Train
      • Ellison Oracle Software CEO To Buy Lanai Island
      • A photogragher Filled A Battery Charges Against Ju...
      • Asia's millionaires outtop America's
      • Facebook and Yahoo! in patent fight
      • Engineers build smallest, fastest digital gigapixe...
      • Spotify offers free Internet radio in US
      • With tablet, Microsoft takes page from Apple
      • Oracle to buy back $10 billion more in stock
      • Panasonic's Android-based 'toughpad' unveiled in Asia
      • US has regain top spot for fastest supercomputer
      • Facebook buys face recognition technology startup
      • Microsoft To Acquire Business Social Network Yamme...
      • Bill Gates
      • Larry&Sergen
      • Steve Jobs biography
      • Remotely Lock Your iPad
      • First Apple computer fetches $374,000
      • Entreprenuer tech
      • How to Change Your Mac's DNS Servers
      • How to Find the Best DNS Servers
      • How To Automatically Download TV Shows to Your Mac
      • Facebook chief technical officer leaving for startup
      • The Best Pub Theatres in London
      • UK web 'snooping' plans outlined
      • Skype now has ads in its free Internet phone calls
      • Will the end of Facebook comes?
      • Linux creator, stem cell scientist win big technol...
      • Apple enlists TomTom as Siri heads for cars
      • Apple ditches Google Maps
      • words of thought
      • How To Export Your AirPort Extreme Configuration
      • China's historic spacecraft docking mission will a...
      • Spain's Telefonica sells China Unicom stake
      • Military launches fastest plane ever
      • These 7 inventors got killed by thier own inventions
      • Microsoft and Google To have Do Not Track as optio...
      • China to carry out manned space flight
      • Japan's Sharp, Hon Hai to make China smartphones
      • Australia: Apple to pay $2.22 mn fine over Austral...
      • Ubisoft plays hard at E3 videogame conference
      • Words of thought
      • Britain:Can Games industry can help economy to bou...
      • Facebook to release ID of users who abused woman o...
      • Why talking-to-text has taken off in China
      • South Korea-based WeMade computer game giant takes...
      • Twitter unveils new bird trademark
      • Samsung vows US launch of Galaxy despite Apple suit
      • word of life
      • Netflix Has Now builds its own delivery network
      • Internet Addresss?:The Internet now has 340 trilli...
      • Napster creators launch video service via Facebook
      • Germany To Cut in Solar Subsidies to Limit Boom
      • Google buys mobile document maker Quickoffice
      • Google and other investors to invest $1.5 billion...
      • Samsung unveils computers running on Windows 8
      • Facebook explores access for kids under 13
      • US: tech war battleship
      • The Whole World Has upgrade Internet address system
      • Britain:Cyber strikes a 'civilised' option
      • Here’s How to Download Windows 8 Release Preview R...
      • How To Seamlessly Dual-Boot Windows 7 and Windows ...
      • Netflix tops Apple in booming US online movies
      • Google victory in Oracle copyright fight
    • ►  May (42)
    • ►  April (33)
Powered by Blogger.

About Me

Unknown
View my complete profile