Skip to content

Commit

Permalink
Added folder creation for recorded streams.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDaChicken committed Jun 16, 2019
1 parent 7258ba6 commit c5e9397
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
8 changes: 8 additions & 0 deletions SERVER/PYTHON-FILES/Code/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from threading import Thread
from time import sleep

Expand Down Expand Up @@ -102,3 +103,10 @@ def check_internet():
def enable_debug():
global DebugMode
DebugMode = True


def setupStreamsFolder():
# RecordedStreams
recorded_streams_dir = os.path.join(os.getcwd(), "RecordedStreams")
if os.path.exists(recorded_streams_dir) is False:
os.mkdir(recorded_streams_dir)
11 changes: 3 additions & 8 deletions SERVER/PYTHON-FILES/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import argparse
from time import sleep
from Code import run_channel, check_internet, enable_debug
from Code import run_channel, check_internet, enable_debug, setupStreamsFolder
from Code.log import stopped, warning, disable_youtube_reply
from Code.serverHandler import run_server
from Code.dataHandler import createDataFile, loadData, doesDataExist
Expand All @@ -16,20 +16,15 @@

parser_args = parser.parse_args()

channel_ids = []
setupStreamsFolder()

if not doesDataExist():
createDataFile()

data = loadData()
channel_ids.extend(data['channel_ids'])
del data
channel_ids = loadData()['channel_ids']

if not check_internet():
stopped("Not able to access the internet!")

sleep(.2)

if parser_args.disable_reply:
disable_youtube_reply()

Expand Down

0 comments on commit c5e9397

Please sign in to comment.