-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SponserBlock Support #222
Comments
The script.service.sponsorblock addon now supports multiple apps, though a PR is still needed for Tubed. It would be easiest to add it in the script instead of this plugin directly. As the one that added support for Create A minimal implementation could look like this: from six.moves.urllib import parse as urlparse
from .abstract_api import AbstractApi
from .models import NotificationPayload
from ..utils.xbmc import get_playing_file_path
class TubedApi(AbstractApi):
def parse_notification_payload(self, data): # type: (str) -> NotificationPayload | None
return None
def get_video_id(self): # type: () -> str | None
try:
path_url = urlparse.urlsplit(get_playing_file_path())
query = urlparse.parse_qs(path_url.query)
except Exception:
return None
valid_url = (
path_url.scheme == "plugin"
and path_url.path.startswith("/")
)
return query.get("video_id")[0] if valid_url else None
def should_preload_segments(self, method, data): # type: (str, NotificationPayload) -> bool
return False Reference:
In from .invidious_api import InvidiousApi
from .youtube_api import YouTubeApi
from .tubed_api import TubedApi
# …
API_MAP = {
"plugin.video.youtube": YouTubeApi,
"plugin.video.invidious": InvidiousApi,
"plugin.video.tubed": TubedApi
} Finally, in <visible>String.IsEqual(ListItem.Property(Addon.ID),plugin.video.youtube) | String.IsEqual(ListItem.Property(Addon.ID),plugin.video.invidious) | String.IsEqual(ListItem.Property(Addon.ID),plugin.video.tubed)</visible> I have not tested the code above, and it would be missing some features like preloading segments. However, 90% of the functionality, including skipping sponsor segments, should work. If a Tubed user could test this implementation, feel free to do a PR. 👍 |
What Problem Does This Solve?
Adds Sponserblock to Tubed
Suggest a Solution (optional)
I understand this will have to be after this app gets working again without api, however there is code for this for the regular Kodi Youtube app. There is a request there to add tubed support but its been there for a year. Just wondering if you could either add Sponserblock as a setting into this Kodi app or help support progress on their project for support.
The text was updated successfully, but these errors were encountered: