diff --git a/README.md b/README.md index 53fefad..1db13ce 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,6 @@ - No ads - Proxy support (maybe Tor too in the future) - Customizable but requiring almost no or no configuration (simple to use) -- *Todo Tree -surely way more* ### Documentation diff --git a/app.ts b/app.ts index 3f44aed..3026f6b 100644 --- a/app.ts +++ b/app.ts @@ -15,11 +15,22 @@ const search = async (params: Record) => { else if (params.lang != undefined) url += '&hl=' + params.lang } + //Random user agent + const rdmStr = () => Date.now().toString(36) + Math.random().toString(36).substring(2) + const OSs = [ + 'Windows NT;', + 'Macintosh', + 'X11; Linux x86_64', + 'X11; Linux i686', + 'X11; CrOS i686', + 'X11; OpenBSD i386', + 'X11; NetBSD' + ] const getDoc = async (url: string) => new DOMParser().parseFromString( await fetch(url, { headers: { - 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36 OPR/38.0.2220.41' + 'user-agent': `Mozilla/5.0 (${OSs[~~(Math.random() * OSs.length)]} ${rdmStr()}) AppleWebKit/${rdmStr()} (KHTML, like Gecko) Chrome/${Math.floor(Math.random() * (500 - 50)) + 49} Safari/${rdmStr()} OPR/${rdmStr()}` } }).then(res => res.text()), 'text/html' diff --git a/views/images.hbs b/views/images.hbs index f262178..eacc638 100644 --- a/views/images.hbs +++ b/views/images.hbs @@ -94,7 +94,7 @@ } main>img { - margin-bottom: 1rem; + margin: .5rem .25rem; cursor: pointer; } @@ -111,6 +111,7 @@ padding: 2.5rem 1rem; text-align: center; width: 32.5%; + height: 75vh; } figure {