Giter Site home page Giter Site logo

Comments (3)

rhetticent avatar rhetticent commented on June 17, 2024

Update: Changing line 68 from None to "NoneType" seems to clear this up. This is my first ever pull request, so if it's not the correct way to propose a fix, just let me know! :)

from nextcloud-news-filter.

mathisdt avatar mathisdt commented on June 17, 2024

Thank you for your detailed description! I think your regular expression is correct, but lacks the necessary escaping. The filtering program is written in Python (as you know), and inside Python Strings a single backslash \ (which you want as the first character in your regex) has to be written with an escaping character before - which also is a backslash.

Your filter should work when it is defined like this in config.ini:

[ALL-Sonos]
titleRegex = \\bsonos\\b

For reference: at the top of Python's regular expression module documentation, there is a short explanation of the necessary escaping. The script can't use the simplified "raw string" notation because the strings are loaded from the .ini file, so the escaping cannot be circumvented. (I have updated the readme to direct anyone struggling with this to the same link.)

Please comment whether this helped you or not.

from nextcloud-news-filter.

rhetticent avatar rhetticent commented on June 17, 2024

Thanks so much for the follow up! I did some more digging last night and found the culprit by testing filters on each feed, one-by-one. It turned out to be a misbehaving article from a Tumblr blog that came in with no title. Since Tumblr posts can contain just a photo, I'm guessing the function bugged out when it came across this title-less post.

Screenshot from 2024-02-23 15-04-42

Once I found the offending feed, as soon as I marked this one article as "read", the error went away.

Just for good measure, I tried it again by marking the offending article as unread and escaping \b's backslashes with an additional \, but it failed in the same manner as before. No worries though - it seems to be a pretty obscure edge case, so I'll probably just keep it in mind if I see failures in the future. :)

(Sidebar - thanks so much for building this tool. It's a massive time saver for me!)

from nextcloud-news-filter.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.