animeNFO, tvtome, geos and IAFD loopup
#1
hi,

i have written a simple animenfo client for fetching thumbnails and such.

currently i use the already defined imdb data structures, although they are a bit.. unfitting. my class also works exactly like cimdb from the outside..

but how should we integrate it into the ui? currently i have just added an extra manual-query to the context-menu, a simple cut'n'paste job..

i am willing to write a tv tome client. however i won't start before i have an idea of how we would like it to function. it seems to me that a sort of lookup-api should be constructed, since a lot of code would have to be duplicated without it.

my thoughts are something along these lines:

first, you do a query on a folder, the series-folder. then, when you look up information on files within that folder it will try to identify the episode number. this could be done through templates like whatever.<seasonnumber><episodenumber>.whatever (24.411.pdtv-lol.avi) or whatever.s<seasonnumber>e<episodenumber> (24.s04e11.pdtv-lol.avi) and then look up the information from the episode guide.

i have no clue whatsoever if this is could be a possible solution (it would certainly be a bit complicated for database views, unless a 'tv shows' view is made).

any thoughts?

ehrr. loopup. whatever Smile
Reply
#2
Exclamation 
maybe just code it so when you press 'info' to do a lookup you get an simple option to select one of; "1. imdb", "2. tvtome", "3. animeinfo" Huh ...that way be easy to add more later :idea:
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#3
spiff:

sounds great Smile

