Register
It is currently Fri Jul 25, 2014 12:42 am

Automatic media ripper for media server


All times are UTC - 6 hours


Post new topic Reply to topic  [ 10 posts ] 
Author Message
 PostPosted: Wed Sep 25, 2013 11:01 pm   

Joined: Wed Sep 25, 2013 9:39 pm
Posts: 7
Note to Moderator: I'm not looking for someone to write this script for me, but this topic didn't seem to fit elsewhere. If I should have posted it somewhere else, please feel free to move it for me. Thanks!

Cheers, everyone! I'm new to bash scripting but an expert with Windows shell scripting so I hope to pick things up quickly. I have one major project in mind and I'm looking for input, please.

OVERVIEW: Insert a CD, DVD or BD into a headless (linux-based) media server and have it auto-ripped then ejected.

ADDITIONAL DETAILS: Disc is identified using look-up services (e.g. CDDB) and output files named/stored according to my preferences. Cover art is automatically looked up and downloaded. When the rip is finished, I receive an SMS notification and an email allowing me to quickly/easily rename/move the ripped file(s) and change the cover art.

I'll provide some examples below to fully explain all the functionality I'm shooting for.


Last edited by Donny Bahama on Wed Sep 25, 2013 11:56 pm, edited 3 times in total.

Top
 Profile  
 PostPosted: Wed Sep 25, 2013 11:01 pm   

Joined: Wed Sep 25, 2013 9:39 pm
Posts: 7
EXAMPLE 1:
I insert the CD "Vavoom!" by The Brian Setzer Orchestra.
The media server, configured to run my auto-rip script when a CD is inserted, looks up the CD on CDDB and gets the genre, artist, album, and track name info.
Tracks are ripped and stored using my preferred directory structure of Genre/Artist/Album
CD is ejected
I receive an email with the subject, "Your media has been ripped" and a message body stating, "Vavoom by The Brian Setzer Orchestra has been ripped and stored in /home/Music/Rock/The Brian Setzer Orchestra/Vavoom. Click here to rename or move these files."
When I click the link, I'm taken to a web page, served up by my headless media server. It shows the cover art image that was downloaded and has drop-down menus for genre as well as alternate permutations of the artist (The Brian Setzer Orchestra | Brian Setzer Orchestra, The | Setzer, Brian Orchestra, The) and album names (where applicable).
I make my desired changes, find a better cover art image and paste the url into the field below the displayed cover art image and click Submit.
New cover art is downloaded and previously downloaded cover art is deleted, ID3 tags are updated, files are renamed accordingly, and moved to /home/Music/Swing/Setzer, Brian Orchestra, The/Vavoom.
DONE!


Top
 Profile  
 PostPosted: Wed Sep 25, 2013 11:02 pm   

Joined: Wed Sep 25, 2013 9:39 pm
Posts: 7
EXAMPLE 2:
I insert the DVD "High Plains Drifter"
The media server, configured to run my auto-rip script when a DVD is inserted, looks up the DVD then queries IMDB and scrapes the page to get the release year.
The movie - main title only - is ripped using makeMKV and stored in /home/reencode.temp as "DVD-High Plains Drifter (1973).mkv"
When MakeMKV is finished, Handbrake sees the file in /home/reencode.temp and begins a reencode using the settings for DVDs.
Handbrake outputs the file "High Plains Drifter (1973).mkv" in /home/Movies/SD.
DVD is ejected.
I receive an email with the subject, "Your media has been ripped" and a message body stating, "High Plains Drifter (1973) has been ripped and stored as /home/Movies/SD/High Plains Drifter (1973).mkv. Click here to rename or move these files."
The cover art image that was downloaded looks fine and everything else is as desired. I delete the email
DONE!


Top
 Profile  
 PostPosted: Wed Sep 25, 2013 11:04 pm   

Joined: Wed Sep 25, 2013 9:39 pm
Posts: 7
EXAMPLE 3:
I insert the Blu-ray disc, "Life of Pi"
The media server, configured to run my auto-rip script when a BD is inserted, looks up the BD then queries IMDB and scrapes the page to get the release year.
The movie - main title only - is ripped using makeMKV and stored in /home/reencode.temp as "BD-Life of Pi (2012).mkv"
When MakeMKV is finished, Handbrake sees the file in /home/reencode.temp and begins a reencode using the settings for DVDs.
Handbrake outputs the file "High Plains Drifter (1973).mkv" in /home/Movies/HD.
BD is ejected.
I receive an email with the subject, "Your media has been ripped" and a message body stating, "Life of Pi (1973) has been ripped and stored as /home/Movies/HD/Life of Pi (2012).mkv. Click here to rename or move these files."
No cover art image was found, so I click one of two supplied links (prepopulated to search for "Life of Pi") - IMDB or Google Images (which open in a new window/tab), find the desired image and copy the url for it. I close the new tab, and paste the url. Everything else is as desired. I click submit.
DONE!


