Image 01
profile-image

OneBadV8

Rob Wheeler
Online Radio AD Blocker

VLC Extensions 16 comments

Score 67.1%
Aug 13 2015
I rewrote the original script to instead stop and then start playing the stream which I found causes the ad to be skipped entirely. I only tested this with DI.fm, but I would imagine this works with others. Please reach out with any questions.

function descriptor()
   return {
title = "Online Radio AD blocker",
author = "joe.meszaros@gmail.com",
version = 0.3,
shortdesc = 'AdBlock',
url = '',
description = "It always annoying when a commercial unexpectedly interrupts your relaxation and tries to sell you irrelevant products and services again and again every day. Hey, what happened? I want to listen my online radio without ads! With this extension (after configuration) the volume level is automatically set to 0 when an AD is recognized",
capabilities = {"input-listener"}
}
end


function meta_changed()
   vlc.msg.info("... meta_changed ...")
t = get_now_playing()
vlc.msg.info("Now playing:")
vlc.msg.info(t)
prev = block
block = string.find(t,"Digitally Imported.*TAG") or string.find(t, 'More of the show after these messages') or string.find(t, 'Get Digitally Imported Premium') or string.find(t, 'webex') or string.find(t, 'di.fm/premium') or string.find(t, "There's more to Digitally Imported!") or string.find(t, 'PhotonVPS.com') or string.find(t, 'DI.fm')
if block then
vlc.msg.info("Found AD, stop")
vlc.playlist.stop()
vlc.msg.info("Go to first track in playlist")
vlc.playlist.goto(1)
vlc.msg.info("Replay stream to skip ad")
vlc.playlist.play()
end
end


function activate()
end

function deactivate()
end

function get_now_playing(str)
    local item = vlc.item or vlc.input.item()
if not item then
return ""
end
local metas = item:metas()
if metas["now_playing"] then
return metas["now_playing"]
else
return ""
end
end
- Nov 16 2015
Score 67.1%
Nov 16 2015