first off, are you doing it through the dll? if not, perhaps it might be better to code it up in that framework? there's a simple win32 test app (written with imdb in mind, but it can be altered easily enough) in the tools folder in cvs. there's regexp class you can use, but i'm thinking about perhaps doing a more general html parser class might be worth the initial time investment in the long run. we have one based of cstdstring in cvs, but this would need to be redone for the dll framework as strings don't like living in dlls particularly (we'd need to add a bunch of exports to xbmc, and even then it may not go ideally). perhaps there is a suitable set of code available already - would certainly be worth looking into.

as for the interface, i'm not sure how best to handle it. ideally, we'd want some auto-magic interface if at all possible. i can see how you could "detect" tv episodes based on their filename, but this may be a little trickier for anime stuff - i don't know. i think we could possibly consider splitting stuff up into a separate tv view - there is enough content to warrant it i think. not sure where the anime stuff would best fit - any suggestions?

one thing we could do is query each database, and do some fancy ordering to find the "best" match, but this seems like quite a bit of work.

another idea is some sort of setting that indicates when each online source should be used (per share for instance) though this too is unwieldy.

i guess the "simple" option of a popup selector with the source(s) to query is the easiest way, and then just list the results obtained from all sources. one way to do it could be to list the first 10 or so results from a particular source if there are a great deal of returned results (imdb is returning more and more nowadays).

as for database interaction, a possible method would be to have multiple tables - one for imdb, one for tvtome etc, and then have a main table that links into the appropriate one (ie it'd have filename, title, duration, cover (possibly) plus a type parameter that is used for querying the other tables).

just a few ideas off the top of my head. i've been wanting to do a tvtome section for a while, but have never had the time to do it.

cheers,
jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#4
hi,

first off, it is simply amazing that i did not think of gamester's suggestion Smile

no, i do not use any dll. the reason for this is that animenfo has its own simple service, i do not parse any web sites. since it hasn't changed in at least 3 years i figured that using a dll would be kinda overkill (and the socket code would have to reside in the main binary anyway, or a bunch of exports would be necessary). the query format is kind of xml-ish, so i will probably try to have a whack with tinyxml later (uses a simple parser right now...)

the tv-tome parser however i most certainly will put into a dll..

i'd say anime would fit best into a tv view. of course, there are anime movies, but i think most people that watch alot of anime are mostly into series (like me).

personally i like the idea with a per-share basis, but only in combination with a my tv-show window, or else it would seriously clutter up my videos (i have four different sources/pc's, and adding three shares per source...)

if we opt for the 'simple' idea, multiple database tables and multiple layout's for the information-screen is really a must. tvshows should have number of seasons, number of episodes etc..

anyway, i will have to familiarize a lot more with the code before i can even think of integrating anything into the ui.

i'll probably start to investigate the tv-tome look-up later tonight..

but right now i really have to get back to coding at my master thesis Smile

spiff
Reply
#5
patch #1156341 uploaded @ sf.net.

probably full of bugs but there's no better way to confirm it than to let it loose Smile

i tried to switch to using tinyxml to parse, but it did not want to cooperate.. i tried all encodings supported, i tried whacking in through cstdstring, std:Confusedtring, no string, etc. still refused to parse..

also, there is no clean-up of file names performed prior to the query yet. the relevant code should be moved out of the cimdb class so it can be reused.

i could perhaps have chosen a better dialogue for choosing the query-source..

i must say that it was comfortably easy to add the dialogue, kudos to the ui system. the biggest problem i had was resisting the temptation to properly indent the code Smile
Reply
#6
one question,

are you sure that the regexp-class is totally bugfree? my knowledge of regular expressions are very basic so i use the regex-coach to do the tvtome parser.. and one expression that is perfectly fine there crashes the parser in htmlscraper badly.

the expression i try to use is:

<img src=\"(/images/shows/[a-za-z0-9/\-\.]*)\"

i can not see any particular thing that should be wrong with it (i am reusing the imdb parser code, so the only differences at this time is the actual expressions)..

any ideas appreciated.
Reply
#7
no idea if it's bug free or not - i didn't write it so i wash my hands of it if there is a bug :p.

are you running it through xbmc or through the testshell app? if through the testshell, you should be able to build debug and step through the code.

the expression seems fine as far as my knowledge of regexps goes.

cheers,
jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#8
using the testshell. it crashes at reg.regcomp(...) i didn't look into what happens inside there. will have a go later tonight, when my mood is a bit better (my thesis is pissing me off atm Smile)

spiff
Reply
#9
your best plan is to likely break up the regexp to see which bit it's having trouble with. it's most likely going to be the bit in []. try removing some of the character ranges - perhaps it can't handle more than 1 range for instance?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#10
beware,

there are indeed bugs in the regexp-class. i rewrote the expression and everything works like a charn. there is however no limit on the number of ranges, since i (and the author of the imdb-parser) uses exactly the same in other expressions (i added some symbols though).

parsing tv-tome turned out to be quite the pain in the arse, at least getting the plot information (since there is no standard layout..) it works, but on some shows a lot of not-so-useful information is included.. also i will have to extend the html2ansi function to strip html-tags.

i have gotten quite far with constructing a videolookupfactory class (to the point that i have started integrating it). this will give us drop-in support for web-scrapers. however it seems that there is far more code tied to the imdb class than i realized. and it seems that the imdbnumber is used quite extensively throughout the program. hopefully it won't be a serious problem..

this also means that i have to extend the number of functions in the .dll (need stuff like constructsearchurl(name).. and possibly a few more localized strings might be necessary.

if anybody thinks this is a bad idea, shout loud.

spiff
Reply
#11
sounds all good to me.

yeah, we use the imdb number for thumbs primarily.

let me know when you have something ready-ish. we can then concentrate on how to best integrate this stuff with the rest of the gui + carry out any reorganisation that is needed.

looking forward to it Smile

cheers,
jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#12
just a little update (i like giving them as you might have noticed Wink )

now the tv-tome parser is capable of getting a list of url's for the episode guides.. i must say, tvtome.com really should consider unifying its layout a bit more.. the part that i thought should be the easy part (parsing the episode list page) turned out to take an whole evening to do.

some of my regexp'es could probably be better but it works..
Reply
#13
hi,

today i also coded a geos scraper. animenfo, imdb and geos runs perfectly fine (except thumbnail problems due to the lack of imdb numbers) under my new videolookupfactory class (in xbmc) but somehow tvtome crashes..

these are my thought on how to best integrate show support into xbmc:

in the long term, add a nav view to my videos. we can categorize entries based on the lookup information source. eg, root level of nav window has 'movies, tv-shows, anime, porn (if somebody got a major porn lookup website shout loud).
for tv shows and anime we can then have nice season->episode navigation.

krahq3d: is your nav code tightly integrated with my music our could the code be reused?

in the short term, add an 'episodeguide' button to movie information screen for those entries that do have it.

since my knowledge of sql limits itself to 'select * from <foo> where <bar> like <stuf>' i'd really like some input on how episodes would be realized/stored there. probably affects the way episode information should be returned.

i still haven't scraped the individual episode information, only created the episodeguide-list. i figured downloading everything at once would lead to unneccessary large data-bases, that's why i added this functionality.

now, sleep. it's four in the morning

spiff
Reply
#14
(spiff @ mar. 11 2005,02:49 Wrote:porn (if somebody got a major porn lookup website shout loud).
http://www.iafd.com/

nice work so far btw.
Reply
#15
you'll need to add some more tables for sources (source name, parser to use, catagory it belongs to), and catagories (catagory name). will there be subcatagories? tv/scifi/ tv/cartoon/? likely need another table for that. also more fields will be needed on the movieinfo table (season, episode)

in the cvs /xbmc/docs/ there is a png the current movie database's relationship table.
i dont know who did the original db, are they wanting to maintain the db?
Reply

Logout Mark Read Team Forum Stats Members Help
animeNFO, tvtome, geos and IAFD loopup0