Skip to content

Commit d72d03f

Browse files
iostreamiostream
authored andcommitted
block ads from facebook
1 parent 1eae04e commit d72d03f

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<h4 align="center">A multi-purpose adblocker and skip bypass for the <strong>Windows</strong> Spotify Desktop Application.</h4>
1111
<h5 align="center">Please support Spotify by purchasing premium</h5>
1212
<p align="center">
13-
<strong>Last updated:</strong> 18 July 2020<br>
13+
<strong>Last updated:</strong> 17 August 2020<br>
1414
<strong>Last tested version:</strong> 1.1.39.612.g1e7e78a4
1515
</p>
1616
</center>

src/hosts.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ std::wofstream logging;
77

88
_getaddrinfo getaddrinfo_orig;
99

10+
const std::array<std::string, 4> blockList = { "google", "doubleclick", "qualaroo.com" , "fbsbx.com" };
11+
1012
// check if ads hostname
1113
bool is_blockhost (const char* nodename) {
14+
1215
std::string nnodename (nodename);
1316

1417
if (0 == nnodename.compare ("wpad"))
1518
return g_skip_wpad ? true : false;
16-
17-
if (std::string::npos != nnodename.find ("google"))
18-
return true;
19-
if (std::string::npos != nnodename.find ("doubleclick"))
20-
return true;
21-
if (std::string::npos != nnodename.find ("qualaroo.com"))
22-
return true;
19+
for (auto i : blockList) {
20+
if (std::string::npos != nnodename.find (i))
21+
return true;
22+
}
2323
return false;
2424
}
2525

src/stdafx.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <winsock2.h>
1717
#include <Psapi.h>
1818

19+
#include <array>
1920
#include <fstream>
2021
#include <future>
2122

0 commit comments

Comments
 (0)