home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
Moving Pictures
UK IMDb Scraper
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="RoChess" data-source="post: 660076" data-attributes="member: 18896"><p>Since you can build filters based on certification results, it is usually preferred to have consistent results. So to prevent mixing UK and US certs, you could modify the scraper to make a replacement call based on US cert. It won't be pretty (certification usually isn't a direct conversion), but it's a rare case anyway when UK certs are not present and it's usually close enough.</p><p></p><p>You get code such as:</p><p></p><p>[code]</p><p> <!-- If UK certification failed, use converted US one --></p><p> <if test="${movie.certification}="></p><p> <parse name="certification_usa" input="${details_page}" regex="${rx_certification_usa}" /></p><p> <!-- Fix localized rating, forced to swap order, as 'G' gets replaced inside 'PG' and 'PG-13' otherwise --></p><p> <replace name='certification1' input='${certification_usa[0][0]:htmldecode}' pattern='X' with='R18'/></p><p> <replace name='certification2' input='${certification1}' pattern='NC-17' with='18'/></p><p> <replace name='certification3' input='${certification2}' pattern='R' with='15'/></p><p> <replace name='certification4' input='${certification3}' pattern='PG-13' with='12'/></p><p> <replace name='certification5' input='${certification4}' pattern='PG' with='PG'/></p><p> <replace name='certification6' input='${certification5}' pattern='G' with='U'/></p><p> <set name='movie.certification' value='${certification6}'/></p><p> </if></p><p>[/code]</p><p></p><p>You place this after you first try to obtain the UK certification, and be sure to add the CDATA expression, which i renamed to '_usa' postfix.</p><p></p><p>Enjoy.</p></blockquote><p></p>
[QUOTE="RoChess, post: 660076, member: 18896"] Since you can build filters based on certification results, it is usually preferred to have consistent results. So to prevent mixing UK and US certs, you could modify the scraper to make a replacement call based on US cert. It won't be pretty (certification usually isn't a direct conversion), but it's a rare case anyway when UK certs are not present and it's usually close enough. You get code such as: [code] <!-- If UK certification failed, use converted US one --> <if test="${movie.certification}="> <parse name="certification_usa" input="${details_page}" regex="${rx_certification_usa}" /> <!-- Fix localized rating, forced to swap order, as 'G' gets replaced inside 'PG' and 'PG-13' otherwise --> <replace name='certification1' input='${certification_usa[0][0]:htmldecode}' pattern='X' with='R18'/> <replace name='certification2' input='${certification1}' pattern='NC-17' with='18'/> <replace name='certification3' input='${certification2}' pattern='R' with='15'/> <replace name='certification4' input='${certification3}' pattern='PG-13' with='12'/> <replace name='certification5' input='${certification4}' pattern='PG' with='PG'/> <replace name='certification6' input='${certification5}' pattern='G' with='U'/> <set name='movie.certification' value='${certification6}'/> </if> [/code] You place this after you first try to obtain the UK certification, and be sure to add the CDATA expression, which i renamed to '_usa' postfix. Enjoy. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
Moving Pictures
UK IMDb Scraper
Contact us
RSS
Top
Bottom