Skip to content

Commit

Permalink
fix: migrate to new streamlink options format
Browse files Browse the repository at this point in the history
  • Loading branch information
biodrone committed Sep 9, 2023
1 parent 1d89efe commit acb8229
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions streamdl_proto_srv.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

import logging
import os
from streamlink import Streamlink, PluginError, NoPluginError

from streamlink.exceptions import PluginError, NoPluginError
from streamlink.session import Streamlink
from streamlink.options import Options
import stream_pb2 as pb
import stream_pb2_grpc as pb_grpc
from concurrent import futures
Expand Down Expand Up @@ -44,11 +47,12 @@ def serve():

def get_stream(r):
session = Streamlink()
session.set_plugin_option("twitch", "twitch-disable-ads", True)
session.set_plugin_option("twitch", "twitch-disable-reruns", True)
options = Options()
options.set("twitch", "twitch-disable-ads", True)
options.set("twitch", "twitch-disable-reruns", True)

try:
stream = session.streams(url=(r.site + "/" + r.user))
stream = session.streams(url=(r.site + "/" + r.user), options=options)

if not stream:
# logger.warning(f"No streams found for user {user}")
Expand Down

0 comments on commit acb8229

Please sign in to comment.