Skip to content

Commit

Permalink
add support for config host and port
Browse files Browse the repository at this point in the history
partial fix for #38
  • Loading branch information
jonian committed Dec 7, 2020
1 parent 9b9cd4f commit 1209f1a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions acestream_launcher/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def __init__(self):
self.isatty = sys.stdin.isatty()
self.config = configparser.RawConfigParser({
'engine': 'acestreamengine --client-console',
'host': '127.0.0.1',
'port': '6878',
'player': 'mpv',
'timeout': '30',
'verbose': 'False'
Expand Down
9 changes: 8 additions & 1 deletion acestream_launcher/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def __init__(self):
default=config.getboolean('verbose')
)

self.host = config.get('host')
self.port = config.getint('port')
self.args = parser.parse_args()
self.noty = NotifyHandler(self.args.player)

Expand Down Expand Up @@ -76,7 +78,12 @@ def play(self, url):
self.player.start(url=url, **self.output)

def run(self):
self.stream = StreamHandler(bin=self.args.engine, timeout=self.args.timeout)
self.stream = StreamHandler(
bin=self.args.engine,
host=self.host,
port=self.port,
timeout=self.args.timeout
)

self.stream.connect('notify', self.notify)
self.stream.connect('stats::updated', self.stats)
Expand Down

0 comments on commit 1209f1a

Please sign in to comment.