How to make a scraper return multiple Thumbs / FanArts?

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
m69bv3 Offline
Junior Member
Posts: 46
Joined: Nov 2008
Reputation: 0
Question  How to make a scraper return multiple Thumbs / FanArts?
Post: #1
Hi,

I'm writing a scraper and I wonder what is the xmlformat that the scraper should output to have:
  • Multiple Thumbs
  • Multiple FanArt (Backdrops)

Code:
<thumbs>
<thumb>http://somehost.com/myimage.jpg</thumb>
<thumb>http://somehost.com/myimage.jpg</thumb>
</thumbs>

Seems to work but is it the right way? And how can i specify FanArt? especially backdrops for AEON.

Thanks for your help!

'xcuse my english i'm french
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #2
that is correct for thumbs. fanart is a bit different atm, i plan to change it at some point, but anyways;

Code:
<fanart url="basepath">
  <thumb>pathrelativetobasepath</thumb>
  <thumb>pathrelativetobasepath</thumb>
</fanart>

see the tmdb scraper for a "live" example
find quote
m69bv3 Offline
Junior Member
Posts: 46
Joined: Nov 2008
Reputation: 0
Post: #3
Thanks! It's perfect!
find quote
ultrabrutal Offline
Posting Freak
Posts: 952
Joined: Feb 2005
Reputation: 0
Location: South of Heaven
Post: #4
1. Spiff, how does XBMC differ between 1080p and 720p fanart (could find any info on this)? If it doesn't wouldn't be nice to let it pick the correct one based on the screen setup, so that you don't pick a 720p for a 1080p screen? Something like this:

Code:
<fanart url="basepath">
  <thumb preview="url" resolution="720p">pathrelativetobasepath</thumb>
  <thumb preview="url" resolution="1080p">pathrelativetobasepath</thumb>
</fanart>

This could also been shown in the fanart overview of the thumbnails as an overlay and even sorted by this.

2. The preview attribute. Is it relative also, or does it need the full path to the preview?
(This post was last modified: 2009-06-26 20:45 by ultrabrutal.)
find quote
ultrabrutal Offline
Posting Freak
Posts: 952
Joined: Feb 2005
Reputation: 0
Location: South of Heaven
Post: #5
Spiff, my question from above remains if you can answer it Smile

Plus I've run into a problem I need some help with.

I have two regex for fanart, one for 720p and one for 1080p.

I need the results from both merged into a usable result. Right now I don't get any fanart at all in XBMC Sad

1080p:
Code:
<RegExp conditional="fanart" input="$$4" output="&lt;fanart url=&quot;http://files.mymovies.dk/Backdrops/&quot;&gt;\1&lt;/fanart&gt;" dest="5+"><RegExp input="$$1" output="&lt;thumb preview=&quot;\1&quot; resolution=&quot;1080p&quot;&gt;\2&lt;/thumb&gt;" dest="4"><expression repeat="yes">FileThumb="[^&gt;]*\/(.+)" F[^&lt;]*File1080P="[^&gt;]*\/(.+)" Hash1080p</expression></RegExp><expression noclean="1">(.+)</expression></RegExp>

720p:
Code:
<RegExp conditional="fanart" input="$$4" output="&lt;fanart url=&quot;http://files.mymovies.dk/Backdrops/&quot;&gt;\1&lt;/fanart&gt;" dest="5+"><RegExp input="$$1" output="&lt;thumb preview=&quot;\1&quot; resolution=&quot;720p&quot;&gt;\2&lt;/thumb&gt;" dest="4"><expression repeat="yes">FileThumb="[^&gt;]*\/(.+)" File720P="[^&gt;]*\/(.+)" Hash720p</expression></RegExp><expression noclean="1">(.+)</expression></RegExp>

