mrpond / BlockTheSpot

Video, audio & banner adblock/skip for Spotify
MIT License
10.28k stars 686 forks source link

Spotify premium sponsored banner #9

Closed BlitW0 closed 4 years ago

BlitW0 commented 4 years ago

Describe the bug All ads are blocked, except the spotify premium banner on the home tab. Instead of 'Home' as heading, the banner is displayed(possibly covering the heading).

Desktop:

Additional context I started using BlockTheSpot only recently, so I don't know if it is even possible to block the premium banner. I am using v0.26.

mrpond commented 4 years ago

Wow, seem you region had other domain in host.h(https://github.com/mrpond/BlockTheSpot/blob/master/src/hosts.h) block list Help me update it,

  1. replace chrome_elf.dll from this chrome_elf_log.zip

  2. after open spotify wait for the banner to be loaded,

  3. browse to spotify installation folder and paste the content in "hostlog.txt"

here are the code I add into DLL in the case you don't trust the dll above so you can recompile it. host.cpp

int WINAPI getaddrinfohook (DWORD RetAddr,
    pfngetaddrinfo fngetaddrinfo,
    const char* nodename,
    const char* servname,
    const struct addrinfo* hints,
    struct addrinfo** res)
{
    for (size_t i = 0; i < sizeof (whitelist) / sizeof (whitelist[0]); i++)
    {
        if (strstr (nodename, whitelist[i]) != NULL)
            return fngetaddrinfo (nodename, servname, hints, res);
    }
    for (size_t i = 0; i < sizeof (blockhost) / sizeof (blockhost[0]); i++)
    {
        if (strstr (nodename, blockhost[i]) != NULL)
            return WSANO_RECOVERY;
    }
    // log the missing
    std::ofstream logfile;
    logfile.open ("hostlog.txt", std::ios::out | std::ios::app);
    logfile << nodename << '\n';
    logfile.close ();
    return fngetaddrinfo (nodename, servname, hints, res);
}

stdafx.h add #include after #include

// TODO: reference additional headers your program requires here
#include <winsock2.h>
#include <winhttp.h>
#include <fstream>
#include "HookApi.h"
#include "hosts.h"
BlitW0 commented 4 years ago

It seems that the domain you are talking about is the proxy server used by my college. Following are the complete contents of "hostlog.txt":

proxy.iiit.ac.in
proxy.iiit.ac.in
proxy.iiit.ac.in
proxy.iiit.ac.in

I tried using the Spotify app with VPN(Windscribe Free) turned on, and the banner was indeed blocked. It seems that my college proxy server is causing the banner to not be blocked, although I'm not sure how it is interfering with BlockTheSpot.

mrpond commented 4 years ago

it is proxy (your network) issue. you can change spotify proxy settings -> none. maybe it work. or use adguard dns https://adguard.com/en/adguard-dns/overview.html

mrpond commented 4 years ago

v0.31 release, I add built-in AdGuard DNS blocking. https://github.com/mrpond/BlockTheSpot/blob/master/chrome_elf.zip

help me test it.

BlitW0 commented 4 years ago

The premium banner is visible again with v0.31, can't see or hear any other ads except this. I'm using no proxy option in Spotify this time.

BlitW0 commented 4 years ago

Spotify does not launch with the debug module and for some reason, the banner does not appear with windscribe VPN.

BlitW0 commented 4 years ago

This one is also not working.

mrpond commented 4 years ago

try run spotify as admin, if it not working, this is special made for you :) chrome_elf_bypasswpad.zip

TheRaven815 commented 4 years ago

It is working properly (v0.31 release) on Windows 10 1909 x64. Also, there is no premium banner on homepage of spotify (1.1.19.480.g7d17e3ce). Thank you so much. Başlıksız-1

jayloofah commented 4 years ago

I still can still find the banner on the front page. However, I am currently on a different VPN service. When I disable the VPN, the banner disappears.

There also appears to be some delay upon Spotify loading, where the internet connection is blocked entirely.

BlitW0 commented 4 years ago

try run spotify as admin, if it not working, this is special made for you :) chrome_elf_bypasswpad.zip

This one does not show the banner. Although sometimes thumbnails load slower or song gets paused for a few seconds(sometimes while loading the thumbnail), but it does not happen very often. The official release(v0.31) still shows the banner.

jayloofah commented 4 years ago

I see. I think the integration of the DNS filter might have resulted in a pretty heavy slowdown on startup. It might be worthwhile looking into.

12

mrpond commented 4 years ago

@BlitW0 v0.34 is now out! in your network set Skip_wpad in config.ini to 1 will bypass local proxy

[Config]
AdGuardDNS = 1
Log = 0
Skip_wpad = 1