Help needed with development of new scraper for filmdelta.se (Swedish Movie Scraper)?
#61
Hmmm... No answers. Guess I'll have to specify my current problem more specific.

What I want to do right now is to do a expression that says

Code:
If $$9 contains a year, then use
<a href="/filmer/([^"]*)">([^<]*)</a> \($$9\)
otherwise use
<a href="/filmer/([^"]*)">([^<]*)</a>

This ought to be possible, right?

I tried reading up (since I'm quite new to regexp) and came to the conclusion that some if-then construction would be good. I tried

Code:
<a href="/filmer/([^"]*)">([^<]*)</a>(?($$9=\d)( \($$9\)))

Since I'm not really sure what I'm doing here I guess I'm reasoning completely backwards. Sad Surely there must be some regexp expert around who can point me in the right direction?

/Daniel
Reply
#62
what about matching without year first, then clear on a second regexp match with year?
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#63
vdrfan Wrote:what about matching without year first, then clear on a second regexp match with year?

Good point. How would I do that "clearing"? Just put the result of the second regexp in the same buffer without appending?

Another idea. How about I put "year matches" first and then do "matches without year" anyways? That way I always get the hits with correct year first, but the other hits will also show a bit down in the list (for movies with wrong or no year). Does that sound like correct thinking to you?

/Daniel

edit: Ok. Implemented my solution above. So now I don't use the year for filtering, just for sorting. See http://pastebin.com/m7163e3d7. Works like a charm for me. I'm still on svn 21936 though (since ppaConfused for some reason are lagging behind), I'll put it up on trac when I've tried with a more recent version.
Reply
#64
vdrfan Wrote:what about matching without year first, then clear on a second regexp match with year?

This is the point where I have to admit that you're better than me. My plan with sorting on year didn't work, since xbmc doesn't really seem to care in what order the results are. Your plan works like a charm though. I'll file a new trac ticket with my changes, which now works perfect with svn 22097.

/Daniel
Reply
#65
Darn! I edited the scraper in svn 22097 and of course loads of stuff had to change in all scrapers in 22098... Guess I'll have to redo my changes with 22098 as new starting point Confused

/Daniel

Fixed it. http://trac.xbmc.org/ticket/7043
Reply
#66
hail to the new scraperincludes Wink
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#67
Now that the version in svn seems to work a bit too good I'm starting to think about new features for it. I need some input.

A problem I've got right now is that if I search for a movie that doesn't exist in tmdb (for example the swedish movie "Yrrol" (thanks Folle)) then I obviously will get neither fanart nor poster. I guess I can forget the fanart, but a nice feature would be to fall back on the (crappy quality) poster on filmdelta. How would I go about that?

If I'm understanding correctly I can now have multiple <thumb> tags? But I want xbmc to use the one from tmdb if it exists. Is that possible?

Seems like crap if the swedish scraper doesn't work fully for swedish movies Rolleyes

/Daniel
Reply
#68
Hello!

Tried to use this scraper but i is not getting the right title. I have tried it with the movie "Cars (2006)" but instead of getting the right movie information it starts to fetch stuff from a movie named "Cougars" or something.

Do i have to have the movie titles named to the Swedish translated titles? Or can i use the original English ones?

Would prefer to have original English titles on the movies etc but fetch Swedish information about the movie using this scraper.

Hope someone can help me!

Regards,
HelionPrime
Reply
#69
are you blind?
Quote:Scraper Development Developers forum for meta data scrapers. ***Scraper developers only! Not for posting feature requests, bugs, or end-user support requests!***
Reply
#70
HelionPrime Wrote:Hello!

Tried to use this scraper but i is not getting the right title. I have tried it with the movie "Cars (2006)" but instead of getting the right movie information it starts to fetch stuff from a movie named "Cougars" or something.

Do i have to have the movie titles named to the Swedish translated titles? Or can i use the original English ones?

This should work. Searching on filmdelta works with both swedish titles and original titles. I hope I'll get the time to do some more work on this scraper before 9.10, I'll give Cars a test then...

/Daniel
Reply
#71
Hi all.
I've got one tiny thing that I thought I'd fix before 9.10. Problem is I never seem to have any time left over and now I've completely forgotten most of my knowledge about how to do it Blush. I guess it would be a quick job for someone that's more into scraper development, so I'm asking if anyone please could help me?

This is the case: The problem with the scraper right now is that if a movie is found at the filmdelta site but not on tmdb, there is no poster and no fanart. Even though there is a poster on filmdelta. So I want the scraper to pick up the filmdelta poster. If there is a hit in tmdb however, I want that poster to be the preferred one, since it's got better quality. From what I understand (after a chat with spiff like half a year ago) this goal can be reached by making a function to extract the filmdelta poster, and calling this function after the call to GetTMDBThumbsByIMDBId.

I've written the function, so I guess what's left is to add the call, plus extra stuff to use cache instead of fetching the filmdelta page twice. Function follows. It should use the same input as GetDetails (ie the page with all the film info).

Code:
<GetFilmdeltaThumb dest="5">
        <RegExp input="$$1" output="&lt;thumb&gt;http://www.filmdelta.se\1&lt;/thumb&gt;" dest="5">
            <expression noclean="1">&lt;div class="box images" id="title-images"&gt;[^&lt;]*&lt;div class="inner"&gt;&lt;img  style='width:px' src='([^']*)</expression>
        </RegExp>
    </GetFilmdeltaThumb>

So, anyone? Nod

/Daniel
Reply
#72
Sad 
Please, anyone? Spiff? Vdrfan? I'm sure this would be minutes of job to you, for me it would probably take hours, and I haven't got hours to spare before next release.

I really feel bad about not fixing my own stuff Sad

/Daniel
Reply
#73
FYI, updated the filmdelta scraper to use the "internal" low resolution fallback thumbnail. Also added caching and fixed the indentation.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#74
vdrfan Wrote:FYI, updated the filmdelta scraper to use the "internal" low resolution fallback thumbnail. Also added caching and fixed the indentation.

Thanks a lot. I owe you one.

/Daniel
Reply
#75
You're welcome.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply

Logout Mark Read Team Forum Stats Members Help
Help needed with development of new scraper for filmdelta.se (Swedish Movie Scraper)?0