SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV v7 Customizations > Batch Metadata Tools
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

Batch Metadata Tools This forums is for discussing the user-created Batch Metadata Tools for SageTV.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-27-2012, 03:42 PM
adone36 adone36 is offline
Sage Advanced User
 
Join Date: Nov 2007
Posts: 142
Need help with scraper.

I use MCE and Tivo to record via cablecards and import these to Sage so Sage handles everything.

I have software which decrypts the originals and converts them to mpg, comskips, etc. These programs also allow for file renaming using metadata. I originally used "ShowName--EpisodeTitle".mpg and this was working fine until I ran into how lame MCE guide info and recording capabilities are. The guide in MCE will frequently have shows with generic metadata. Like 10 showings of "Mythbusters" where the description says "Two guys do stuff". MCE will record these even though set for "new" show only in the series and the episode title will then be blank. This gives a bunch of conversions with the same title:
"Mythbusters----".mpg. To fix this I have to add record date and time to prevent duplicate files, "Mythbusters--Bouncing Bullet--05242012-2000".mpg

I don't get metadata when BMT scrapes now, although I get fanart. I believe the scraper loojs for the -- and says everything to the left is Show name and to the right Episode name, which doesn't work. How can I change the syntax in the scraper to find only the Episode name? Ideally i would like to also have broadcast date and time since BMT uses file creation dates for these and that causes other little problems with display.

Both conversion programs allow me to format the file name anyway i want with month day year hour and minute so I can set the easiest thing to parse. If there was a scraper parsing multiple variables I could look at, I might be able to construct one, but so far what I've tried doesn't work.
Reply With Quote
  #2  
Old 05-28-2012, 10:36 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
The scrapers for tv filenames are here...
http://code.google.com/p/sagephoenix...%2Ftvfilenames

You can see that there is a separate file for each filename type that bmt/phoenix supports.

If you create your own scraper (which is basically an XBMC regex scraper) then you drop it into the scraper directory, reload the configurations, and then it should pick up the new scraper.

A scraper is basically made of a "functions" that know how to parse out certain key pieces of information from a filename.

For example, the "Series--Episode" scraper looks like this.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!-- 
   TV Filename Scraper.  Used to scrape shows with the format Show dash dash Episode
   NOTE: Show and Episode MUST be separated by 2 dashes 
   
   contributed by evilpenguin
-->
<scraper name="title-show-episode" content="filename" thumb="thumb.png">
        <!--    input:          $1=complete file uri -->
        <!--    returns:        series name -->
        <GetShowName dest="3">
                <RegExp input="$$1" output="\1" dest="3">
                        <expression>.*[/\\]([^/\\-]+)--([^/\\]+)\.[a-zA-Z0-9]+$</expression>
                </RegExp>
        </GetShowName>

        <!--    input:          $1=complete file uri -->
        <!--    returns:        Episode Title -->
        <GetEpisodeTitle dest="3">
                <RegExp input="$$1" output="\2" dest="3">
                        <expression>.*[/\\]([^/\\-]+)--([^/\\]+)\.[a-zA-Z0-9]+$</expression>
                </RegExp>
        </GetEpisodeTitle>
</scraper>

There is a GetShowName (ie Series) and a GetEpisodeTitle function in this scraper.  I use the same "regex" for both, but I change the "output" to select either group 1 or group 2.

If you understand xml and regex, then this is pretty trivial to build a new scraper... if you don't then it's going to be a painful experience :(
Reply With Quote
  #3  
Old 05-28-2012, 10:52 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
btw... changing the regex to this... might actually work for you...

Quote:
.*[/\\]([^/\\-]+)--([^-]+)--.*
And this would find shows like..
Series--Episode--OTHER DATA

If you want to include a date, then you need to implement a <GetAiredDate dest="3"> function in your scraper that parses out the date in the format YYYY-MM-DD.

You can look at the Title-AiredDate scraper to see how it pulls out the date.

And keep in mind, you can have all these things in your filename, and scraper, as long as the scraper knows how to parseit out...

Series--EpisodeTitle--YYYY-MM-DD OTHER DATA.avi
Reply With Quote
  #4  
Old 05-28-2012, 11:41 AM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
adone36,

Have you check out MC TVConverter. It will rename automatically and compress etc.. using the WMC metdata. I use this to rename the files .. I import them into sage... and Stucklesses BMT does the rest.
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct.
Reply With Quote
  #5  
Old 05-29-2012, 09:50 AM
adone36 adone36 is offline
Sage Advanced User
 
Join Date: Nov 2007
Posts: 142
Thanks Sean! I'll give it a try. I did notice that in shows where there is a epi name, the existing scraper is picking it up often. I believe you said BMT uses each scraper until it gets a "hit". Is there a hierarchy to that? Does it try in any specific order??

NYPlayer,

I use MCE-TVconverter for MCE and kttmg for Tivo. The major problem is the poor metadata in MCE forces me to use the above naming convention to prevent bunches of duplicate file names. I convert to MPG because this is v fast since these formats are basically encrypted MPG containers. I suppose I could use mp4 since it can store the original metadata, but I haven't tested that to see how BMT or Sage would handle those.

Last edited by adone36; 05-29-2012 at 09:53 AM.
Reply With Quote
  #6  
Old 05-29-2012, 12:59 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by adone36 View Post
Thanks Sean! I'll give it a try. I did notice that in shows where there is a epi name, the existing scraper is picking it up often. I believe you said BMT uses each scraper until it gets a "hit". Is there a hierarchy to that? Does it try in any specific order??
I don't think there is an order, or if there is, it's probably just based on alphabetical filename. So, if you make a scraper, be sure to call it "adone_tv.xml" and that might put it at the front the on line, since I don't think there are other scrapers that start with a
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
TV.com automatic scraper roxy99 SageTV Customizations 141 10-27-2010 09:08 PM
Movie trailer scraper jaminben SageTV v7 Customizations 13 07-18-2010 09:37 AM
Looking for Title/Season/Episode naming formats to support for metadata scraper evilpenguin General Discussion 17 01-08-2009 04:43 PM
Properties file and genre for a possible IMDB scraper. mherce SageTV Customizations 4 06-28-2008 05:29 AM


All times are GMT -6. The time now is 07:17 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.