This commit is contained in:
Matt Behrens 2018-04-02 21:48:56 -04:00
parent 323a1660f0
commit 7bbac451bc
5 changed files with 9 additions and 4 deletions

View file

@ -1,2 +1,3 @@
from fediplay.cli import cli
'''A Mastodon client for playing your friends' music.'''
from fediplay.cli import cli

View file

@ -3,4 +3,3 @@
from fediplay.cli import cli
cli()

View file

@ -6,10 +6,11 @@ import sys
import click
from mastodon import Mastodon
import fediplay.env as env
import fediplay.mastodon as mastodon
def api_base_url_from_instance(instance):
'''Create an API base url from an instance name.'''
return 'https://' + instance
@click.group()

View file

@ -5,9 +5,13 @@ from os import getenv
from dotenv import load_dotenv, find_dotenv
def no_check_certificate():
'''Returns whether fediplay should check TLS certificates.'''
return bool(getenv('FEDIPLAY_NO_CHECK_CERTIFICATE'))
def play_command():
'''Returns the play command fediplay should use to play a file.'''
return (getenv('FEDIPLAY_PLAY_COMMAND') or
'ffplay -v 0 -nostats -hide_banner -autoexit -nodisp {filename}')

View file

@ -49,7 +49,7 @@ def login(client, grant_code):
def stream(api_base_url):
'''Stream statuses and add them to a queue.'''
client = Mastodon(client_id='clientcred.secret',
client = Mastodon(client_id='clientcred.secret',
access_token='usercred.secret',
api_base_url=api_base_url)
listener = StreamListener(Queue())