XML which GetDetails is working on:
Code:
<Backdrops>
  <Backdrop FileThumb="http://files.mymovies.dk/Backdrops/c4ead747-9c4f-4b6c-b0fd-a4e1d510c45d.jpg" File720P="http://files.mymovies.dk/Backdrops/6e28dea1-d97d-4be9-ac3e-59f3e4a71358.jpg" Hash720P="D7-90-83-0D-17-F4-6A-FB-34-BA-EC-DB-64-B9-14-9A-33-F5-FA-02" File1080P="" Hash1080P="" />
  <Backdrop FileThumb="http://files.mymovies.dk/Backdrops/c4041a06-b2d5-42be-8b42-5a1d337bbbdf.jpg" File720P="http://files.mymovies.dk/Backdrops/00b6bc44-516c-4970-a216-a37df4e85707.jpg" Hash720P="E6-67-5D-91-C8-CF-9E-58-4A-58-47-E2-3A-B9-2D-F6-6E-3A-25-AE" File1080P="http://files.mymovies.dk/Backdrops/636eeccb-491a-4b18-9b5f-864426d8a916.jpg" Hash1080P="37-F3-8D-70-6E-81-2D-66-57-03-FB-68-E6-69-CA-F9-EC-A5-51-E8" />
  <Backdrop FileThumb="http://files.mymovies.dk/Backdrops/5e88a73c-0927-49cf-8819-78ccf6c8188f.jpg" File720P="http://files.mymovies.dk/Backdrops/9626ceb4-f2c4-4fd3-beec-1571e6b0bdf5.jpg" Hash720P="7D-85-B6-DD-EB-C7-F4-42-F8-77-72-FA-26-A9-D4-A6-F3-45-A1-40" File1080P="http://files.mymovies.dk/Backdrops/231d1f6b-43f6-45c4-9619-b22496608c4b.jpg" Hash1080P="5E-69-1E-80-A3-B4-DA-9B-29-81-4E-54-97-DC-2E-7E-D5-FF-22-D9" />
</Backdrops>

I'm not a regex nor a scraper shark, so wondering if it is possible to merge these results into something which works with XBMC? Tnx
find quote
ultrabrutal Offline
Posting Freak
Posts: 952
Joined: Feb 2005
Reputation: 0
Location: South of Heaven
Post: #6
This is what I've come up with:

Code:
<RegExp conditional="fanart" input="$$4" output="&lt;fanart url=&quot;http://files.mymovies.dk/Backdrops/&quot;&gt;\1&lt;/fanart&gt;" dest="5+"><RegExp input="$$1" output="&lt;thumb preview=&quot;\1&quot; resolution=&quot;1080p&quot;&gt;\2&lt;/thumb&gt;" dest="4"><expression repeat="yes">FileThumb="[^&gt;]*\/(.+)" F[^&lt;]*File1080P="[^&gt;]*\/(.+)" Hash1080p</expression></RegExp><RegExp input="$$1" output="&lt;thumb preview=&quot;\1&quot; resolution=&quot;720p&quot;&gt;\2&lt;/thumb&gt;" dest="4+"><expression repeat="yes">FileThumb="[^&gt;]*\/(.+)" File720P="[^&gt;]*\/(.+)" Hash720p</expression></RegExp><expression noclean="1">(.+)</expression></RegExp>

However it does not give any results in XBMC. And yes I have a setting called 'fanart' which is set to true.
ScraperXML test crashes for me so I'm working in the blind here Smile
find quote
ultrabrutal Offline
Posting Freak
Posts: 952
Joined: Feb 2005
Reputation: 0
Location: South of Heaven
Post: #7
Nicezia, new version of ScraperXML test does not crash but no result what so ever is returned/shown in gui. In XBMC a result is there but something is wrong with the fanart. Regex'es works in regextester but when run in XBMC, something goes wrong. Will try to catch you on IRC again
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #8
i don't quite grasp what the problem is? your expressions are obviously invalid. unless i have misunderstood something it would just be

Code:
FileThumb="[^>]* File1080P="([^"]+)"
for grabbing the 1080p (who came up with the uppercase P anyways? Wink)
and
Code:
FileThumb="[^>]* File720P="([^"]+)" Hash720P="[^"]*" File1080P=""
for grabbing the 720p

xbmc does not different between 1080p and 720p fanart, we use whatever you give us at whatever res it's at (except the xbox which resamples everything > 720p to 720p)
find quote
ultrabrutal Offline
Posting Freak
Posts: 952
Joined: Feb 2005
Reputation: 0
Location: South of Heaven
Post: #9
Tnx spiff! I guess I cannot trust regextester Smile

For those who cares, here is the working code:

Code:
<RegExp conditional="fanart" input="$$4" output="&lt;fanart&gt;\1&lt;/fanart&gt;" dest="5+"><RegExp input="$$1" output="&lt;thumb preview=&quot;\1&quot; dim=&quot;1920x1080&quot;&gt;\2&lt;/thumb&gt;" dest="4"><expression repeat="yes">FileThumb="([^"]*)" F[^&lt;]*File1080P="([^"]*)" Hash1080p</expression></RegExp><RegExp input="$$1" output="&lt;thumb preview=&quot;\1&quot; dim=&quot;1920x720&quot;&gt;\2&lt;/thumb&gt;" dest="4+"><expression repeat="yes">FileThumb="([^"]*)" File720P="([^"]*)" Hash720p</expression></RegExp><expression noclean="1">(.+)</expression></RegExp>

NB! XBMC do not support "dim" yet in any skin
find quote