1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MPDB.TV french scrapper | Page 3

Discussion in 'Moving Pictures' started by Recma, October 17, 2016.

  1. RoChess
    • Premium Supporter

    RoChess Extension Developer

    Joined:
    March 10, 2006
    Messages:
    3,980
    Ratings:
    +1,579 / 2
    A RegExp is used to not just verify that the XML options file exists, but also that the content is valid. It is failing on either part, and judging from your screenshot you have the file, so it is failing on the content.





    Please provide a copy of your XML file (modify API info so that it contains something alike to what it is, but not valid, so swap/replace a bunch of chars) so I can manually run the RegExp against it in Expresso to see why it is failing.
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. Recma

    Recma Portal Member

    Joined:
    May 3, 2007
    Messages:
    35
    Ratings:
    +3 / 0
    Home Country:
    France France
    Hello Rochess,

    Here it is ! Thanks !
     

    Attached Files:

  4. RoChess
    • Premium Supporter

    RoChess Extension Developer

    Joined:
    March 10, 2006
    Messages:
    3,980
    Ratings:
    +1,579 / 2
    @Recma, found problem.

    First off you changed the XML syntax, and moved value attribute to a different position, which causes the RegExp to fail and consider the file corrupt with default values being used. I'm not using an XML processor to read the file, but a raw solution, so to prevent failure/crashes I have to sanitize the input via Regular Expression.

    But the RegExp would have failed anyway, because the valid values I look for are \w{12,} which allows a-z, A-Z, 0-9, and underscores, but I did not account for '-' in the MPDb key.

    Also looking for 12 chars minimum seems a little extreme if a user has a short username, so I will change that to include hyphens, and lower it to 4+

    But you do have to fix your XML file back to the correct syntax of: <set[\t\s]+id="\d+"[\t\s]+name="global_options_[^"]+"[\t\s]+value="(?:true|false|[\w-]{12,})"[\t\s]*/>

    Example: <set id="00" name="global_options_xxxxx" value="some" />, but TABs are allowed, so if you like all your "values" to be lined up, just insert TABs.

    Original file not touched in 4 years @ https://raw.githubusercontent.com/RoChess/IMDbPlus/master/Options IMDb+ Scraper.xml

    v4.9.72 is released that fixes the '-' and lowers it to 4+ chars, but you will need to fix your XML.
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Like Us On Facebook

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!