laluka / bypass-url-parser Goto Github PK
View Code? Open in Web Editor NEWbypass-url-parser
Home Page: https://linktr.ee/TheLaluka
License: GNU Affero General Public License v3.0
bypass-url-parser
Home Page: https://linktr.ee/TheLaluka
License: GNU Affero General Public License v3.0
Hello,
By default, BUP tries to find the title of the web page using the following regex (line 1236 on my version):
REGEX_TITLE = re.compile(r"<title>(.*)</title>", re.IGNORECASE)
The problem is the greedy (.*)
part which could match several HTML "title" tags, and pollute the output logs (I often ran in this case, but can't share the targets here).
To fix this you could simply use an operator to make the regex "lazy":
REGEX_TITLE = re.compile(r"<title>(.*?)</title>", re.IGNORECASE)
Thus, the match will stop at the first "</title>" tag. Of course, you'll have to make sure that the "search" (line 1532 on my version) doesn't return a list if there are multiple "title" tags in the page.
Example of problematic data:
<html><title>sample_page</title><body><title>sample_page_indeed</title></body></html>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.