GithubHelp home page GithubHelp logo

twitchlivecheck's Introduction

TwitchLiveCheck

  1. Twitch helix api를 활용한 다수의 스트리밍 확인
  2. streamlink를 활용한 생방송 다운로드

구현 완료

  • 다수의 스트리머 생방송 여부 확인
  • 화질 설정
  • 화질 탐색 반복 기능(생방송 초기에 저화질만 나오는 경우 일정 횟수 동안 원하는 화질이 생겼는지 확인)
  • 영상 저장 위치 지정
  • streamlink를 활용해 생방송 다운로드
  • 에러 로깅(traceback 활용)
  • cli arguments 기능
  • 외부 config 파일 로딩 기능
  • 외부 config 파일을 통한 실행

TwitchLiveCheck

  1. Check multiple streams using Twitch helix api
  2. Download live broadcast using streamlink

requirements:

python 3.9 or later
python requests 5.0.1 or later
streamlink 5.0.1 or later

Usage:

  1. install Python
  2. in your terminal, type pip install requests
  3. install Streamlink
  4. create your Client ID and Client Secret from https://dev.twitch.tv/console/apps/create/
  5. open TwitchLiveCheck.py as your editor
  6. modify the internal variable of __init__(self) by referring to the comments
def __init__(self) -> None:
  self.streamerID = ''   # You can enter up to 100 streamers(api maximum limit), separated by spaces example: "username1 username2 ... "
  self.quality_by_streamer = {}   # You can enter the streamer-specific quality if necessary. Don't overlap self.streamerID. example: {"username 1":"quality 1", "username 2":"quality 2"}
  self.quality = 'best'   # Set recording quality.
  self.refresh = 1.5   # Check interval (in seconds) to check for streams. you can enter decimals
  self.check_max = 20   # Set the number of times to check the recording quality. If there's no recording quality beyond the number of searches, change the quality to best. you must enter an integer
  self.root_path = r''   # Set recording path. do not delete the 'r' character
  self.traceback_log = True   # if True, save traceback log file
  self.quality_in_title = False   # if True, add quality info to title

  self.custom_options = ''   # cli options for streamlink, separated by spaces. example: 'option1 value1 option2 value2 ... '
  self.legacy_func = False   # if True, use legacy quality check functions
  self.config_path = r''   # set config file path. do not delete the 'r' character

  self.client_id = ''   # Client ID
  self.client_secret = ''   # Client Secret
  1. type python TwitchLiveCheck.py in your terminal
  2. if you want to put command line arguments, type python TwitchLiveCheck.py -h in your terminal
  3. if you enter the configuration file path to self.config_path, TwitchLiveCheck will load the file and fill __init__ automatically
  4. if you enter the TwitchLiveCheck path to the configuration file, you can run it through the configuration file

twitchlivecheck's People

Contributors

dig04214 avatar

Stargazers

 avatar Dave Cations avatar PSingletary avatar

Watchers

Kostas Georgiou avatar  avatar

twitchlivecheck's Issues

Exception: Malformed query params.

존재하지 않는 user_login을 요청하면 발생하는 것으로 추정.

계획:

  • user_login 전부 에러 발생 시 종료, 하나만 발생 시 그 부분만 제거
  • 콘솔에 적절한 출력, 필요 시 별도 파일 생성

프로세스 별로 로거 구분

동시에 실행되는 프로세스들은 하나의 로그 파일을 공유함.
동시에 실행되어도 프로세스 별로 로그 파일을 생성하도록 변경해야 함.

0.1.8 md

작업한 내용에 맞게 readme파일 수정

gql 이용 화질 체크 추가

streamlink를 이용하는 방식이 아닌 직접 gql 통신으로 화질 정보 받기
streamlink가 구동되는 시간이 사라져 속도 개선 예상

ValueError: list.remove(x): x not in list

네트워크 상태가 좋지 않을 때 발생하는 것으로 추정
상세 원인 파악 필요

계획:

  • 원인 파악
  • 해결 불가능 시 streamerID 백업하고 ValueError 발생 시 덮어씌우는 작업 수행

os.path → pathlib

현재 os.path와 pathlib 둘다 사용중.
역할이 겹치므로 pathlib으로 통일

run() 분리

기능 테스트가 가능하도록 run() 분리
run()에서 변수 생성, 가공 부분을 다른 함수로 분리

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.