![]() |
|
|||||||
| Scraper Development Developers forum for meta data scrapers. Scraper developers only! Not for posting feature requests, bugs, or end-user support requests! |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Junior Member
|
Hello!
I am trying to merge locally acquired movie thumb with function-returned data. It looks like I can't send just a plain text trough $$ buffers? Sending <thumbs><thumb>url</thumb></thumbs> works only when enclosed in <details></details> tags. Is there any way I can merge this returned data with local <thumb>url</thumb> tags? I am also wondering how is it merged with the documented <GetDetails> data already available in the <details></details> format when I am collecting it in some buffer using "4+"? Thank you! |
|
|
|
|
|
#2 |
|
Grumpy Bastard Developer
Join Date: Nov 2003
Posts: 7,715
![]() |
have a look at how the allmusic scraper passes the thumb tags (i chose this one for clarity). the trick is the usage of the clearbuffers parameter on the functions. (if i understand your question correctly).
after every function we call the load() on the returned xml. this is an additive procedure, i.e. we keep what has been added before. but that does not mean that we can load several <thumbs> tags, hence the trick with clearbuffers
__________________
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. Last edited by spiff; 2009-04-09 at 23:19. |
|
|
|
|
|
#3 |
|
Junior Member
|
Hello spiff! Thank you for your reply.
Are you talking about bundled /Applications/Plex.app/Contents/Resources/Plex/system/scrapers/music/allmusic.xml ? I can't see any clearbuffers there... Could you correct me whether arbitrary text can't be passed as a returned value from function? How is <details></details> format retuned by custom function being merged with GetDetails <details></details>? |
|
|
|
|
|
#4 |
|
Grumpy Bastard Developer
Join Date: Nov 2003
Posts: 7,715
![]() |
plex? this is xbmc.. they apparently haven't updated the scrapers then.
http://xbmc.org/trac/browser/branche...c/allmusic.xml Code:
<RegExp input="$$1" output="<thumb>http://image.allmusic.com/00/amg/pic200/dr\1\200/\1\2\3\4/\1\2\3\4\5.jpg</thumb>" dest="7+">
<expression noclean="1" repeat="yes">"([A-Z^])([0-9^])([0-9^])([0-9^])([^"]*)"</expression>
</RegExp>
GetArtistDetails with clearbuffers="no". this means that when that function is finished we do NOT clear the contents of the buffers. we then enter GetThumbs Code:
<RegExp input="$$13" output="<details><thumbs>\1$$7</thumbs></details>" hope that explains it. no you cannot pass arbitrary data as the result of a function. once you see the allmusic code you'll get the point. as i already explained; after every function we call load() on the returned string (xml). this is an additive procedure, i.e. any new tags present will get loaded. if you return a tag that has been returned earlier, it's overridden. hence the need to do the clearbuffers trick
__________________
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. Last edited by spiff; 2009-04-10 at 00:06. |
|
|
|
|
|
#5 |
|
Junior Member
|
Ah, ok, sorry, I didn't realize the scrappers code-base isn't common between these projects. I'll have a look. Thank you very much!
|
|
|
|
|
|
#6 |
|
Junior Member
|
Thanks, spiff! That explained everything I asked!
|
|
|
|
|
|
#7 |
|
Junior Member
|
Two more questions.
1. What is an optimal way of replacing strings in the buffer? For example, I need to replace with spaces. 2. How to use "cache" parameter in the url tag (I've seen it in several scrapers but can't understand what it does and how it works)? Last edited by ababak; 2009-04-10 at 09:49. |
|
|
|
|
|
#8 |
|
Grumpy Bastard Developer
Join Date: Nov 2003
Posts: 7,715
![]() |
1) optimality can be discussed but this works
Code:
<RegExp input="$$2" output="\1&amp;\2" dest="3"> expression noclean="1,2" repeat="yes">(.*?)&(.+)</expression> </RegExp>
__________________
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. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|