diff --git a/README.md b/README.md index d005697..8582028 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,16 @@ _NOTE: This project was quickly put together to explore diy automated broadcasti ### how to run - install python3 on your computer (i think you may need 3.9 or higher ?) -- clone this repo `git clone git@github.com:cyberboy666/obs_scheduler.git` and then `cd obs_scheduler` into the folder +- clone this repo `git clone https://github.com/cyberboy666/obs_scheduler.git` and then `cd obs_scheduler` into the folder + +### if you want to install virtual envirnment: + +``` +sudo apt-get install python3-venv +python3 -m venv venv +source venv/bin/activate +``` + - install dependancies: `pip3 install -r requirements.txt` - open OBS and enable web-sockets (tools -> websocket server settings -> enable websocket server) and set `port:4444` and password `your_password` - or update `obs_scheduler.py` with port/password used here - run the program: `python3 obs_scheduler.py ` diff --git a/obs_scheduler.py b/obs_scheduler.py index 907daf5..6971984 100644 --- a/obs_scheduler.py +++ b/obs_scheduler.py @@ -38,16 +38,6 @@ def parse_playlist(playlist_path): run_time = run_time + segment.duration return videos -def generate_schedule(start_time, playlist_path): - videos = parse_playlist(playlist_path) - schedule = [] - current_time = start_time - for video in videos: - end_time = current_time + timedelta(seconds=video['duration']) - schedule.append({'title': video['title'], 'start_time': current_time, 'end_time': end_time}) - current_time = end_time - return schedule - def start_stream(playlist_path, stream_name): global stream_active, current_playlist, schedule try: @@ -95,7 +85,6 @@ def start_stream(playlist_path, stream_name): logging.info("Starting stream with playlist: {}".format(playlist_path)) current_playlist = playlist_path start_time = datetime.now() - schedule = generate_schedule(start_time,playlist_path) cl.start_stream() stream_active = True