|
Batch Metadata Tools This forums is for discussing the user-created Batch Metadata Tools for SageTV. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
Matching TV shows with only Series/Episode name
I know that BMT supports looking up shows with just the Title/Episode name since it does it for Sage Recordings, but is it possible to get BMT to do that with an imported video?
For example, i'm messing around with some new PlayOn features where I create dummy videos to represent online content and then let Sage import/scrape/organize them. For most shows off Hulu/Netflix i'm able to determine the proper season/episode information and generate an easily scrapable file name, however, some DVD sets on Netflix are done in collections of random episodes (i.e. Mythbusters) and the best I can do for those is just name them Code:
Series - Episode.mkv
__________________
Clients: 1xHD200 Connected to 50" TH-50PZ750U Plasma Server : Shuttle SFF SSH55J2 w/ Win7 Home, SageTV v7, Core i3 540, 2GB RAM, 30GB SSD for OS, 1.5TB+2x1TB WDGP for Recordings, BluRay, 2xHDHR, 1xFirewire SageTV : PlayOn, SJQ, MediaShrink, Comskip, Jetty, Web Client, BMT Having a problem? Don't forget to include a log! (Instructions for: PlayOn For SageTV v1.5, MediaShrink) |
#2
|
||||
|
||||
Quote:
BMT does support finding shows by episode title (fuzz logic searching), but the challenge is knowing when to consider a file a TV show vs a Movie. For shows with Season and Episode info, it's pretty easy, because the regex will will either match or not. The way bmt discovers tv/movie titles from the filenames is that it first runs through the filename scrapers in the STVs/Phoenix/scrapers/xbmc/ area (there is a tv and a movie sub section). It first processes the TV scrapers, and if a scraper passes, then it will use it. Once TV is done, it then processes the Movies. For sage airings, it's fairly easy to create a tv scraper because the filename pattern for a sage recording is pretty unique (Series-EpisodeTitle-######-#), so if this matches a filename, then I assume it's in TV mode, and the scraper parses out the Series and Episode. You can make a scraper work for your stuff, if you have it all in a TV folder. From there, you can copy/create a new scraper file and put it in scrapers area for tv filenames, and you should be all set. ie, part of your regex for the scraper will be to test that your have TV folder, etc. (make sense?)
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#3
|
|||
|
|||
I have had the same question as I have been importing shows from tivo. I will have to dig into the xbmc folder and see if I can some stuff working. Thanks for the tips. I will report back if I have any luck.
__________________
HP m9040n Quad Core 2.4Ghz, Windows7 Ultimate, Ceton 4 tuner CableCard with SageDCT, 2 HDHomeRun QAM, Netgear 24 Port GiGE Switch, Linksys WRT600N Router, 3 HD200 Extenders, 2 SageTV Clients Server: SageTV 7 |
#4
|
||||
|
||||
If you use the SageRecordingAiring.xml as a base, you can probably see there are 2 "functions" that you need to implement; GetShowName and GetEpisode, and remove GetAiringID.
If your TV shows are in a TV sub directory and have a filename like, "Series - Episode.mkv", then something like this may work.. Code:
<?xml version="1.0" encoding="UTF-8"?> <!-- TV Filename Scraper. Used to Scrape Show Name, AiringTitle, and AiringId from a Sage Recording $$1 is always the complete file uri --> <scraper name="title-sageRecording" content="filename" thumb="thumb.png"> <!-- input: $1=complete file uri --> <!-- returns: series name --> <GetShowName dest="3"> <RegExp input="$$1" output="\1" dest="3"> <expression>.*[/\\]TV/[/\\].*[/\\]([^-]+)-([^\.]+)\.</expression> </RegExp> </GetShowName> <!-- input: $1=complete file uri --> <!-- returns: Compressed Episode Title from the Sage Recording --> <GetEpisodeTitle dest="3"> <RegExp input="$$1" output="\2" dest="3"> <expression>.*[/\\]TV/[/\\].*[/\\]([^-]+)-([^\.]+)\.</expression> </RegExp> </GetEpisodeTitle> </scraper>
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#5
|
||||
|
||||
FYI on xbmc filename scrapers...
For your expression, Code:
<expression>.*[/\\]TV/[/\\].*[/\\]([^-]+)-([^\.]+)\.</expression> ie, Code:
<RegExp input="$$1" output="\1" dest="3"> This is not bmt's notation, but rather, in bmt, I created an implementation for the xbmc scraper engine, and then I decided to use their engine for scraping the filenames, since it provided a fairly abstract way for writing scraper functions.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#6
|
||||
|
||||
Sounds like I should just use a different separator (-- vs -) to indicate that its definitely TV and then it'll be nice and simple to make a scraper.xml file
__________________
Clients: 1xHD200 Connected to 50" TH-50PZ750U Plasma Server : Shuttle SFF SSH55J2 w/ Win7 Home, SageTV v7, Core i3 540, 2GB RAM, 30GB SSD for OS, 1.5TB+2x1TB WDGP for Recordings, BluRay, 2xHDHR, 1xFirewire SageTV : PlayOn, SJQ, MediaShrink, Comskip, Jetty, Web Client, BMT Having a problem? Don't forget to include a log! (Instructions for: PlayOn For SageTV v1.5, MediaShrink) |
#7
|
|||
|
|||
Regex always makes my head hurt...
So for each show that I want BMT to try to do its' magic on, do I need to create an xml file for each, or do I add sections to the "master" SageRecordingAiring.xml? Also, if possible, help me out with the regex. Say I have a file named "Mad Men--We Like To Smoke.mpg". How would it look in the xml file? I hope I am not being too much of a weasel asking....I know I will spin my wheels later tonight when I try to get it working, so any tips would really be appreciated!
__________________
HP m9040n Quad Core 2.4Ghz, Windows7 Ultimate, Ceton 4 tuner CableCard with SageDCT, 2 HDHomeRun QAM, Netgear 24 Port GiGE Switch, Linksys WRT600N Router, 3 HD200 Extenders, 2 SageTV Clients Server: SageTV 7 |
#8
|
||||
|
||||
Quote:
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#9
|
|||
|
|||
Thanks, I will give it a go tonight and beg for more help if needed!
__________________
HP m9040n Quad Core 2.4Ghz, Windows7 Ultimate, Ceton 4 tuner CableCard with SageDCT, 2 HDHomeRun QAM, Netgear 24 Port GiGE Switch, Linksys WRT600N Router, 3 HD200 Extenders, 2 SageTV Clients Server: SageTV 7 |
#10
|
|||
|
|||
...but just to confirm, BMT will pick up any XML file in that folder and attempt to process it as a scraper? There can be multiple files, each of which represent a single scraper?
__________________
HP m9040n Quad Core 2.4Ghz, Windows7 Ultimate, Ceton 4 tuner CableCard with SageDCT, 2 HDHomeRun QAM, Netgear 24 Port GiGE Switch, Linksys WRT600N Router, 3 HD200 Extenders, 2 SageTV Clients Server: SageTV 7 |
#11
|
||||
|
||||
Quote:
So if your files were in the format "Series -- Episode", then you'd need one scraper file to process this filename pattern. You don't create a scraper for each Series name, just one scraper for the filename pattern itself. (make sense??)
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#12
|
|||
|
|||
Complete sense. Thanks!
__________________
HP m9040n Quad Core 2.4Ghz, Windows7 Ultimate, Ceton 4 tuner CableCard with SageDCT, 2 HDHomeRun QAM, Netgear 24 Port GiGE Switch, Linksys WRT600N Router, 3 HD200 Extenders, 2 SageTV Clients Server: SageTV 7 |
#13
|
|||
|
|||
No luck so far. In the folder \SageTV\STVs\Phoenix\scrapers\xbmc\tvfilenames there is a file named "Show-Episode.xml". Here are the contents of that file:
Code:
<?xml version="1.0" encoding="UTF-8"?> <!-- TV Filename Scraper. Used to Scrape Show Name, AiringTitle, and AiringId from a Sage Recording $$1 is always the complete file uri --> <scraper name="title-sageRecording" content="filename" thumb="thumb.png"> <!-- input: $1=complete file uri --> <!-- returns: series name --> <GetShowName dest="3"> <RegExp input="$$1" output="\1" dest="3"> <expression>.*[/\\]([^-]+)-([.*]+)\.</expression> </RegExp> </GetShowName> <!-- input: $1=complete file uri --> <!-- returns: Compressed Episode Title from the Sage Recording --> <GetEpisodeTitle dest="3"> <RegExp input="$$1" output="\2" dest="3"> <expression>.*[/\\]([^-]+)-([.*]+)\.</expression> </RegExp> </GetEpisodeTitle> </scraper> Do I need to move that "Show-Episode.xml" file up a folder? Is it not right? Looks right to me.
__________________
HP m9040n Quad Core 2.4Ghz, Windows7 Ultimate, Ceton 4 tuner CableCard with SageDCT, 2 HDHomeRun QAM, Netgear 24 Port GiGE Switch, Linksys WRT600N Router, 3 HD200 Extenders, 2 SageTV Clients Server: SageTV 7 |
#14
|
||||
|
||||
Your scraper looks correct, but.... I have a bug in how the tv scrapers work, and I was not calling the GetEpisodeName function in the scraper except for a sage airing. I've fixed this and uploaded the 2.0.9 of phoenix-core.
So, with 2.0.9, your scraper should work, but be careful. That scraper is pretty generic, and it match any movie that has a dash in the filename as well. Given the tvscrapers are executed first, then then if you have a movie like... Movie - 2010.avi, then it will detect that as a tv file with a series title of "Movie" and a episode name of 2010. That's why evilpenguin was talking about using a double dash in his tv filenames, so that it would not get confused with simply movie filenames. ie, Show -- Episode.avi instead of Show - Epsisode.avi, and then account for the -- in the scraper.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#15
|
|||
|
|||
Hum, even after the 2.0.9 update, no luck. Here is one of the file names:
Mad Men -- The Rejected.mpg Here is the scraper (which is in this folder: \SageTV\STVs\Phoenix\scrapers\xbmc\tvfilenames) : Code:
<?xml version="1.0" encoding="UTF-8"?> <!-- TV Filename Scraper. Used to Scrape Show Name, AiringTitle, and AiringId from a Sage Recording $$1 is always the complete file uri --> <scraper name="Get-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>.*[/\\]([^-]+)--([.*]+)\.</expression> </RegExp> </GetShowName> <!-- input: $1=complete file uri --> <!-- returns: Compressed Episode Title from the Sage Recording --> <GetEpisodeTitle dest="3"> <RegExp input="$$1" output="\2" dest="3"> <expression>.*[/\\]([^-]+)--([.*]+)\.</expression> </RegExp> </GetEpisodeTitle> </scraper> Here is the results from phoenix-metadata.log: Code:
2010-08-17 21:16:17,828 - ERROR; T:\___TiVo\__TiVo\Mad Men -- The Rejected.mpg; Mad Men -- The Rejected; 2251231; Failed to get Metadata from the list of results Code:
2010-08-17 21:16:17,513 [Thread-37] WARN sagex.phoenix.metadata.search.MovieFileNameUtils - Failed to parse move title using scrapers for: T:\___TiVo\__TiVo\Mad Men -- The Rejected.mpg, will use the following movie title: Mad Men -- The Rejected 2010-08-17 21:16:17,514 [Thread-37] INFO sagex.phoenix.metadata.MetadataManager - search(): imdb,tmdb; SearchQuery; Type: MOVIE; RAW_TITLE:Mad Men -- The Rejected;CLEAN_TITLE:Mad Men The Rejected;FILE:T:\___TiVo\__TiVo\Mad Men -- The Rejected.mpg;EPISODE_DATE:2010-08-16; 2010-08-17 21:16:17,515 [Thread-37] INFO sagex.phoenix.metadata.MetadataManager - Searching: Mad Men -- The Rejected using IMDBMetadataProvider[MetadataProviderInfo [id=imdb, fanartId=tmdb, mediaTypes=[MOVIE], name=IMDb]] 2010-08-17 21:16:17,523 [Thread-37] INFO sagex.phoenix.util.url.URLSaxParser - Parsing Url: http://www.imdb.com/find?s=tt&q=Mad+Men+--+The+Rejected&x=0&y=0 2010-08-17 21:16:17,523 [Thread-37] INFO sagex.phoenix.util.url.CachedUrlFactory - Caching URL Factory in use. 2010-08-17 21:16:17,806 [Thread-37] INFO sagex.phoenix.metadata.MetadataManager - Searching Using Cleaned Title: Mad Men The Rejected using IMDBMetadataProvider[MetadataProviderInfo [id=imdb, fanartId=tmdb, mediaTypes=[MOVIE], name=IMDb]] 2010-08-17 21:16:17,806 [Thread-37] INFO sagex.phoenix.util.url.URLSaxParser - Parsing Url: http://www.imdb.com/find?s=tt&q=Mad+Men+The+Rejected&x=0&y=0 2010-08-17 21:16:17,822 [Thread-37] INFO sagex.phoenix.metadata.MetadataManager - Searching: Mad Men The Rejected using TheMovieDBMetadataProvider[MetadataProviderInfo [id=tmdb, fanartId=tmdb, mediaTypes=[MOVIE], name=themoviedb.org]] 2010-08-17 21:16:17,825 [Thread-37] INFO sagex.phoenix.metadata.provider.tmdb.TheMovieDBMetadataProvider - Fetching tmdb url: CachedUrl: http://api.themoviedb.org/2.1/Movie.search/en/xml/d4ad46ee51d364386b6cf3b580fb5d8c/Mad%2BMen%2BThe%2BRejected; UrlId: 02e28c59839e535d492d9161b6ac7963 2010-08-17 21:16:17,827 [Thread-37] WARN sagex.phoenix.metadata.provider.tmdb.TheMovieDBMetadataProvider - TMDB Search for SearchQuery; Type: MOVIE; RAW_TITLE:Mad Men -- The Rejected;CLEAN_TITLE:Mad Men The Rejected;FILE:T:\___TiVo\__TiVo\Mad Men -- The Rejected.mpg;QUERY:Mad Men The Rejected;EPISODE_DATE:2010-08-16; returned no results. 2010-08-17 21:16:17,829 [Thread-37] WARN phoenix.log - AutomaticMetadataVisitor(): lookup failed with an error for DecoratedItem: [SageMediaFile [sageId=2251231, sageObject=MediaFile[id=2251231 A[2251234,2251232,"__TiVo/Mad Men -- The Rejected",0@0816.00:24,63] mask=V host=Basement encodedBy= format=MPEG2-PS 1:03:59 2884 kbps [#0 Video[MPEG2-Video 29.97003 fps 1920x1080 16:9 interlaced]#1 Audio[AC3 48000 Hz 6 channels 384 kbps MAIN idx=1 id=bd-80020001]] T:\___TiVo\__TiVo\Mad Men -- The Rejected.mpg, Seg0[Mon 8/16 0:24:54.502-Mon 8/16 1:28:54.279]]]] MetadataException [query=SearchQuery; Type: MOVIE; RAW_TITLE:Mad Men -- The Rejected;CLEAN_TITLE:Mad Men The Rejected;FILE:T:\___TiVo\__TiVo\Mad Men -- The Rejected.mpg;QUERY:Mad Men The Rejected;EPISODE_DATE:2010-08-16;, ] at sagex.phoenix.metadata.MetadataManager.getMetdata(MetadataManager.java:476) at sagex.phoenix.metadata.MetadataManager.automaticUpdate(MetadataManager.java:556) at sagex.phoenix.metadata.MetadataManager.automaticUpdate(MetadataManager.java:526) at sagex.phoenix.metadata.AutomaticMetadataVisitor.visit(AutomaticMetadataVisitor.java:24) at sagex.phoenix.vfs.DecoratedMediaFile.accept(DecoratedMediaFile.java:48) at sagex.phoenix.vfs.DecoratedMediaFolder.accept(DecoratedMediaFolder.java:61) at sagex.phoenix.metadata.PhoenixMetadataSupport$1.run(PhoenixMetadataSupport.java:110) at sagex.phoenix.progress.ProgressTrackerManager$1.run(ProgressTrackerManager.java:48)
__________________
HP m9040n Quad Core 2.4Ghz, Windows7 Ultimate, Ceton 4 tuner CableCard with SageDCT, 2 HDHomeRun QAM, Netgear 24 Port GiGE Switch, Linksys WRT600N Router, 3 HD200 Extenders, 2 SageTV Clients Server: SageTV 7 |
#16
|
|||
|
|||
...I also tried the filename without the spaces before and after the dashes (Mad Men--The Rejected.mpg)
__________________
HP m9040n Quad Core 2.4Ghz, Windows7 Ultimate, Ceton 4 tuner CableCard with SageDCT, 2 HDHomeRun QAM, Netgear 24 Port GiGE Switch, Linksys WRT600N Router, 3 HD200 Extenders, 2 SageTV Clients Server: SageTV 7 |
#17
|
||||
|
||||
I'm having some serious BMT related issues today so I haven't had a chance to try it out myself but that RegEx could be a bit problematic as it doesn't exclude slashes from the season/episode name, try this one as its a bit tighter...
Code:
.*[/\\]([^/\\-]+)-([^/\\]+)\.[a-zA-Z]+$
__________________
Clients: 1xHD200 Connected to 50" TH-50PZ750U Plasma Server : Shuttle SFF SSH55J2 w/ Win7 Home, SageTV v7, Core i3 540, 2GB RAM, 30GB SSD for OS, 1.5TB+2x1TB WDGP for Recordings, BluRay, 2xHDHR, 1xFirewire SageTV : PlayOn, SJQ, MediaShrink, Comskip, Jetty, Web Client, BMT Having a problem? Don't forget to include a log! (Instructions for: PlayOn For SageTV v1.5, MediaShrink) |
#18
|
|||
|
|||
Quote:
__________________
HP m9040n Quad Core 2.4Ghz, Windows7 Ultimate, Ceton 4 tuner CableCard with SageDCT, 2 HDHomeRun QAM, Netgear 24 Port GiGE Switch, Linksys WRT600N Router, 3 HD200 Extenders, 2 SageTV Clients Server: SageTV 7 |
#19
|
||||
|
||||
Anything you'd like to share? I don't like it when people have serious bmt issues.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#20
|
||||
|
||||
Well, not really BMT issues, but metadata issues in general. I'm still trying to sort what's my fault and what's with BMT, i'll let you know when I get to the bottom of it all
__________________
Clients: 1xHD200 Connected to 50" TH-50PZ750U Plasma Server : Shuttle SFF SSH55J2 w/ Win7 Home, SageTV v7, Core i3 540, 2GB RAM, 30GB SSD for OS, 1.5TB+2x1TB WDGP for Recordings, BluRay, 2xHDHR, 1xFirewire SageTV : PlayOn, SJQ, MediaShrink, Comskip, Jetty, Web Client, BMT Having a problem? Don't forget to include a log! (Instructions for: PlayOn For SageTV v1.5, MediaShrink) |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Season/Episode in filename | svalmorri | SageMC Custom Interface | 6 | 09-24-2009 09:42 PM |
Season and Episode tool script | LoopyWolf | SageTV Customizations | 0 | 09-19-2009 01:57 PM |
add Season and Episode numbers | LoopyWolf | SageTV Customizations | 2 | 09-12-2009 01:41 PM |
Season and episode information? | CadErik | SageTV EPG Service | 7 | 10-03-2006 03:06 PM |