CreateSearchUrl Error
#1
Hello,

I have a scraper which sometimes builds incorrect search url. Dharma Rc1 is used.

CreateSearchUrl is following:

<CreateSearchUrl dest="3">
<RegExp input="$$1" output="&lt;url&gt;http://yamsonline.com/component/content/?option=com_jmovies&amp;Itemid=69&amp;task=mov_search&amp;movnme=\1&amp;search_mov=Search&lt;/url&gt;" dest="3">
<expression>(.*)</expression>
</RegExp>
</CreateSearchUrl>

I use folder name for lookups.
So for folder
a (1899)
Search url is correct

15:10:00 T:1472 M: 89997312 DEBUG: VideoInfoScanner: Scanning dir 'c:\tmp\scraper\a (1899)\' as not in the database
15:10:00 T:1472 M: 89985024 DEBUG: VideoInfoScanner: No NFO file found. Using title search for 'c:\tmp\scraper\a (1899)\w.avi'
15:10:00 T:1472 M: 89939968 DEBUG: CIMDB::InternalFindMovie: Searching for 'a (1899)' using xxxxonline.com scraper (path: 'C:\Documents and Settings\i.dziuba\Application Data\XBMC\addons\metadata.xxxxonline.com', content: 'movies', version: '1.0.1')
15:10:00 T:1472 M: 89931776 DEBUG: scraper: CreateSearchUrl returned <url>http://xxxxonline.com/component/content/?option=com_jmovies&Itemid=69&task=mov_search&movnme=a%20%281899%29&search_mov=Search</url>
15:10:00 T:1472 M: 89866240 DEBUG: FileCurl::Open(042FEE2C) http://xxxxonline.com/component/content/...mov=Search



But for folder
a (1900)
Scraper engine cuts digits with brackets and only "a" is left.

15:12:57 T:4328 M: 92512256 DEBUG: VideoInfoScanner: Rescanning dir 'c:\tmp\scraper\a (1900)\' due to change (fast1290514352 != 900A7AC36EAD5613832270D4AEDB2BF4)
15:12:57 T:4328 M: 92499968 DEBUG: VideoInfoScanner: No NFO file found. Using title search for 'c:\tmp\scraper\a (1900)\rt.avi'
15:12:57 T:4328 M: 92454912 DEBUG: CIMDB::InternalFindMovie: Searching for 'a' using xxxxonline.com scraper (path: 'C:\Documents and Settings\i.dziuba\Application Data\XBMC\addons\metadata.xxxxonline.com', content: 'movies', version: '1.0.1')
15:12:57 T:4328 M: 92442624 DEBUG: scraper: CreateSearchUrl returned <url>http://xxxxonline.com/component/content/?option=com_jmovies&Itemid=69&task=mov_search&movnme=a&search_mov=Search</url>
15:12:57 T:4328 M: 92377088 DEBUG: FileCurl::Open(03ECEE2C) http://xxxxonline.com/component/content/...mov=Search



This is true for numbers above 1900.
Numbers below 1900 work correctly.

Looks like a bug or not?

Thank you
Reply
#2
not a bug. we assume it's the year and thus strip it off. it's avail in $$2. this is very useful for search engines that allows specifying it in a separate field.
Reply
#3
spiff Wrote:not a bug. we assume it's the year and thus strip it off. it's avail in $$2. this is very useful for search engines that allows specifying it in a separate field.

Thanks for reply. Now it is clear.

But could you advise how to add ($$2 ) to search url only if it is set.
I tried "conditional" statement but failed.

Thanks
Reply
#4
basically do both then copy the one you want to the resulting buffer

Code:
<RegExp input="$$1" output="url \1 ($$2)" dest="5">
  <expression>..</expression>
</RegExp>
<RegExp input="$$1" output="url\1" dest="6">
  <expression>..</expression>
</RegExp>
<RegExp input="$$2" output="$$5" dest="3">
   <expression>.+</expression>
</RegExp>
<RegExp input="$$2" output="$$6" dest="3>
  <expression>^$</expression>
</RegExp>
hopefully you get the point
Reply
#5
alternatively you can do something ala

Code:
<RegExp input="$$1 ($$2)" output="\1" dest="1">
    <expression>(.*\([0-9]+\))</expression>
  </RegExp>
before constructing the url. this will only overwrite $$1 IF the expression matches.
Reply
#6
spiff Wrote:alternatively you can do something ala

Code:
<RegExp input="$$1 ($$2)" output="\1" dest="1">
    <expression>(.*\([0-9]+\))</expression>
  </RegExp>
before constructing the url. this will only overwrite $$1 IF the expression matches.

Ok, good. Thanks a lot for your help!
Reply

Logout Mark Read Team Forum Stats Members Help
CreateSearchUrl Error0