Hello,
IMDB is a cool DB, but sadly most older movies haven't a german translation. So I would like to use (sometimes) for the plot and plot summary tags another URL. How can this be done in the scraper? Could you give me please a hint?
Regards,
Eisbahn
How to use "if then else": URL1 = empty > fetch infos from URL2 for
Eisbahn
Junior Member Posts: 43 Joined: Jun 2010 Reputation: 2 |
2010-06-04 23:23
Post: #1
|
| find quote |
spiff
Grumpy Bastard Developer Joined: Nov 2003 Reputation: 82 |
2010-06-07 10:28
Post: #2
for this you use a chain. you create a function to parse the other page;
Code: <ParseOtherPage dest="3">Code: <RegExp input="$$1" output="<url function="ParseOtherPage">someurlor\1orwhatever</url>" dest="5+">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. |
| find quote |
Eisbahn
Junior Member Posts: 43 Joined: Jun 2010 Reputation: 2 |
2010-06-07 22:51
Post: #3
Hi spiff,
don't know if we talked about different things. What I wanted: - always scrape the german IMDB and search for the plot - if plot is missing and showing a text like "no plot available, please translate and insert it in our HP" in german IMDB and the user wants to use another URL (and just in this two cases/conditions), scrape it for the plot => OK, the decision/asking the user about scraping another URL is no problem and could be done by the "conditional" flag => scraping another URL with a function is as well no problem (having done this for other infos just before) My real question is: how to get the decision: scraped infos from IMDB are not good, use alternative (if user wants to) Eisbahn |
| find quote |
spiff
Grumpy Bastard Developer Joined: Nov 2003 Reputation: 82 |
2010-06-08 02:45
Post: #4
just grab the plot to a buffer and check if it's bad, if it is, chain.
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. |
| find quote |
Eisbahn
Junior Member Posts: 43 Joined: Jun 2010 Reputation: 2 |
2010-06-08 07:11
Post: #5
Yes, and how can this be done?
Scraper code is for example Code: <?xml version="1.0" encoding="utf-8"?>Eisbahn |
| find quote |
spiff
Grumpy Bastard Developer Joined: Nov 2003 Reputation: 82 |
2010-06-08 11:04
Post: #6
Code: <RegExp input="$$1" output="\1" dest="6">1) grab plot to a buffer 2) if buffer is nonempty, use as plot 3) if buffer is empty, do the chain. elementary, dr watson. 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. |
| find quote |
vdrfan
Team-XBMC Developer Posts: 2,786 Joined: Jan 2008 Reputation: 7 Location: Germany |
2010-06-08 11:12
Post: #7
@Eisbahn, some of the german scrapers are already using something like this to determine if there's an imdb id or if we have to use google.
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. |
| find quote |
Eisbahn
Junior Member Posts: 43 Joined: Jun 2010 Reputation: 2 |
2010-06-12 22:45
Post: #8
Hi Spiff,
not so easy for me, ouch... In the GetDetails function of the scraper: Code: <RegExp input="$$2" output="<url function="GetIMDBPlot">$$3plotsummary</url>" dest="5+">this is running fine and calls my IMDB func (in common directory): Code: <?xml version="1.0" encoding="utf-8"?>Ok, if we do not find any plot, have a look at the OFDB site: Code: <?xml version="1.0" encoding="utf-8"?>As far as I can see, the OFDB feature has a problem/is never used. It's not a typo at the conditional flags: if I delete them, prblem still exists. On my paper, pen and mind it works and one URL after the other is fetched and checked by the scraper. What went wrong? Regards, Eisbahn |
| find quote |
Eisbahn
Junior Member Posts: 43 Joined: Jun 2010 Reputation: 2 |
2010-06-18 20:22
Post: #9
error message in log is always (with different IMDB tt-IDs)
Code: CIMDB::InternalGetDetails: Unable to parse web site [http://www.imdb.de/title/tt0499549/] |
| find quote |


Search
Help