Skip to content

Commit

Permalink
feat(recorder): use absolute import path
Browse files Browse the repository at this point in the history
  • Loading branch information
hldh214 committed Oct 12, 2019
1 parent fa5ecc2 commit 42b553c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ python >= 3.5
git clone https://github.com/hldh214/recorder.git
cd ./recorder
pip install -r requirements.txt
python recorder/recorder.py
python -m recorder.recorder
```

## Built With
Expand Down
12 changes: 6 additions & 6 deletions recorder/recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import googleapiclient.errors
import toml

import destination.youtube
import ffmpeg
import recorder.destination.youtube
import recorder.ffmpeg as ffmpeg

video_name_sep = '|'

Expand All @@ -32,7 +32,7 @@ def get_config(filename='config.toml'):


def record_thread(source_type, room_id, name, sticky_m3u8=None, interval=5):
source = importlib.import_module('source.{}'.format(source_type))
source = importlib.import_module('recorder.source.{}'.format(source_type))

while True:
if source.is_live(room_id):
Expand All @@ -44,7 +44,7 @@ def record_thread(source_type, room_id, name, sticky_m3u8=None, interval=5):
time.sleep(interval)


def recorder(config):
def my_recorder(config):
for name, conf in config.items():
conf.update({'name': name})

Expand Down Expand Up @@ -174,9 +174,9 @@ def upload_validator(youtube):

def main():
config = get_config()
youtube = destination.youtube.Youtube(config['youtube'])
youtube = recorder.destination.youtube.Youtube(config['youtube'])

recorder(config['source'])
my_recorder(config['source'])

uploader(config['source'], youtube)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

setup(
name='recorder',
version='1.1.2',
version='1.1.3',
description='stream recorder && automatic upload',
long_description=readme,
author='Jim Liu',
Expand Down

0 comments on commit 42b553c

Please sign in to comment.