MPDB.TV french scrapper (1 Viewer)

RoChess

Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    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.
     

    Recma

    Portal Member
    May 3, 2007
    36
    3
    23
    Home Country
    France France
    Hello Rochess,

    Here it is ! Thanks !
     

    Attachments

    • Options IMDb+ Scraper.xml
      1.9 KB

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    @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.
     

    Users who are viewing this thread

    Top Bottom