Top
 Profile  
 PostPosted: Wed Sep 25, 2013 11:06 pm   

Joined: Wed Sep 25, 2013 9:39 pm
Posts: 7
EXAMPLE 4 (This one is tricky!):
I insert disc 1 for Dexter, Season 1. The disc contains 4 episodes. If it was disc 2 of season 1, or any disc of any subsequent season, I could check /home/TV to see that it's a TV show - and even find out which season/the last episode I ripped (so I know where to start my numbering.)
The good news is, if I query IMDB for Dexter, I can scrape the page to see that it's a "TV Series" and get IMDB's ID number for Dexter (tt0773262). I can then scrape http://www.imdb.com/title/tt0773262/episodes?season=1 to get episode titles.
In the end, I can make necessary corrections via the web page, but this is still pretty tricky any way you slice it.


Top
 Profile  
 PostPosted: Wed Sep 25, 2013 11:24 pm   

Joined: Wed Sep 25, 2013 9:39 pm
Posts: 7
Additional notes:

1. I chose to have emails sent because it's a headless server - and I if I need to make any changes, I have to have some way to interact with it. I'm open to other suggestions but...
2. I can do the renaming and moving files using server-side scripting - and I'm quite comfortable with php.
3. The reason for the SMS notifications is that I'll be checking and acting upon the received emails on my iPhone, and I don't have push email. That said, if i can't find a free SMS gateway (suggestions?), I'll probably scrap the text message notifications.
4. I'll also want every email to also tell me where I stand on available disk space.
5. I also plan to incorporate a search page that allows me to specify the content type (Music, Movie, TV) and search for a title, then select it and rename/edit/delete it if desired.


Top
 Profile  
 PostPosted: Wed Sep 25, 2013 11:41 pm   

Joined: Wed Sep 25, 2013 9:39 pm
Posts: 7
In general, I'm confident that I'll be able to learn how to parse text, scrape web pages, form variables and insert them into commands. Everything this script will do needs to be done from the command line, without user interaction. I know MakeMKV will rip DVDs and BDs via command line, and Handbrake will reencode them via command line, BUT...

1. Can someone recommend a good command line CD ripper? (Hopefully something equivalent to Exact Audio Copy)
2. How can I look up a CD on CDDB from a shell script? What about a DVD? Or a Blu-ray?
3. Can someone recommend a command line util or script for populating ID3 tags?
4. The links in the emails will point at the web server on my media server (home/local network only). I don't think I want/need to be able to respond to the notification emails when I'm outside my home network - or what would be involved in making those pages available from anywhere via the internet. Obviously, not doing so would allow me to forego a lot of security and authentication measures. Any thoughts on this?


Top
 Profile  
 PostPosted: Thu Sep 26, 2013 4:34 pm   
User avatar

Joined: Fri Jul 22, 2011 5:39 pm
Posts: 46
RipEnc

RipEnc is a bourne shell script frontend to Cdparanoia, cdda2wav,
tosha and Bladeenc, 8hz-mp3, l3enc. It utilizes CDDB lookups to
automate the naming of songs as they are ripped. A manual naming
option is also available. The entire CD can be ripped or you can pick
the songs to rip. ID3 tags are also supported.

says http://tldp.org/HOWTO/text/MP3-HOWTO


Top
 Profile WWW  
 PostPosted: Mon Oct 28, 2013 5:36 am   

Joined: Mon Oct 28, 2013 5:31 am
Posts: 1
Donny Bahama wrote:
In general, I'm confident that I'll be able to learn how to parse text, scrape web pages, form variables and insert them into commands. Everything this script will do needs to be done from the command line, without user interaction. I know MakeMKV will rip DVDs and BDs via command line, and Handbrake will reencode them via command line, BUT...

1. Can someone recommend a good command line CD ripper? (Hopefully something equivalent to Exact Audio Copy)
2. How can I look up a CD on CDDB from a shell script? What about a DVD? Or a Blu-ray?
3. Can someone recommend a command line util or script for populating ID3 tags?
4. The links in the emails will point at the web server on my media server (home/local network only). I don't think I want/need to be able to respond to the notification emails when I'm outside my home network - or what would be involved in making those pages available from anywhere via the internet. Obviously, not doing so would allow me to forego a lot of security and authentication measures. Any thoughts on this?


A friend recently ripped his entire DVD collection to common formats using this:

http://www.appgeeker.com/convert/rip-dvd-to-avi-mac.html

I don't know if it will do what you want though. Give it a shot.


Top
 Profile  
 PostPosted: Sun Nov 17, 2013 12:35 am   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 662
Location: Des Moines, Iowa
hmmmmmm seems like a great thing for handbrake-cli and to use Plex for the media server... automating all that would be fairly simple. Plex can automatically download images and tag all the new stuff if you want it to.


Top
 Profile WWW  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Majestic-12 [Bot] and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP