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 11-28-2011, 08:02 PM
infocus13's Avatar
infocus13 infocus13 is offline
Sage Advanced User
 
Join Date: Aug 2007
Posts: 199
Question Help! Get seasons & episode data from filename??

Hi guys

I have a fairly simple problem, which seems to be very difficult to solve! Hoping someone can help me out.

1. I'm running SageTV + Phoenix + BMT. Latest versions for everything.
2. I live in Australia & grab my EPG data from OzTivo and use LM Gestion's importer to get it into SageTV.
3. It appears that OzTivo includes the Season & Episode info in the show title. So my shows are title as follows: "TheBigBangTheory-Season3Episode10TheGorillaExperiment-13916457-0.mpg"
4. I have verified the above using BMT - season & episode fields are left blank and the show title is "Season 3 - Episode 10 - The Gorilla Experiment"

So my problem is simple. How do I parse the season & episode info from the title into the season & episode fields in SageTV/BMT to enable accurate grouping by season?

So far I've tried:

1. Renaming files to the format "showTitle-s01e01-episodeTitle.mpg". I don't like this approach & would like to avoid using it.
2. MediaTitles.xml - as far as I can tell there is no way to accomplish the above using XML?
3. Changing the way SageTV names its recordings - cant do it as far as I can tell.

Is there anything I can do at all?

Thanks for your help in advance.
Reply With Quote
  #2  
Old 11-28-2011, 08:55 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by infocus13 View Post
Hi guys

I have a fairly simple problem, which seems to be very difficult to solve! Hoping someone can help me out.

1. I'm running SageTV + Phoenix + BMT. Latest versions for everything.
2. I live in Australia & grab my EPG data from OzTivo and use LM Gestion's importer to get it into SageTV.
3. It appears that OzTivo includes the Season & Episode info in the show title. So my shows are title as follows: "TheBigBangTheory-Season3Episode10TheGorillaExperiment-13916457-0.mpg"
4. I have verified the above using BMT - season & episode fields are left blank and the show title is "Season 3 - Episode 10 - The Gorilla Experiment"

So my problem is simple. How do I parse the season & episode info from the title into the season & episode fields in SageTV/BMT to enable accurate grouping by season?

So far I've tried:

1. Renaming files to the format "showTitle-s01e01-episodeTitle.mpg". I don't like this approach & would like to avoid using it.
2. MediaTitles.xml - as far as I can tell there is no way to accomplish the above using XML?
3. Changing the way SageTV names its recordings - cant do it as far as I can tell.

Is there anything I can do at all?

Thanks for your help in advance.
BMT uses "scrapers" to scrape the filenames. They are basically an mix of xml and regular expressions. I've provided a handful of the most common scraper formats, but, I don't have a scraper for the format that you have -provided.

If you feel confident, you can try your hand at creating a scraper... they are located in the STVs/Phoenix/scrapers/xbmc/tvfilenames/ directory.
Reply With Quote
  #3  
Old 11-28-2011, 08:57 PM
infocus13's Avatar
infocus13 infocus13 is offline
Sage Advanced User
 
Join Date: Aug 2007
Posts: 199
Quote:
Originally Posted by stuckless View Post
BMT uses "scrapers" to scrape the filenames. They are basically an mix of xml and regular expressions. I've provided a handful of the most common scraper formats, but, I don't have a scraper for the format that you have -provided.

If you feel confident, you can try your hand at creating a scraper... they are located in the STVs/Phoenix/scrapers/xbmc/tvfilenames/ directory.
Thanks Stuckless. Two questions:

1. What is the best way to learn how to write a scraper? I've mastered VFS so I can learn this as well, but what is a good guide? The BMT manual?

2. How do I "activate" a scraper once I have written one? Is that in the user guide? What is the naming convention for the file, etc?

Cheers
Reply With Quote
  #4  
Old 11-28-2011, 09:06 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
I haven't tested this, but the following scraper should work, or at least be a good starting point.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!-- 
   TV Filename Scraper.  Used to Scrape Show Name, Season and Episode from a given file URI
   $$1 is always the complete file uri
-->
<scraper name="title-Season00Episode00" content="filename" thumb="thumb.png">
	<!-- 	input: 		$1=complete file uri -->
	<!-- 	returns: 	show name -->
	<GetShowName dest="3">
		<RegExp input="$$1" output="\1" dest="3">
			<expression>.*[/\\](.*)-Season([0-9]+)Episode([[0-9]+)</expression>
		</RegExp>
	</GetShowName>

	<!-- 	input: 		$1=complete file uri -->
	<!-- 	returns: 	Season #-->
	<GetSeason dest="3">
		<RegExp input="$$1" output="\2" dest="3">
			<expression>.*[/\\](.*)-Season([0-9]+)Episode([[0-9]+)</expression>
		</RegExp>
	</GetSeason>
	
	<!-- 	input: 		$1=complete file uri -->
	<!-- 	returns: 	Disc #-->
	<GetEpisode dest="3">
		<RegExp input="$$1" output="\3" dest="3">
			<expression>.*[/\\](.*)-Season([0-9]+)Episode([[0-9]+)</expression>
		</RegExp>
	</GetEpisode>
</scraper>
Reply With Quote
  #5  
Old 11-28-2011, 09:10 PM
infocus13's Avatar
infocus13 infocus13 is offline
Sage Advanced User
 
Join Date: Aug 2007
Posts: 199
Quote:
Originally Posted by stuckless View Post
I haven't tested this, but the following scraper should work, or at least be a good starting point.
You rock. Will try this out tonight.

Thanks.
Reply With Quote
  #6  
Old 11-28-2011, 09:15 PM
infocus13's Avatar
infocus13 infocus13 is offline
Sage Advanced User
 
Join Date: Aug 2007
Posts: 199
Actually, one more question stuckless....

Reading the userguide again, you have the following scraper already defined:

"Series S##E##
This is used to match TV shows in the format “SeriesName S##E##.ext”
Examples
House s01e01.avi
House - S01E01 - Episode Title.avi
Lie to Me s02e03.avi
Lie to Me - s01e01 - Pilot Episode.avi"

My files are named almost as per the second example (bolded) above. So if I just go in & amend that scraper to change "S" to "Season" and "E" to "Episode" - would that work??
Reply With Quote
  #7  
Old 11-29-2011, 12:16 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
It should work... (I say should, becuase I'm not 100% sure)
Reply With Quote
  #8  
Old 12-05-2011, 02:28 AM
infocus13's Avatar
infocus13 infocus13 is offline
Sage Advanced User
 
Join Date: Aug 2007
Posts: 199
Quote:
Originally Posted by stuckless View Post
It should work... (I say should, becuase I'm not 100% sure)
Ok, we're getting there...

The scraper in your other post did not work. However, I did manage to change the season & episode format to "S01E01".

So now my filenames look like this:

TheBigBangTheory-S2E09TheWhiteAsparagusTriangulation-13920147-0.mpg

However, the default scraper included with BMT (Title-s00e00.xml) does not seem to work... I still don't get any season or episode details populated into BMT when the file is in the new format. S/E fields are blank.

Any ideas on what am I doing wrong?

Thanks.
Reply With Quote
  #9  
Old 07-25-2017, 02:02 PM
Oatz Oatz is offline
Sage User
 
Join Date: Jan 2009
Posts: 18
This may be a dead thread, but if you are still looking for this, there is an option in:
Sage/Setup/Detailed Setup/Customize"
"Include Season and Episode Numbers in Filenames"

Turn this on and optionally make sure
"Include Episode Names in Filenames"

Is also turned on!
Win!
__________________
Capture Server: Sage 9 - i7 16gb 256gb SSD Windows 10 32bit
3 x Colossus with 3 Rogers HD STBs - Firewire Blasting via FWproxy, EXE Tuner
NAS: Win 7 - Dual Xeon, 48gb, 9TB Raid 6 Array w/ Comskip running in DirMon
Clients: HD300

Have hardware like mine and need help? Just PM me
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
How do you like to rip bluray tv seasons? medwynd Sage My Movies 38 05-10-2011 09:59 AM
TV View seperates some seasons? jusjoken Batch Metadata Tools 1 11-11-2010 06:38 PM
Season/Episode in filename svalmorri SageMC Custom Interface 6 09-24-2009 09:42 PM
More than 9 seasons? bigo93bronco SageTV Software 2 09-23-2009 08:17 PM
Episode data - recording error; need suggestions Surtr SageTV Software 7 07-30-2008 01:58 AM


All times are GMT -6. The time now is 01:29 PM.


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